Keytool Signing Problem: Keystore was tampered wit

2019-01-09 06:18发布

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).

5条回答
对你真心纯属浪费
2楼-- · 2019-01-09 06:52

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.

查看更多
啃猪蹄的小仙女
3楼-- · 2019-01-09 06:56

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.

查看更多
贼婆χ
4楼-- · 2019-01-09 06:57

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.

查看更多
混吃等死
5楼-- · 2019-01-09 07:03

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.

查看更多
不美不萌又怎样
6楼-- · 2019-01-09 07:08

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

查看更多
登录 后发表回答