How do I find out which keystore was used to sign an app?
First, unzip the APK and extract the file /META-INF/ANDROID_.RSA (this file may also be CERT.RSA, but there should only be one .RSA file).
Then issue this command:
keytool -printcert -file ANDROID_.RSA
You will get certificate fingerprints like this:
MD5: B3:4F:BE:07:AA:78:24:DC:CA:92:36:FF:AE:8C:17:DB
SHA1: 16:59:E7:E3:0C:AA:7A:0D:F2:0D:05:20:12:A8:85:0B:32:C5:4F:68
Signature algorithm name: SHA1withRSA
Then use the keytool again to print out all the aliases of your signing keystore:
keytool -list -keystore my-signing-key.keystore
You will get a list of aliases and their certificate fingerprint:
android_key, Jan 23, 2010, PrivateKeyEntry,
Certificate fingerprint (MD5): B3:4F:BE:07:AA:78:24:DC:CA:92:36:FF:AE:8C:17:DB
Voila! we can now determined the apk has been signed with this keystore, and with the alias 'android_key'.
Keytool is part of Java, so make sure your PATH has Java installation dir in it.
SHA-1 fingerprint of keystore certificate
Follow this tutorial for creating SHA1 fingerprint for Google Map v2
For Debug mode:
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
for Release mode:
keytool -list -v -keystore {keystore_name} -alias {alias_name}
example:
keytool -list -v -keystore C:\Users\MG\Desktop\test.jks -alias test
On windows, when keytool command is not found, Go to your installed JDK Directory e.g.
<YourJDKPath>\Java\jdk1.8.0_231\bin\
, open command line and try the above commands for debug/release mode.
Another way of getting your SHA1 OR SHA-256 use ./gradlew signingReport
For more detailed info visit
Using Gradle's Signing Report
How to retrieve Key Alias and Key Password for signed APK in android studio(migrated from Eclipse)
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.
Related Topics
What Is Activity.Finish() Method Doing Exactly
How to Check Grants Permissions At Run-Time
How to Get the Width and Height of an Android.Widget.Imageview
How to Check If Location Services Are Enabled
Set Android Shape Color Programmatically
Manifest Merger Failed:Uses-Sdk:Minsdkversion 14
How to Return to a Parent Activity Correctly
Recyclerview Expand/Collapse Items
What Is Difference Between Getsupportfragmentmanager() and Getchildfragmentmanager()
Launch Facebook App from Other App
Error:(1, 0) Plugin With Id 'Com.Android.Application' Not Found
Android Drawing Separator/Divider Line in Layout
How to Use Disk Caching in Picasso
Text Size and Different Android Screen Sizes
Disabling the Fullscreen Editing View for Soft Keyboard Input in Landscape