我在android系統得到了哈希鍵從下面的代碼:在Facebook的應用程序無效的哈希鍵安卓
try {
PackageInfo packageInfo = getPackageManager().getPackageInfo(getPackageName(),
PackageManager.GET_SIGNATURES);
for (Signature signature : packageInfo.signatures) {
MessageDigest md = MessageDigest.getInstance("SHA");
md.update(signature.toByteArray());
Log.d("KeyHash:", Base64.encodeToString(md.digest(), Base64.DEFAULT));
}
}
catch (NameNotFoundException e1) {
Log.e("Name not found", e1.toString());
}
catch (NoSuchAlgorithmException e) {
Log.e("No such an algorithm", e.toString());
}
catch (Exception e){
Log.e("Exception", e.toString());
}
但它是無效鍵...請建議如何驗證Facebook登錄哈希鍵....
謝謝...我試圖通過生成簽名的版本我自己的哈希鍵,但沒有奏效。所以我嘗試了替代伎倆..工作:) – AB1209
的伎倆工作! –