get 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
![enter image description here](https://i.stack.imgur.com/kxKt2.png)
Then enter the password which is "android" with no quotes
![enter image description here](https://i.stack.imgur.com/27Utr.png)
Next it will ask for an alias click the drop down list and select androiddebugkey and again, enter android as the password.
![enter image description here](https://i.stack.imgur.com/BuB14.png)
Next if you scroll down it will show the MD5 and SHA1 thumb print if you scroll down
![enter image description here](https://i.stack.imgur.com/1b9P4.png)
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());
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…