54

When I try to get the MD5 fingerprint using keytool, I get a SHA1 fingerprint instead and the Google Maps doesn't recognize it. How do I get the MD5 fingerprint?

Null
  • 1,940
  • 9
  • 24
  • 29
Brahadeesh
  • 2,207
  • 8
  • 37
  • 57
  • 1
    keytool -list -alias alias_name -keystore my-release-key.keystore generated an sha1 cert? – Kevin Qiu Aug 23 '11 at 18:22
  • what does the output look like? – Kevin Qiu Aug 23 '11 at 18:26
  • the fingerprint is 21 sets of 2 hexadecimal symbols and the google output was something like: "Click back and reenter the MD5 fingerprint." – Brahadeesh Aug 23 '11 at 18:28
  • does the same happen with the debug keystore and the one you make for the apk? – Kevin Qiu Aug 23 '11 at 18:32
  • yes. the same thing does happen. – Brahadeesh Aug 23 '11 at 18:33
  • 1
    http://stackoverflow.com/questions/6305938/how-can-i-get-the-md5-fingerprint-from-javas-keytool-not-only-sha-1 Please check this link. The answer is posted here. Worked for me. – Brahadeesh Aug 23 '11 at 18:57
  • hi Kevin Qiu.. can u please tell me where i can execute the command u mentioned(keytool -list -alias alias_name -keystore my-release-key.keystore) in the eclipse? i want to generate the key – kumar Apr 21 '14 at 14:59

5 Answers5

119

Use JDK version 1.6 instead of 1.7 because 1.7 generates the fingerprint with SHA1 by default. or you can use (-v) option of the keytool to give you all supported algorithms output and you will find the MD5 in it. for examble : keytool -v -list -keystore [your keystore path] and then enter the password which is [android] by default (you can get the keystore path from Eclipse window>Prefs>Android>build).

Sincerely, DigitalFox

DigitalFox
  • 1,478
  • 1
  • 13
  • 17
  • 2
    I was looking for generating SHA1 key, -v option worked for me and displayed all certificate fingerprints like SHA1, MD5 and other info. Thanks. – Ankit Jul 20 '12 at 07:53
24
C:\Program Files\Java\jdk1.7.0_04\bin>keytool.exe -V -list -alias androiddebugkey -keystore "C:\Documents and Settings\IBM\.android\debug.keystore" -storepass android -keypass android

Consider your jdk-bin path in the first path place and your home user directory in the second path. For windows 7 it is like "C:\Users\username.android\debug.keystore"

Use the above command you will get all the keys.

for more details go through this androidgoogle-maps-api-key-signup-md5-certification-key

Community
  • 1
  • 1
Rahul Baradia
  • 11,312
  • 16
  • 73
  • 118
  • Its Like: `>cd ` then `.../bin>keytool.exe -V -list -alias androiddebugkey -keystore "C:\Documents and Settings\\.android\debug.keystore" -storepass android -keypass android` – Pratik Butani Jul 24 '13 at 07:02
4

The easiest, full prove and permanent way to get MD5 or SHA1 or SHA256 is as follows_

  1. Update the PATH Environment Variable.
  2. Start Command prompt "Ctrl+R" & enter cmd in RunDailog panel then click ok.
  3. Navigate to the directory where your debug.keystore file resides e.g., C:\Users\Admin\.android path of my debug.keystore file.
  4. Run the following command

    C:\<PATH OF YOUR DEBUG.KEYSTORE FILE>>keytool -list -v -alias androiddebugkey -keystore debug.keystore -keypass android -storepass android

    e.g., C:\Users\Admin.android>keytool -list -v -alias androiddebugkey -keystore debug.keystore -keypass android -storepass android

    output_

    Alias name: androiddebugkey Creation date: Sep 20, 2013 Entry type: PrivateKeyEntry Certificate chain length: 1 Certificate[1]: Owner: CN=Android Debug, O=Android, C=US Issuer: CN=Android Debug, O=Android, C=US Serial number: 39ea2d1c Valid from: Fri Sep 20 10:55:39 IST 2013 until: Sun Sep 13 10:55:39 IST 2043 Certificate fingerprints:

     MD5:  85:46:3B:8A:62:02:1D:DB:B6:BF:A1:9F:45:D4:54:C6
     SHA1: 69:AF:B5:D6:14:ED:0B:31:89:6B:BD:0F:CC:3C:4C:57:CE:4C:A1:BC
     SHA256: 57:7F:DE:25:31:38:4B:7F:4B:F1:96:CB:46:75:FC:34:85:E3:03:15:D3:
    

    D7:DE:0E:55:82:1B:21:9F:62:97:4E Signature algorithm name: SHA256withRSA Version: 3

I hope this will help to everyone!

Tim
  • 38,263
  • 17
  • 115
  • 131
Rupesh Yadav
  • 14,336
  • 5
  • 53
  • 68
0

Try this one in cmd:

First go on this path : C:\Program Files\Java\jdk1.6.0_33\bin

then

Type this command..

C:\Program Files\Java\jdk1.6.0_33\bin > keytool.exe -list -alias androiddebugkey -keystore c:\Users\Mitul.android\debug.keystore -keypass android -storepass android

The blow code will work! try this to get md5 key

C:\Program Files\Java\jdk1.6.0_23\bin>keytool.exe -list -alias androiddebugkey - keystore "c:\Users\Administrator.android\debug.keystore" -storepass android -ke ypass android

instead of path & users administrator give your own

Raj
  • 3
  • 5
Mitul Goti
  • 2,517
  • 1
  • 19
  • 18
0

just export your app in eclipse and the MD5 + SHA1 will be displayed in the window. (just before "finish")

NBApps
  • 461
  • 4
  • 12