Skip to content

Instantly share code, notes, and snippets.

@nqmgaming
Last active April 8, 2025 02:55
Show Gist options
  • Save nqmgaming/5826760b4e82e8100872ca3cf4825cb3 to your computer and use it in GitHub Desktop.
Save nqmgaming/5826760b4e82e8100872ca3cf4825cb3 to your computer and use it in GitHub Desktop.
private fun logAppKeyHash() {
try {
val info = packageManager.getPackageInfo(
"com.pwhs.quickmem",
PackageManager.GET_SIGNING_CERTIFICATES
)
for (signature in info.signingInfo!!.apkContentsSigners) {
val md = MessageDigest.getInstance("SHA")
md.update(signature.toByteArray())
Timber.d("KeyHash: ${Base64.encodeToString(md.digest(), Base64.DEFAULT)}")
}
} catch (e: NameNotFoundException) {
} catch (e: NoSuchAlgorithmException) {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment