Keytool签名问题:密钥库被篡改,或密码不正确

发布于 2024-10-04 14:48:59 字数 467 浏览 0 评论 0原文

我正在尝试为 Google Maps API 签署我的 Android 应用程序的发布版本(调试签名良好):

keytool -list -alias cancertrials -keystore /Users/syalam/Documents/workspace/Cancer_Trials/keys/release -storepass android -keypass cancertrials

但我收到错误:

java.io.IOException: Keystore was tampered with, or password was incorrect

我确信密码是正确的,因为当我尝试在 Eclipse 中导出我的应用程序时,它要求提供密钥库和密码,我输入正确。

不知道为什么我不能签名?我需要在发布模式下显示 Google 地图(在调试模式下工作)。

I am trying to sign the release version of my Android app (debug was signed fine) for the Google Maps API:

keytool -list -alias cancertrials -keystore /Users/syalam/Documents/workspace/Cancer_Trials/keys/release -storepass android -keypass cancertrials

But I get the error:

java.io.IOException: Keystore was tampered with, or password was incorrect

I am positive the password is correct, because when I try to export my app in Eclipse, it asks for the keystore and the password, and I am entering it in correctly.

Not sure why I can't sign this? I need to display Google Maps in release mode (working in debug mode).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

九八野马 2024-10-11 14:48:59

我认为当你只是做一个清单时,你不必包含商店通行证。 storepass 对私钥进行加密,在执行列表时不会显示该私钥。只需尝试以下操作:

keytool -list -keystore /Users/salam/Documents/yada/yada

然后在出现提示时提供您的密钥库密码。如果有效,那么您可以尝试在命令行上输入密钥。

您可能还想检查并确保使用相同版本的 Java。我不认为这是问题所在,但如果上述方法没有帮助,请尝试一下。

I don't think you have to include a storepass when you're just doing a list. The storepass encrypts the private key which isn't displayed when doing a list. Just try this:

keytool -list -keystore /Users/salam/Documents/yada/yada

Then provide your keystore password when prompted. If that works then you can try just the keypass on the command line.

You might also want to check and make sure your using the same version of Java. I don't think that's the problem, but if the above doesn't help try it out.

独留℉清风醉 2024-10-11 14:48:59

不知何故,在 Windows 上,keytool 不接受密码。我只需要 SHA1 密码来在 google 开发控制台上的项目上配置客户端 ID。以下似乎对我有用

keytool --list --keystore android.jks --protected

这打印了所有别名的 SHA1 密钥。

Somehow on windows, the keytool would not accept the password. I only needed the SHA1 password for configuring the client id on the project on google dev console. The following seemed to work for me

keytool --list --keystore android.jks --protected

This printed the SHA1 keys for all aliases.

三生池水覆流年 2024-10-11 14:48:59

当我切换回 1.6.0_29 时,我在 jdk1.6.0.31 上的 jarsigner 也遇到了同样的问题,jarsigner 工作正常。请注意jdk版本。

I have the same problem with jarsigner on jdk1.6.0.31 when I switched back to 1.6.0_29 jarsigner works correctly. Please be aware of jdk version.

苦妄 2024-10-11 14:48:59

检查一次您的别名。有时您的别名与 keytool 别名不同,那么它会给出相同的错误。
IE

Check your alias name once. Some times your alias is different from is keytool alias name then it gives the same error.
i.e.

玩套路吗 2024-10-11 14:48:59

keytool -list -keystore "Path of the keystore"

此命令在 linux 机器中会要求输入密码,而在 Windows 机器中,您只需要输入列表 keystore 即可。

keytool -list -keystore "Path of the keystore"

This command will ask for password in linux machines, whereas in windows machine, you just need to enter the list keystore.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文