Can I generate my MD5 and SHA1 thumbprints using eclipse for my debug keystore? also is there a code for to generate my hash key for facebook as well?
See Question&Answers more detail:osCan I generate my MD5 and SHA1 thumbprints using eclipse for my debug keystore? also is there a code for to generate my hash key for facebook as well?
See Question&Answers more detail:osget your sha1 and md5 thumbprint for debug keystore (also works for your other keystores). Go to you package exporler in eclipse (defaults to the left side) right click it>android tools>export signed application package
Then navigate to your debug keystore normally in your .android folder and select it
Then enter the password which is "android" with no quotes
Next it will ask for an alias click the drop down list and select androiddebugkey and again, enter android as the password.
Next if you scroll down it will show the MD5 and SHA1 thumb print if you scroll down
then just cancel and use it how you want if you want your hash key just paste this under your onCreate
REPLACE "com.you.name" to your application package name.
PackageInfo info;
try {
info = getPackageManager().getPackageInfo( "com.you.name",PackageManager.GET_SIGNATURES);
for (Signature signature : info.signatures)
{
MessageDigest md;
md = MessageDigest.getInstance("SHA");
md.update(signature.toByteArray());
String something = new String(Base64.encode(md.digest(), 0));
//String something = new String(Base64.encodeBytes(md.digest()));
Log.e("Hash key", something);
}
} 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());
}