Obtain Certificate SHA1 and SHA-256 Fingerprint Using Android Studio

What is SHA1?

SHA1(Secure Hash Algorithm 1) hash value is typically rendered as a hexadecimal number, 40 digits long used by the organizations like Google, Facebook etc uses SHA-1 hash value for secure connection between their services and clients.
SHA-1 value of debug will be different from SHA-1 value of release build.

How to Obtain SHA1

Using Android Studio Terminal

1) Open Android Studio
2) Open Terminal
3) Type the command (MAC) ./gradlew signingReport
                    OR
3) Type the command (Windows) .\gradlew signingReport

Note: If you receiver Permission denied warning then put bash and then command for example bash ./gradlew signingReport

4) SHA1 certificate will be displayed in the window opened at the bottom
Obtain Certificate SHA-1 Fingerprint Using Android Studio

Using Keystore file with Terminal

1) Open Android Studio
2) Open Terminal and type the following command
    keytool -list -v -keystore <your keystore path> -alias <your alias>
For Example
    keytool -list -v -keystore /Users/atifpervaiz/Desktop/keystore.jks -alias key0
You will be asked to enter keystore password, enter password and press enter
Obtain Certificate SHA1 and SHA-256 Fingerprint Using Android Studio



Using the Android Studio Gradle

1) Open Android Studio
2) Click Gradle Menu available on the right side
3) Expand YourProjectName > :app > Tasks > android > signingReport
4) Right Click signingReport and click first option from the menu
Obtain Certificate SHA-1 Fingerprint Using Android Studio


5) SHA1 certificate will be displayed in the window opened at the bottom
Obtain Certificate SHA-1 Fingerprint Using Android Studio

Comments

Popular posts from this blog

Manage External Storage Permission | Android Studio | Kotlin

Manage External Storage Permission | Android Studio | Java

Add a Back Button to Action Bar Android Studio (Kotlin)