答案 0 :(得分:0)
public void generateHashkey(){
try {
PackageInfo info = getPackageManager().getPackageInfo(PACKAGE, PackageManager.GET_SIGNATURES);
for (Signature signature : info.signatures) {
MessageDigest md = MessageDigest.getInstance("SHA");
md.update(signature.toByteArray());
String s = Base64.encodeToString(md.digest(),
Base64.NO_WRAP);
Log.e("HASH KEY ", s);
}
} catch (PackageManager.NameNotFoundException e) {
Log.d("Name not found", e.getMessage(), e);
} catch (NoSuchAlgorithmException e) {
Log.d("Error", e.getMessage(), e);
}
}
尝试生成hashkey,然后将其粘贴到开发者控制台facebook。