645

Is the method for getting an SHA-1 fingerprint the same as the method of getting the fingerprint? Previously, I was running this command:

Windows Command Prompt running keytool.exe

It's not clear to me if the result I'm getting is the SHA-1 fingerprint. Can somebody clarify this?

4

48 Answers 48

1
2
4

Easy method - with Keystore explorer

Follow the step

  1. Download keystore explorer Download link
  2. Install keystore explorer
  3. Open keystore via keystore explorer
  4. Enter password
  5. Click your keystore name
  6. then you will get the sha1 key
4

Many ways to get SHA1 and SHA-256 key . To generate the SHA-1 key for your Android app, there are a few alternative methods:

Using Keytool Command-Line Tool: You can use the keytool command-line tool that comes with the Java Development Kit (JDK) to generate the SHA-1 key. Open a terminal or command prompt and navigate to your JDK's bin directory. Then run the following command: bash

keytool -list -v -keystore your_keystore_file.jks -alias your_alias_name

Replace your_keystore_file.jks with the path to your keystore file and your_alias_name with the alias you used to sign your app.

Using Android Studio: Android Studio provides a straightforward way to get the SHA-1 key. Follow these steps: Click on the "Gradle" tab on the right side of the Android Studio window. Navigate to "Your Project" -> "Tasks" -> "Android" -> "signingReport". Double-click on "signingReport" to run the task, which will output the SHA-1 key and other signing information in the "Run" pane. Using Google Play Console: If you have already uploaded your app to the Google Play Console, you can find the SHA-1 key in the "Release management" -> "App signing" section.

Using Online Tools: There are some online tools available where you can upload your keystore file and get the SHA-1 key as a result. However, for security reasons, it's generally better to generate the SHA-1 key locally using trusted tools like the ones mentioned above.

Using Gradle Plugin: You can also use the Gradle Signing Report Plugin to get the SHA-1 key. Add the following to your app's build.gradle file:

apply plugin: 'signing-report'

signingReport {
    // You can configure signing configs here if needed
}

Then run the signingReport Gradle task. You will find the SHA-1 key printed in the console. All these methods will provide you with the SHA-1 key needed for various purposes, such as integrating Google services or configuring API access. Choose the one that fits your workflow and security requirements best.

0
3

I am using Ubuntu 12.0.4 and I have get the Certificate fingerprints in this way for release key store on command prompt after generate keystore file , you can use this key for released app ,if you are using google map in your app ,so this can show the map properly inside app after release,, i got the result on command prompt below

administrator@user:~$ keytool -list -v -keystore /home/administrator/mykeystore/mykeystore.jks -alias myprojectalias

 
Enter keystore password:  ******

Alias name: myprojectalias

Creation date: 22 Apr, 2014

Entry type: PrivateKeyEntry

Certificate chain length: 1
Certificate[1]:
Owner: CN=xyz, OU= xyz, O= xyz, L= xyz, ST= xyz, C=91
Issuer: CN= xyz, OU= xyz, O= xyz, L= xyz, ST= xyz, C=91

Serial number: 7c4rwrfdff
Valid from: Fri Apr 22 11:59:55 IST 2014 until: Tue Apr 14 11:59:55 IST 2039

Certificate fingerprints:
     MD5:  95:A2:4B:3A:0D:40:23:FF:F1:F3:45:26:F5:1C:CE:86
     SHA1: DF:95:Y6:7B:D7:0C:CD:25:04:11:54:FA:40:A7:1F:C5:44:94:AB:90
     SHA276: 00:7E:B6:EC:55:2D:C6:C9:43:EE:8A:42:BB:5E:14:BB:33:FD:A4:A8:B8:5C:2A:DE:65:5C:A3:FE:C0:14:A8:02
     Signature algorithm name: SHA276withRSA
     Version: 2

Extensions: 

 ObjectId: 2.6.28.14 Criticality=false
SubjectKeyIdentifier [
KeyIdentifier [
0000: 1E A1 57 F2 81 AR 57 D6   AC 54 65 89 E0 77 65 D9  ..W...Q..Tb..W6.
0010: 3B 38 9C E1             

On Windows Platform we can get the keystore for debug mode by using the below way

C:\Program Files\Java\jdk1.8.0_102\bin>keytool -l
.android\debug.keystore -alias androiddebugkey -s
id
Alias name: androiddebugkey
Creation date: Oct 21, 2016
Entry type: PrivateKeyEntry
Certificate chain length: 1
Certificate[1]:
Owner: C=US, O=Android, CN=Android Debug
Issuer: C=US, O=Android, CN=Android Debug
Serial number: 1
Valid from: Fri Oct 21 00:50:00 IST 2016 until: S
Certificate fingerprints:
         MD5:  86:E3:2E:D7:0E:22:D6:23:2E:D8:E7:E
         SHA1: B4:6F:BE:13:AA:FF:E5:AB:58:20:A9:B
         SHA256: 15:88:E2:1E:42:6F:61:72:02:44:68
56:49:4C:32:D6:17:34:A6:7B:A5:A6
         Signature algorithm name: SHA1withRSA

1
  • Another way you can get this certification detail for debug mode from (1)Right click on Gradle bar at android studio (2)then click on app -> Tasks -> android -> signingReports then on Gradle console you will get the reports
    – gpuser
    Dec 1, 2016 at 5:36
3

If you are using Google Play App Signing, instead of getting the SHA from the keystore, an easier way is to go to the Google Play Console > Your app > Release Management > App signing and look for your upload certificate.

Screenshot of the page where you get this info

2
  • here showing 2 signin certificates appsignin and uploaded signincertificates.which one i need to use for release
    – Harsha
    Jul 12, 2018 at 6:26
  • For release you need to use the App signing certificate Apr 14, 2020 at 6:26
3

if you have not the Keystore and alias you can use this command :

keytool -list -printcert -jarfile app.apk
3

If you're using React Native, debug.keystore is in android/app, but may not be in ~/.android.

Set debug.keystore path as the following:

keytool -list -v -keystore {PROJECT_ROOT}/android/app/debug.keystore -alias androiddebugkey -storepass android -keypass android

Console will print something like this:

Alias name: androiddebugkey
Creation date: Jan 1, 2014
Entry type: PrivateKeyEntry
Certificate chain length: 1
Certificate[1]:
Owner: CN=Android Debug, OU=Android, O=Unknown, L=Unknown, ST=Unknown, C=US
Issuer: CN=Android Debug, OU=Android, O=Unknown, L=Unknown, ST=Unknown, C=US
Serial number: 2==Serial Number==2
Valid from: Wed Jan 01 06:35:04 CST 2014 until: Wed May 01 06:35:04 CST 2052
Certificate fingerprints:
     SHA1: 5E:=========== SHA1 SIGNING KEY ===========:25
     SHA256: FA:============ SHA 256 ===================9C
Signature algorithm name: SHA1withRSA
Subject Public Key Algorithm: 2048-bit RSA key
Version: 3
3

In the recent update of Android Studio 4.2, we are unable to get the file: signing report. So, we can get this again by following the following steps:

File -> Settings -> Experimental -> 
Now we need to uncheck the *do not build Gradle list during Gradle sync* ->
Click Ok -> now again go to File -> Click on *Sync Project with Gradle files*

Now you can follow, what other answers tell.

Thanks to @PapayaCoders Youtube channel to resolve this issue. Here is the link of the video concerning this problem.

3

A simpler method is to run ./gradlew signingReport in your project root directory Other methods are explained in this article

3

In Flutter Project continue in vs code and paste this command

set your username

keytool -list -v -keystore "c:\users\your_pc_username\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android 
2

If you are using Android studio this very simple.

Create a new Google map activity and you can see sha1 fingerprint like below image.

New Google Map aCTIVITY

YOU CAN SEE SHA1 IN BELOW IMAGE

0
2

use android studio embedded Java jre location, for windows user below screenshot may help to find SHA1

enter image description here

1

First go to jar file copy the keytool path then add into system path then run.. i hope this one is worked..

1

For local you get easily sha1 from android studio but for live please check below url :

Facebook Android Generate Key Hash

We mostly not done below steps so please check the link which is 100% correct.

8) If you see in openssl Bin folder, you will get a file with the name of debug.txt

9) Now either you can restart command prompt or work with existing command prompt

10) get back to C drive and give the path of openssl Bin folder

11) copy the following code and paste

openssl sha1 -binary debug.txt > debug_sha.txt

12) you will get debug_sha.txt in openssl bin folder

13) Again copy following code and paste

openssl base64 -in debug_sha.txt > debug_base64.txt

14) you will get debug_base64.txt in openssl bin folder

15) open debug_base64.txt file Here is your Key hash.

1

Try this with your user & pass

keytool -list -v -keystore {path of jks file} -alias {keyname} -storepass {keypassword} -keypass {aliaspassword}

Exe

keytool -list -v -keystore "E:\AndroidStudioProject\ParathaApp\key.jks" -alias key0 -storepass mks@1 -keypass golu@1

1

[![Change the build variant then you can see the run the application which will lead to error

You have to find SHA1 code for Release Key & enter it on your Developer Console. ( for me developer console is firebase some people might use different services) To find SHA1 Code . easy way is

Go to Build --- Select Build Variant -- On the left Side Select "Release" as build variant -- now go to module settings ( or try to run project , android studio will tell you about a error and click fix error button) --- Select Signing tab --- add your release key and passwords -- now goto build types -- select release -- on signing config select your release key config -- now run your project -- now run your signing report --- you can find SHA1 under release build -- enter that sha1 code on your developer console

enter image description here

enter image description here

enter image description here

That's it

0
1

please try this

go to Gradle -> click no elephant icon and write signingReport and click enter done

1
  • Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Alan Bosco
    Feb 23, 2023 at 10:50
1

Android Studio Giraffe | 2022.3.1 onward - new IntelliJ UI:

  1. Open Execute Gradle Task enter image description here

  2. Run the command gradle signingReport enter image description here

  3. Inspect run enter image description here

1
0

At ANDROID STUDIO do the following steps:

  1. Click Gradle menu on the right side of your ANDROID STUDIO IDE
  2. Expand Tasks tree
  3. Clink on signingReport

You will be able to see the signature at the bottom of IDE

1
1
2

Not the answer you're looking for? Browse other questions tagged or ask your own question.