Reputation: 1839
I would like to change the password I use in my keystore for an android app that is already available in google play and I would like to know some things before I do it:
1) If I change the keystore password, could I continue using the same keystore for my uploaded app without any issue (I need to do this, this is why I ask)
2) Does changing my alias password has the same consequences?
3) How should I use keytool?
Upvotes: 44
Views: 35496
Reputation: 1
While I was using Bubblewrap
, to generate a TWA APK
by wrapping a PWA
(deployed in netlify to get https link), I got struck at a point while building where my key & key-store password
was wrong
.
So, I manually deleted android.keystore
file and ran
bubblewrap init --manifest=https://<my-twa.com>/manifest.json
again. It asked me to generate new password, generated new key & key-store password and resolved my issue.
bubblewrap init --manifest=https://<my-twa.com>/manifest.json
bubblewrap build
Upvotes: 0
Reputation: 2346
We don't want to include the password as part of the command to avoid storing it in the shell history.
# Change the key password
keytool -keypasswd -alias "your_key_alias" -keystore "key_filename.key"
# Change the keystore password
keytool -storepasswd -keystore "key_filename.key"
Upvotes: 23
Reputation: 1
Android Studio 4.2.x this worked for me, go to the screen where you enter your passwords, if the box to save passwords is checked, uncheck the box, replace the good passwords with any jibberish and try to build your .apk. After it fails, go back and retype the good passwords and recheck the box to save passwords.
Upvotes: -1
Reputation: 1557
If you are using the same keystore for signing your application before pushing it to the play store, it should be fine.
Changing Keystore's password or alias password doesn't affect the way it is used to generate the signed apk.
In order to update the password using keytool:
keytool -keypass "previous password" -new "new password" -keystore "keystore location"
Security Note
As mentioned in vlz's comment below.
You should not include your password in the command because it'll be written to your command history (~/.bash_history).
Instead, you can use the below command (safely prompt for a password):
keytool -storepasswd -keystore "keystore location"
Recovery plan
Make sure to backup your keystore file first.
Upvotes: 53
Reputation: 14803
The usage of keytool
might have changed in the past years. What worked for me was:
keytool -keypasswd -keystore pathToKeystoreFile -alias yourAlias -keypass oldAliasPassword -storepass oldStorePassword -new newAliasPassword
keytool -storepasswd -keystore pathToKeystoreFile -storepass oldStorePassword -new newStorePassword
PSA: Make sure to backup your keystore file first in case you accidentally introduce any typos!
Upvotes: 32
Reputation: 11194
I could change password as below:
keytool -keypasswd -alias "key alias" -keypass "previous password" -new "new password" -keystore "/../.android/debug.keystore"
Upvotes: 9