How to handle a lost KeyStore password in Android?
I have forgotten my Keystore password and I don't really know what to do anymore (I can't or won't give any excuses for it). I want to update my app because I just fixed a bug but it's not possible anymore. What happens if I use the same Keystore but create a new key? Would I still be able to update the app and if it's not possible, how can I go about giving information to users about the updated version?
If anybody has had a problem like this or has come across troubles, what advice can you give to help remedy the situation? Fortunately, it is a free app.
Solution 1:
Just encountered this problem myself - luckily I was able to find the password in some Gradle's temporary file. Just in case anyone lands here:
try looking for this file
..Project\.gradle\2.4\taskArtifacts\taskArtifacts.bin
or
.gradle/3.5/taskHistory/taskHistory.bin
.gradle/5.1.1/executionHistory/executionHistory.bin
.gradle/caches/5.1.1/executionHistory/executionHistory.bin
.gradle/5.1.1/executionHistory/executionHistory.bin
.gradle/3.5/taskHistory/taskHistory.bin
.gradle/2.10/taskArtifacts/taskArtifacts.bin
and search for
storePassword
It was there in cleartext. In general, if you do remember at least a part of your password, try searching for a file containing this substring and hopefully you will fish out something.
Wanted to throw it out here, maybe it will eventually help someone.
Edit: Added new insight from comments, just to be more visible. Edit 2: Added some more locations reported in comments.
Thanks to Vivek Bansal, Amar Ilindra and Uzbekjon for these.
Solution 2:
See this link
It's unfortunate, but when you lose your keystore, or the password to your keystore, your application is orphaned. The only thing you can do is resubmit your app to the market under a new key.
ALWAYS backup up your keystore and write the passwords down in a safe location.
Solution 3:
Brute is your best bet!
Here is a script that helped me out:
https://code.google.com/p/android-keystore-password-recover/wiki/HowTo
You can optionally give it a list of words the password might include for a very fast recover (for me it worked in <1 sec)
Solution 4:
In case a wrong password is provided, even just once, it keeps saying on next attempts:
Keystore tampered with or password incorrect.
Even when you provide the correct one. I tried it several times, maybe it's some kind of protection.
Close the export wizard and start it again with the correct password, now it works :)
Solution 5:
Finally i found the solution after spending two days...
Follow these steps:
- Go to project
- In .gradle find your gradle version folder in my case it was 4.1 (Refer pic)
- expand the 4.1 folder and then in taskHistory folder you will find taskHistory.bin file.
- Open taskHistory.bin file in android studio itself.
- Search for ".storePassword" .. That's it you got your keystore password.
This really worked to me.
Try this and happy coding!!!