Skip to content

Instantly share code, notes, and snippets.

@ingyesid
Created August 12, 2013 21:07
Show Gist options
  • Save ingyesid/6215271 to your computer and use it in GitHub Desktop.
Save ingyesid/6215271 to your computer and use it in GitHub Desktop.
show hash for facebook sdk
public class Util{
public void printHashKey(Context context) {
try {
PackageInfo info = context.getPackageManager().getPackageInfo(
"com.clickdelivery.android.redwings",
PackageManager.GET_SIGNATURES);
for (Signature signature : info.signatures) {
MessageDigest md = MessageDigest.getInstance("SHA");
md.update(signature.toByteArray());
Log.d("TEMPTAGHASH:",
Base64.encodeToString(md.digest(), Base64.DEFAULT));
}
} catch (NameNotFoundException e) {
e.printStackTrace();
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment