How can I retrieve a saved keystore password from Android Studio?
Solution 1
You can find this in the idea.log files generated by Android Studio:
Search for "Pandroid.injected.signing.key.password" and you can see the key password.
Example logs:
2015-11-13 10:22:48,844 [ 709463] INFO - a.gradle.invoker.GradleInvoker - Build command line options: [--configure-on-demand, -Pandroid.injected.invoked.from.ide=true, -Pandroid.injected.signing.st ore.file=/Users/varun/Projects/myapp/mykey.jks, -Pandroid.injected.signing.store.password=mykeystorepassword, -Pandroid.injected.signing.key.alias=myalias, -Pandroid.injected.signing.key.password=mykeypassword , -Pandroid.injected.apk.location=/Users/varun/code/android/workspace/myapp, --init-script, /private/var/folders/vk/z504nlhd6v30p7zvtgjp5sjm0000gn/T/asLocalRepo0.gradle]
Note 1: On OSX the idea.log file can be found at ~/Library/Logs/AndroidStudio2.0
Note 2: If you don't find the password in idea.log, then also look at the files called idea.log.1, idea.log.2 and so on.
Solution 2
On macOS the latest versions of Android Studio (tested on 3.2) store keystore/key passwords in the Keychain under the following items:
org.jetbrains.android.exportSignedPackage.KeystoreStep$KeyStorePasswordRequestor
org.jetbrains.android.exportSignedPackage.KeystoreStep$KeyPasswordRequestor
The former stores the password of the keystore itself, and the latter – the password to the key.
You can access them using system Keychain Access app. Locate corresponding entry and double-click it. The Account field should contain the path to your keystore or the path to the key alias within the keystore in the following form:
KEY_STORE_PASSWORD__/Users/username/keystorename
or KEY_STORE_PASSWORD__/Users/username/keystorename__alias
Click Show password
and enter your macOS password when requested. That's it!
Solution 3
For anyone attempting keystore password recovery on more recent versions of Android Studio and Ubuntu, it seems that most documented suggestions to recover the password from logs, gradle, etc no longer work. Corneliu's excellent brute force script is great - unless you chose a 16 character password with no dictionary words in it and would like a result some time this month :) Using the Intellij security.xml solution is no longer available to retrieve saved passwords from Android Studio either, as far as I can tell.
However - having dug around a bit, Android Studio 3.1 seems to use the OS keychain in Ubuntu 18.04, so retrieving a saved keystore password is as simple as:
- open 'Passwords and Keys' (use super key and search 'password')
- filter results by 'android'
- look at each entry, they will be something like org.jetbrains.android...KeyPasswordRequestor, and open each one up in turn
- expand the password dropdown and select 'Show password', it will look something like: KEY_STORE_PASSWORD__/home/pathto/keystore/keystore-name.jks@mycoolpassword
Find the keystore you're looking for and the bit after @ is your missing password. Hope that helps someone out there!
Solution 4
Gradle stores them within your project directory in a binary file. You can get them like this (from the project directory):
strings .gradle/GRADLE_VERSION/taskArtifacts/taskArtifacts.bin | grep storePassword -A1
(Thanks to https://stackoverflow.com/a/33624636/1982087 for the taskArtifacts.bin pointer)
Solution 5
look for the log file from the date which you had signed your apk and you can find your key info there like below.
-Pandroid.injected.signing.store.password=[store_password],
-Pandroid.injected.signing.key.alias=[alias],
-Pandroid.injected.signing.key.password=[key_password]
you can find your log files under
C:\Users\username.AndroidStudio[versionNum]\system\log\
user2692264
Updated on December 15, 2021Comments
-
user2692264 over 2 years
The new Android Studio allows us to save keystore passwords for later use. Where are these passwords stored on my computer (OSX), and is there a way to retrieve the saved values?
EDIT I am looking for the Alias password, not the Keystore password
-
Dean Wild over 8 yearsworked a treat, I was about to start using github.com/MaxCamillo/android-keystore-password-recover to brute force my keystore - you saved my bacon
-
Leos Literak about 8 yearsPassword is masked but I found correct keystore location :-)
-
Newtz about 8 yearsOn OSX the log files for the latest version of Android Studio (currently 2.0) can be found at ~/Library/Logs/AndroidStudio2.0. I found the password in idea.log.1 so you may need to check a couple of files before you find what you're after
-
Appyx about 8 yearsThank you so much! This is a better solution than bruteforcing :D If anyone can't find the log file on OSX like me: In Studio: Help->Show Log in Finder->open file and search ;)
-
Shajeel Afzal over 7 yearsIt would be much better if you could show how to use that method as well.
-
Shajeel Afzal over 7 yearsWhat is "Pandroid.injected.signing.key.password" here? Is it your app package name?
-
Varun over 7 years@ShajeelAfzal : This is the name of the key which stores your keystore password.
-
Loc Phan about 7 yearsThe default log file on Windows: C:\Users\UserName\.AndroidStudio2.3\system\log\
-
GabLeRoux almost 7 yearsI 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 onAndroidStudio2.3
cat ~/Library/Logs/AndroidStudio2.3/idea.log | grep password
. -
Ohad Cohen over 6 yearsas of android studio 3.0 with gradle 4.1, they are masked (passwords stored as ******)
-
Luke over 6 yearsThis doesn't seem to work on AS 3.0 on Ubuntu, there are asterisks in place of password characters in logs.
-
Deepak Patil almost 6 yearsif there are multiple GRADLE_VERSION's try on all of them ..it worked for me on 2.2.1 ..didn't work for 2.4
-
Idolon over 5 years
-
Melardev over 5 yearsThis works, in Windows the default location I had was C:\Users\melardev\X where X depends on Android Studio Version it may be: .AndroidStudio2.1 or .AndroidStudio3.2 or .AndroidStudioPreview3.0 or other value. The command I used was $ grep -n --color -P "signing\.(store|key)" ./.AndroidStudio2.1/system/log/* using git bash, It showed up the files containing the passwords
-
Idolon over 5 years@Melardev As many others already commented, this does not work on newer versions of Android Studio. It worked for you because you were using AndroidStudio 2.1
-
Priyanka Singhal over 5 yearsIf they marked as ***** how can we get them in android studio 3.0 and above
-
allgood over 5 yearsdoesn't work anymore, solution from @BasicPleasureModel worked for me.
-
Kamen Dobrev almost 5 yearsGreat! It worked on OSX also. Open keychain access and filter on android
-
Idolon almost 5 years@KamenDobrev Yep, For OSX I described the details in an answer here: stackoverflow.com/questions/18701932/…
-
Simon Crane over 4 yearsWorked for me on windows when none of the other methods did, thanks a lot!
-
varun over 4 yearsYou are a live saver. Thanks!!
-
Le Roi Beukes about 4 yearsPlease explain how to get to this on windows ?
-
Carlos Galeano about 3 yearsThanks Mac for secure my passwords... Thanks to you cuz' you show the correct path :)
-
Mini Chip about 3 years@LeosLiterak And what;s that correct location? Because I can see the password in masked :(
-
Leos Literak about 3 yearsSorry, this question is 5 years old and I quit Android development years ago.
-
Jay over 2 yearsYou are a life save. Thanks!!
-
Dany Balian over 2 yearsworked for me; you made me also go to the original question and upvote it too :)
-
Jakub Licznerski over 2 yearsthis was an expolit... it was fixed. Please edit answer
-
Austin about 2 yearsIn 2022, this is the only answer that worked from my Windows 10 PC. Android Studio has plugged a lot of the holes that previously allowed you to read raw passwords in logs. However, the plugin you created worked flawlessly. You saved my app from relisting!
-
Shashi about 2 yearsWorking answer in 2022
-
angel.teran about 2 yearsGreat, works for me too! (Windows 11, Android Studio Chipmunk 2021.2.1 Patch 1)
-
Anuj Raghuvanshi almost 2 yearsWorked for me too July 2022 - Mac OS