Created
August 12, 2013 21:07
-
-
Save ingyesid/6215271 to your computer and use it in GitHub Desktop.
show hash for facebook sdk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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