JDK 7 更改 keytool 输出
我正在使用 JDK 的 keytool 来生成 Google Maps API 密钥指纹。在多次被拒绝的同时,我意识到最近我已经将JDK升级到1.7了。所以我将目录切换到 JDK6(谢天谢地,旧版本仍然存在。),并重复相同的命令:
D:\.android>"C:\Program Files\Java\jre6\bin\keytool" -list -alias androiddebugkey -keystore debug.keystore -storepass android -keypass android
然后 Bang!有用。结果发现JDK7生成的是SHA1指纹而不是MD5,这导致我提交给Google被拒绝。 所以我想知道为什么新版本的JDK会出现这种情况。有人有一些线索吗?
I'm using keytool of JDK to generate the Google Maps API key fingerprint. While being rejected for several times, I realized that I've upgraded JDK to 1.7 recently. So I switch my dir to JDK6 (Thank god, the old version remains.), and repeated the same command:
D:\.android>"C:\Program Files\Java\jre6\bin\keytool" -list -alias androiddebugkey -keystore debug.keystore -storepass android -keypass android
and Bang! It works. Turned out that JDK7 generated the SHA1 fingerprint instead of MD5, which leads to the rejection of my submission to Google.
So I'm wondering why this happens for the new version of JDK. Any one have some clues?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
keytool
命令具有参数-keyalg
,该参数采用算法名称并根据该算法生成密钥。据我了解,这只是意味着该命令的默认算法已更改。我不知道这是一个有意识的选择还是一个错误 - 您可能想将其报告给 Oracle。
The
keytool
command has the parameter-keyalg
that takes an algorithm name and generates the key according to that algorithm. As far as I understand, it just means that the default algorithm for that command has changed.I do not know whether it is a conscious choice or a bug - you may want to report it to Oracle.
keytool.exe -v 为您提供不同的指纹,例如 MD5 等。
示例:
C:[jedk 路径]\bin\keytool.exe" -v -list -keystore "C:\Document
s 和 Settings\Administrator.android\debug.keystore"
keytool.exe -v provides you different fingerprints, such as MD5 etc.
exampl:
C:[jedk path]\bin\keytool.exe" -v -list -keystore "C:\Document
s and Settings\Administrator.android\debug.keystore"
将
-digestalg SHA1 -sigalg MD5withRSA
与 jarsigner 结合使用。Use
-digestalg SHA1 -sigalg MD5withRSA
with jarsigner.详细说明已接受的答案:
使用 JDK 1.7,我遇到了授权失败问题。我终于弄清楚如何使用 SHA1 生成正确的调试密钥库。这是我使用的命令:
生成后,您可以使用以下命令查看它:
签名算法现在应该读取“SHA1withRSA”。复制 SHA1 指纹并将其粘贴到 Google 控制台“Android 应用程序密钥”中,然后就可以开始了。
To elaborate on the accepted answer:
With JDK 1.7 I was having Authorization failure issues. I finally figured out how to generate the right debug keystore, using SHA1. Here's the command I used:
After generating it, you can see it by using the command:
The Signature algorithm should now read "SHA1withRSA". Copy the SHA1 fingerprint and paste it in the Google console "Key for Android apps", and you should be good to go.