如何生成使用Eclipse调试密钥库我的MD5和SHA1指纹(安卓)

问题描述:

我可以生成使用Eclipse为我调试密钥库我的MD5和SHA1指纹?也有$ C $下生成我的哈希键的Facebook呢?

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?

让你的SHA1和MD5指纹调试密钥库(也适用于您的其他密钥库)。 去你打包exporler在日食(默认为左侧),右键单击它>安卓工具>导出签名的应用程序包

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

然后导航至您的调试密钥库通常在.android文件夹并选择它

Then navigate to your debug keystore normally in your .android folder and select it

再输入这是机器人,没有引号密码

Then enter the password which is "android" with no quotes

接着,它会要求一个别名单击下拉列表,然后选择androiddebugkey并再次,进入Android作为密码。

Next it will ask for an alias click the drop down list and select androiddebugkey and again, enter android as the password.

接下来,如果你向下滚动,它会显示MD5和SHA1拇指指纹,如果你向下滚动

Next if you scroll down it will show the MD5 and SHA1 thumb print if you scroll down

然后就取消并使用它,你怎么想,如果你想你的哈希键只粘贴在你的onCreate

then just cancel and use it how you want if you want your hash key just paste this under your onCreate

替换com.you.name到你的应用程序包的名字。

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());
}