Reputation: 155
A couple of months ago I generated my android release keystore with this command:
keytool -genkey -v -keystore my-release-key.keystore -alias myalias -keyalg RSA -keysize 2048 -validity 10000
I entered a password for the keystore and wrote it down, in the last step, when it was time to enter a password for the certificate I pressed enter to use the same password as the keystore (so I had to remember only one password for the whole process).
After generating this keystore I signed my apk for release using this command:
jarsigner -verbose -keystore my-release-key.keystore my.apk myalias
where I entered my password (no problem).
Now I have to push an update to my apk in the market and when I try to sign the new apk using the command above I get a "Keystore was tampered with, or password was incorrect".
I'm puzzled, I went back to my keystore backup and I get the same problem. I'm sure the password is correct. Note that I'm not using Eclipse at all for the process (I'm signing from the command line).
What could be the problem here? Heeelppp!!
Upvotes: 5
Views: 4599
Reputation: 51
Sharing my experience with the community...
JDK 1.7 build.gradle for android
android {
compileSdkVersion 18
buildToolsVersion "17.0.0"
signingConfigs {
release {
storeFile file("../my-release.keystore")
storePassword "$MakeMyDay!"
keyAlias "my-release"
keyPassword "$MakeMyDay!"
}
}
:
When I gradlew assembleRelease, I got the dreaded "tampered with or password was incorrect" error.
Resolution:
Use a simpler password, like abcdef. Not sure if special characters like $ and ! were supported.
Upvotes: 5
Reputation: 808
The implicit keyalg, digestalg and/or sigalg has changed between different versions of Java and possibly eclipse.
Use the command line and try a couple different combinations. This worked for me after creating the key with Java 5.0 but upgrading my system to Java 6
jarsigner -verbose -keystore <.keystore> -sigalg MD5withRSA -digestalg SHA1 <apk file> <alias>
Upvotes: 0
Reputation: 4041
This error occurred with me because I had a comma in my Company name, for instance "Company, Inc." Removed the comma and everything worked ok. Hope that helps.
Upvotes: 2
Reputation: 28509
That message means the password is wrong. It looks like you have not remembered the password you used for the key store.
It's strongly advised when creating a key and password to keep copies somewhere very safe, protected from forgetting, fire, drive failure etc because the consequences can be very severe (not being able to ever update the app in the Market).
Upvotes: -4