Obtaining SHA1 Fingerprint from Android Keystore - Truiton
Skip to content

Obtaining SHA1 Fingerprint from Android Keystore

Photo Credit: Daniel - Android SHA1 Fingerprint

To access APIs in Android from Google API console you need to generate an API Key. This same API key can me used for accessing multiple APIs under the same project. To generate an API key you require, SHA1 fingerprint of your keystore. Keystore is basically a place where the private keys for your app are kept. In simple words its a certificate generated by user or a program, used for signing an Android  app.

In android there are two types of keystores. A debug keystore, and a release keystore. Debug keystore is generated automatically when the Android SDK is installed or run for the first time. Release keystore has to be generated manually by the user for each application before release. As it requires private information such as name, password etc. To obtain an Android SHA1 fingerprint from your desired keystore, please follow the steps below:

1) Getting Android Debug Keystore SHA1 Fingerprint:

The hard way:

  1. Open a terminal window.
  2. Change the directory to the JDK bin directory, mine was jdk1.7.0_05 (could be different for you).
    cd C:\Program Files\Java\jdk1.7.0_05\bin
  3. Next we have to run the keytool.exe. Use the following line to get the Android SHA1 fingerprint.
    Windows:
    keytool -list -v -keystore "%USERPROFILE%\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android

    Mac and Linux:

    keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android

Android SHA1 Fingerprint

The easy way (Only for Eclipse IDE):

  1. Open Preferences by Navigating to Window -> Preferences.
  2. Select Android -> Build.
  3. Android SHA1 Fingerprint

 

2) Getting Android Release Keystore SHA1 Fingerprint:

To find out the Android SHA1 fingerprint for release keystore, follow these steps:

  1. Open terminal
  2. Change the directory to the JDK bin directory, mine was jdk1.7.0_05 (could be different for you).
    cd C:\Program Files\Java\jdk1.7.0_05\bin
  3. Next we have to run the keytool.exe. Use the following line to get the SHA1 fingerprint.
    keytool -list -v -keystore {keystore_name} -alias {alias_name}

    Example:

    keytool -list -v -keystore C:\Users\MG\Desktop\test.jks -alias test

    It will prompt for a password.

  4. Enter the password, you will get the SHA1 and MD5 fingerprint.

Android SHA1 Fingerprint

Extracting the SHA1 fingerprint from an Android keystore cannot be simpler than this. Above steps can be used on Windows, Mac and on Linux machines.

18 thoughts on “Obtaining SHA1 Fingerprint from Android Keystore”

  1. Hi Mohit,
    I find your tutorials really helpful, thanks a lot for the content , a lot of my doubts are solved after reading this blog.
    Have a good day .
    Shreyasta

  2. I’ve had to find my SHA1 fingerprint several times recently and this guide has been absolutely invaluable in making a previously bizarrely frustrating process much much easier. Thank you!

  3. Thank you very much for this tutorial.
    You really help me to get this SHA 1. i confuse to get SHA 1 certificate fingerprint for my android app

Leave a Reply

Your email address will not be published. Required fields are marked *