facebook 密钥散列
fun getFacebookHashKey(): String? {
try {
val info = packageManager.getPackageInfo(packageName, PackageManager.GET_SIGNATURES)
for (signature in info.signatures) {
val md = MessageDigest.getInstance("SHA")
md.update(signature.toByteArray())
return Base64.encodeToString(md.digest(), Base64.DEFAULT)
}
} catch (e: java.lang.Exception) {
return "get error"
}
return null
}
//签名脚本获取
keytool -exportcert -alias YOUR_RELEASE_KEY_ALIAS -keystore YOUR_RELEASE_KEY_PATH | openssl sha1 -binary | openssl base64