create key hash facebook android Programatically

October 12, 2016 0 Comments

Facebook HashKey Generate Code.

After Facebook SDK Updated they are removed this.But We can use this for keyhash generation.

======================
try {
PackageInfo info = getPackageManager().getPackageInfo(
"Your package name",
PackageManager.GET_SIGNATURES);
for (Signature signature : info.signatures) {
MessageDigest md = MessageDigest.getInstance("SHA");
md.update(signature.toByteArray());
Log.d("Your KeyHash :", Base64.encodeToString(md.digest(), Base64.DEFAULT)); //print Keyhash.
}
} catch (NameNotFoundException e) {

} catch (NoSuchAlgorithmException e) {

}

Contributer

Some say he’s half man half fish, others say he’s more of a seventy/thirty split. Either way he’s a fishy bastard. Google

0 comments:

Popular Posts