1
C:\Documents and Settings\Admin\ keytool -export -alias androiddebugkey -keystore "C:\Documents and Settings\Admin\.android\debug.keystore" | D:\openssl\bin\openssl.exe sha1 -binary | D:\openssl\bin\openssl.exe enc -a 

我只是运行上面的代码来生成哈希键,但它显示了一些错误......比如

The filename ,directory name,or volume label syntax is incorrect
4

1 回答 1

2

您可以在下面查看此链接以获取分步教程

如何获取 android-facebook 应用程序的密钥哈希

如果你仍然有同样的问题,那么你可以使用下面的代码片段来生成 keyhash。这对我来说非常好。

PackageInfo packageInfo;
        try {
        packageInfo = getPackageManager().getPackageInfo("com.yourapp", 
PackageManager.GET_SIGNATURES);
        for (Signature signature : packageInfo.signatures) {
                MessageDigest md = MessageDigest.getInstance("SHA");
                md.update(signature.toByteArray());
                String key = new String(Base64.encode(md.digest(), 0));
                // String key = new String(Base64.encodeBytes(md.digest()));
                Log.e("Hash key", key);
        } 
        }
        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());
        }
于 2013-07-16T06:00:50.537 回答