119

I have an android app currently published in Google Play which I update periodically. I follow the following process to sign the app before a new push:

Press right-mouse on the project, the 'Android tools' -> export signed application package Provide keystore password Sign your app Upload the apk file into Google Play Developer Console

Recently I have imported the project from Eclipse to Android Studio and continued working on Android Studio. Now I am planning to push a fix in the app. I have figured that I have this option to sign apk in android studio

Build -> Generate Signed apk ->enter image description here

As per my understanding, for my android app I have to use the same key store and key store password which I used earlier to push updates into Google Play. Also here it's asking for Key Alias and Key Password. I don't remember the Key Alias and Key password(number 4 input in the image) while signing apk in Eclipse. Any suggestion what can I do now? If I already know my keystore and keystore password, is there an way to retrieve the key alias and alias key password?

Update: Now I can retrieve my key alias through keytool -list -v -keystore name.keystore command

MSIslam
  • 4,587
  • 6
  • 25
  • 28
  • "there was no option as Key alias or Key password while signing apk in Eclipse" -- there is in my Eclipse with the ADT plugin. In fact, it is not possible to create a key *without* an alias. – CommonsWare Jan 19 '15 at 22:59
  • In that case I might not remember. Could you please tell how to retrieve the Key alias? – MSIslam Jan 19 '15 at 23:00
  • 2
    If you have the keystore password, **`keytool`** might be able to list the aliases. It's been a while since I messed with **`keytool`** manually. – CommonsWare Jan 19 '15 at 23:01
  • I rephrasing the question then – MSIslam Jan 20 '15 at 14:48
  • @CommonsWare :If I already know my keystore and keystore password, is it okay to create new Alias Key and Alias Key password before new push to Google Play? – MSIslam Jan 20 '15 at 15:13
  • 1
    No, it is not okay to create new ones, unless you want to change to a new key and force your users to lose their app data (and at least those getting the app through the play store) to replace the existing app with one having a different name. Most likely the ones you are currently used are stored somewhere in project metadata, quite likely as plain text. – Chris Stratton Jan 20 '15 at 15:15
  • @ChrisStratton : Thanks. Could you please suggest me specifically how to retrieve it? – MSIslam Jan 20 '15 at 15:23
  • Find the form of what you are looking for, find where your eclipse installation stores things, use whatever your system provides for file content search to seek the former within the latter. – Chris Stratton Jan 20 '15 at 15:31
  • I don't have my old machine, it was damaged. I had the project in repository, from there I have downloaded and working on the project again in android studio. Luckily I stored keystore and keystore password in separate place. I will really appreciate if you could provide some suggestions to retrieve from the projects inside. – MSIslam Jan 20 '15 at 15:39
  • 4
    I actually could retrieve the alias by keytool -list -v -keystore name.keystore command. Now I need to retrieve the password. Is there any way to retrive the alias key password? – MSIslam Jan 20 '15 at 16:57
  • @MSI That would somewhat defeat the purpose of the password. If you can't remember having an alias previously the likelihood is you set the keystore and key password to be the same – Richard Tingle Jan 20 '15 at 17:03
  • @RichardTingle :Now I actually know the Key Alias. What I don't remember is the 'Key Password' (number 4 box in the image in the question) – MSIslam Jan 20 '15 at 17:19
  • @MSI And you've tried the same password as the key store? – Richard Tingle Jan 20 '15 at 17:23
  • As per the reading, my understanding is keystore password has to be different from key password. Can it be same? – MSIslam Jan 20 '15 at 17:28
  • @MSIslam, yes, they can be the same – Cauê Jannini Jul 20 '17 at 22:15
  • https://www.npmjs.com/package/keystore-password-recovery – vmontanheiro Oct 24 '19 at 11:18

26 Answers26

162

On the Mac, I found the keystore file path, password, key alias and key password in an earlier log report before I updated Android Studio.

I launched the Console utility and scrolled down to ~/Library/Logs -> AndroidStudioBeta ->idea.log.1 (or any old log number)

Then I searched for “android.injected.signing.store” and found this from an earlier date:

-Pandroid.injected.signing.store.file=/Users/myuserid/AndroidStudioProjects/keystore/keystore.jks, 
-Pandroid.injected.signing.store.password=mystorepassword, 
-Pandroid.injected.signing.key.alias=myandroidkey, 
-Pandroid.injected.signing.key.password=mykeypassword,

On Windows

you can find your lost key password in below path

Project\.gradle\2.14.1\taskArtifacts\taskArtifacts.bin or ..taskHistory\taskHistory.bin

Here is the image for path view in folder structure

open the file using appropriate tools e.g. NotePad++ and search with the part of the password that you remember. You will find it definitely. Else, try searching with this string "signingConfig.storePassword".

Note: I have experienced the same and i am able to find it. In case if you didn't find may be you cleared all the cache and temp files.

Ashraf Amin
  • 343
  • 3
  • 7
gkemp
  • 1,631
  • 2
  • 10
  • 2
  • For eclipse, where is the log file, do you know? – ondermerol Nov 16 '15 at 14:52
  • 1
    You can look for the password in the huge logs with `grep -r "android.injected.signing" /home/.AndroidStudio*` – LaGoutte Sep 10 '16 at 08:46
  • 8
    @Error404 The password is shown just below the first ***** part. It worked with me on Android 2.2 – Montolide Dec 31 '16 at 17:42
  • For anyone who might be interested I recently wrote a Python script that should pull the passwords out of the logs for you. Check it out at https://github.com/kmanc/android_studio_keyfinder and please let me know if it helps! – Kmanc Aug 09 '17 at 06:53
  • I didn't have anything in the logs, but when you attempt to `Generate a signed apk`, it will write it again in the logs. Almost sounds like a security issue, but at least, you need your master password for it to write to logs. If you see the password and remember password is checked, you can always retrieve it this way. No need for the keystore file. Tested on `AndroidStudio2.3` `cat ~/Library/Logs/AndroidStudio2.3/idea.log | grep password`. – GabLeRoux Sep 22 '17 at 13:07
  • 8
    unfortunately does not work on Windows and Android Studio 3.3. Passwords hidden with ******** – D.Zotov Feb 04 '19 at 06:00
  • @D.Zotov For Android Studio 3.4 you can find it under `.gradle\4.4\taskHistory\taskHistory.bin` not sure if it is the same for 3.3 – Mohammad Ali Aug 01 '19 at 12:13
  • Hi in Android studio 3.5.3 looking in log files does not help since passwords are saved with ****. Fortunately if you have saved the passwords in the sign dialog form, for newer versions of gradle, I found the saved form passwords of my key in file `\.gradle\5.4-rc-1\executionHistory\executionHistory.bin` for other versions you may also find it in another `*History*.bin` or `*Artifact*.bin`. – Alireza Kazemi Mar 25 '20 at 14:12
  • 1
    Just open the `exexuteHistory.bin` file in an editor like notepad++ and search for `signingConfig.keyPassword` or `signingConfig.storePassword` or by part of your password which you remember. *Notice* that it is important that you do not fill the app sign wizard form with another key store or alias since it is the risk that it clears the missed previous keystore/key info. In my case I just could restore from a compressed backup of the project since after that backup I had changed the keystore in the form and I could not find in the current executeHistory.bin file. – Alireza Kazemi Mar 25 '20 at 18:28
151

I finally could figure the issue out.

To get the Key Alias: I copied the keytool.exe and my keystore file into C:\Program Files\Java\jdk1.7.0_71\bin folder. Then from command prompt I wrote: keytool -list -v -keystore <name>.keystore It will also ask for keystore password then. Then it will show you the key alias and Certificate fingerprints and other info.

Then I again tried to Generate Signed Apk for the project, I provided keystore, keystore password, key alias and provided the same password. Then it asks for master password, I tried with the same and it failed. With the reset option I reset the master password here.

MSIslam
  • 4,587
  • 6
  • 25
  • 28
72

how to retrieve keystore password

You cannot retrieve the password. It is not stored in keystore file in any form so there's nothing to retrieved. If you forgot your password, then you are pretty much doomed.

how to retrieve key alias

$ keytool -list -v -keystore <store>

But you need keystore password for this first.

EDIT

What I don't remember is the 'Key Password'

No password can be restored. If you forgot key password for good then you are doomed too and there's no other way than trying harder to recall it or try some brute-force attempts as keytool won't throttle you there, so depending on your needs (and desperation) you can try that, but in general things do not look promising. There's also no password reset thing nor anything like that.

Be aware that if you forgot your password for good then you will not be able issue no further updates to your already published app (docs):

Warning: Keep your keystore and private key in a safe and secure place, and ensure that you have secure backups of them. If you publish an app to Google Play and then lose the key with which you signed your app, you will not be able to publish any updates to your app, since you must always sign all versions of your app with the same key.

Marcin Orlowski
  • 72,056
  • 11
  • 123
  • 141
  • 3
    I remember the keystore password. Also I have the keystore and now I remember the Key Alias. What I don't remember is the 'Key Password' (number 4 box in the image in question). – MSIslam Jan 20 '15 at 17:17
  • Thank you for the answer. Voted. I actually got the key alias earlier as the same way you mentioned. What I was facing issue was key alias password. – MSIslam Jan 20 '15 at 19:02
  • but this only gives you an info about the keys including the fingerprints but doesn't give you the password itself, any thing I'm missing here ? – Muhammed Refaat Jan 25 '16 at 17:55
  • **keytool** exist also for Mac – János Oct 02 '16 at 23:14
  • You can always restore your password as long as you didn't format your HDD completely and removed your IDE. As @Distjoy explained below, I have always used that way to restore my passwords. – XIII Jun 19 '17 at 11:39
  • I'd be **very** careful with word "always" you used here. – Marcin Orlowski Jun 19 '17 at 15:33
30

In windows - Just open your keystore file in notepad, and on very first line - you can see your alias written in English letter.

Lucky Rana
  • 1,030
  • 1
  • 12
  • 20
30

Recover your keystore password

100% working

Projects->taskHistory.bin

enter image description here

Find->KeyAlias

enter image description here

Note: Click and View my images for your reference

Now for updated android studio task history has been changed to execution history[!

devu mani
  • 337
  • 6
  • 12
shyam
  • 1,084
  • 12
  • 20
22

To just restore the KEY ALIAS. Type the below command on terminal.

$ keytool -list -v -keystore <storekey>

It will give information starting,

Your keystore contains 2 entries...

You can look for the alias name there.

thatzprem
  • 4,697
  • 1
  • 33
  • 41
22

Unfortunately solutions provided above, aren't beginner friendly.

It's

keytool -list -v -keystore keystore_name.jks
Soban Arshad
  • 1,295
  • 19
  • 15
21

If you happen to be on MacOS and checked the "save password" box in Android Studio, you can recover the password from Keychain Access.

  1. Launch Keychain Access from Applications/Utilities.
  2. Select password in Category, on the left panel.
  3. On the search box top right, type your Android app name or part of the app name.
  4. You will see the result line, if you had saved the password.
  5. Double click on it, check the show password checkbox, give your system password when asked, and it will show your keystore password.
varogen
  • 746
  • 10
  • 21
Maria
  • 369
  • 2
  • 7
16

Based on gkemp answer, On Windows, I found the keystore file path, password, key alias and key password in an earlier log report before I updated Android Studio.

From windows file explorer c:/Users/your pc name/.AndroidStudio1.4 (your android studio version)\system\log\idea.log.1 (or any old log number)

Then I searched for “android.injected.signing.store” and found this from an earlier date:

-Pandroid.injected.signing.store.file= path to your keystore 
-Pandroid.injected.signing.store.password=yourstorepassword
-Pandroid.injected.signing.key.alias=yourkeyalias
-Pandroid.injected.signing.key.password=yourkeypassword
Distjoy
  • 431
  • 3
  • 7
14

In ubuntu, we can find all password related to keystore from the given path.

/home/user/.AndroidStudio2.2(current version)/system/log/idea.log.x(older versions)

edit the file and search android.injected.signing.store , then you can find the passwords.

-Pandroid.injected.signing.store.file= path to your keystore 
-Pandroid.injected.signing.store.password=yourstorepassword
-Pandroid.injected.signing.key.alias=yourkeyalias
-Pandroid.injected.signing.key.password=yourkeypassword
Jijo Alexander
  • 1,230
  • 8
  • 17
10

I have found my key password in below path

Project\.gradle\2.14.1\taskArtifacts\taskArtifacts.bin open the file and search with the part of the password that you remember. You will found it definitely.

Also, You can refer this answer stackoverflow.com/a/43007357/7089151

Maharshi Adiraju
  • 444
  • 1
  • 7
  • 13
  • 1
    unable to find this file at android studio 3.0, Please let me know how can i get . – Peter Apr 16 '18 at 11:36
  • @Peter Refer this : https://stackoverflow.com/a/43007357/7089151 Explore taskArtifacts.bin in your project structure. The version numbers may change but all you need to do is find the taskArtifacts.bin – Maharshi Adiraju Apr 16 '18 at 17:50
  • 1
    If taskArtifacts folder does not exist, open the taskHistory/taskHistory.bin file in a text editor and search for the part of the pwd your remember. – Advait Saravade May 16 '18 at 12:32
  • 1
    Do you guys have any idea on how to find the Key password? I have storePassword but don't have KeyPassword. – sommesh Sep 18 '18 at 13:54
9

Yes, you can find your lost key in the task artifacts from Android Studio.

Project\.gradle\2.14.1\taskArtifacts\taskArtifacts.bin

for updated verssion of android studio the path is:

Project\.gradle\5.1.1\executionHistory\executionHistory.bin

Open the file and search with the part of the password that you remember.

Sample(this will be in that bin file): signingConfig.keyAlias�"key name"�signingConfig.keyPassword�"key password"�signingConfig.storePassword�"Store Password"�

You can search with this string “signingConfig.storePassword” or any string given in the sample string

Note: I have experienced the same thing and I am able to find it in the above path. In case if you didn't find may be you cleared all the cache and temp files.

devu mani
  • 337
  • 6
  • 12
Kishore Reddy
  • 2,394
  • 1
  • 19
  • 15
7

If looking in the logs doesn't help, you can also try to brute-force the password - check method 3 on this post - Android KeyStore Password Recover.

This SO post has more answers as well.

Community
  • 1
  • 1
Varun
  • 1,938
  • 18
  • 19
7

Just open the key file (.jks file) with notepad++ .You will get the alias name in the first line...

ZeroOneZeroR
  • 667
  • 1
  • 7
  • 12
5

You can find your keystore details without using password as following way.

Execute the command (keytool -list -keystore <path>) in command prompt

You can find the Keytool in java folder in my machine I could find form the following path

C:\Program Files (x86)\Java\jdk1.7.0_71\bin> keytool -list -keystore C:\<YourKeystore>.Keystore

Then it will ask you to enter the password, Here you don't need to enter the password instead of that press up arrow button and enter it. then the same details will be display with warning message as below.

***************** WARNING WARNING WARNING *****************

  • The integrity of the information stored in your keystore *

  • has NOT been verified! In order to verify its integrity, *

  • you must provide your keystore password. *

***************** WARNING WARNING WARNING *****************

Keystore type: JKS Keystore provider: SUN

Your keystore contains 1 entry

samplekey, Apr 26, 2017, PrivateKeyEntry, Certificate fingerprint (SHA1): XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX

Sarathi
  • 111
  • 1
  • 7
5

Click the KeyAlias you will get to know the alias name

enter image description here

gsanthosh91
  • 371
  • 4
  • 7
4

Just Open yourApp.jks file with Notepad you will find Keystore & Alias name there!!

Muhammad Salman
  • 125
  • 1
  • 9
  • 1
    Its encrypted. You cannot read the characters when you open in notepad. – Abhinav Raja Oct 16 '17 at 17:15
  • While this does let you find out what your alias is since the alias remains unencrypted in a .jks, it does not get you any closer to discovering a lost password. – Evan Wieland Jan 08 '18 at 20:51
4

Don't waste your time with all those solutions, they do not work anymore google managed to fix all those leaks and crypted the password on all those mentioned files. Just contact the google support, Create a new Keystore file and send it to them they will update it for your app.

Abdelkader
  • 96
  • 5
3

For flutter, run something like this... you should a certificate already with a password.

keytool -list -v -keystore /Users/mac/Desktop/github/ict4farmers-flutter/ict4farmers.jks
MUHINDO
  • 788
  • 6
  • 10
2

I tried a lot of solves and only that work with me and i will share it with you

enter image description here

enter image description here

enter image description here

search by Ctrl + F

RobC
  • 22,977
  • 20
  • 73
  • 80
Hamdy Abd El Fattah
  • 1,405
  • 1
  • 16
  • 16
1

You might like to try this password breaker.

http://maxcamillo.github.io/android-keystore-password-recover/index.html

I was using the Dictionary Attack method. It worked for me because there were only a few combinations to my password that I could think of.

remykarem
  • 2,251
  • 22
  • 28
1

Android Studio 3.0 below working method:
Find your old zipped project.
If you have built the apk, you'll find the password in file:

Project\.gradle\2.14.1\taskArtifacts\taskArtifacts.bin

Pandroid.injected.signing.store.password=password

If you don't have zipped project, search your git repositories if you have .gradle folder pushed or not.
Otherwise you'll have to recover files and search files by content "Pandroid.injected.signing.store.password".

AskQ
  • 4,215
  • 7
  • 34
  • 61
1

There is a way you can reset your password.

Go to this link, Describe your issue (Forgot KeyStore Password) and generate a token. https://support.google.com/googleplay/android-developer/contact/otherbugs

If you are lucky then within 1 hour you will get a replay. (Generally, it takes up to 2 days).

You will need to generate a new key and upload_certificate.pem and send it to google to reset. Yow will be given instruction in the mail.

To generate upload_certificate.pem go to android studio terminal and type :

keytool -export -rfc -alias upload -file upload_certificate.pem -keystore keystore.jks
Mridul Das
  • 101
  • 2
  • 5
  • Note that for key issues there is a separate link now. Use this: https://support.google.com/googleplay/android-developer/contact/key – Bruno Bieri Sep 19 '21 at 09:16
0

In any case you are confused with your password.You can use hit and trial. It will ask you for password.If it right then it will show you the list.

  • List item

$ keytool -list -v -keystore filename

RAHUL KUMAR
  • 1,123
  • 11
  • 9
0

Lost or compromised upload key? If you’ve lost your private upload key or it’s been compromised, you can create a new one, and then ask your account owner to contact support to reset the key. When contacting support, make sure your account owner attaches the upload_certificate.pem file.

After our support team registers the new upload key, you receive an email, and then you can update your keystores and register your key with API providers.

Important: Resetting your upload key doesn’t affect the app signing key that Google Play uses to re-sign APKs before delivering them to users.

Source: https://support.google.com/googleplay/android-developer/answer/9842756?hl=en#zippy=%2Cdescriptions-of-keys-artifacts-and-tools%2Capp-signing-process

  • See: best practices
Salah
  • 139
  • 1
  • 4
0

To get the Key Alias On MacOs or Linux:

keytool -list -v -keystore <name>.keystore(or .jks)

It will ask you to enter your key password

If you key file name has no extension just tape the <name>


Thanks to Dear @MSIslam

Gedeon Mutshipayi
  • 2,871
  • 3
  • 21
  • 42