Is the method for getting an SHA-1 fingerprint the same as the method of getting the fingerprint? Previously, I was running this command:
It's not clear to me if the result I'm getting is the SHA-1 fingerprint. Can somebody clarify this?
Is the method for getting an SHA-1 fingerprint the same as the method of getting the fingerprint? Previously, I was running this command:
It's not clear to me if the result I'm getting is the SHA-1 fingerprint. Can somebody clarify this?
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
If you are using android studio use simple step
Tasks
treeandroid
-> signingReport
and see the magic Result Under Run Tab If Android Studio < 2.2
From android studio 2.2
Result will be available under Run console but use highlighted toggle button
Or
Second Way is
Create new project in android studio New -> Google Maps Activity
then open google_maps_api.xml xml file as shown in pics you will see your SHA key
Easiest way for getting SHA1 Key in android studio both (Debug and release Mode)
Android Studio
signingReport
(You will get SHA1
and MD5
in Run Bar)If you are using new Android Studio it shows time to execute on top there is Toggle task execution mode click on that you will get you SHA-1 key. Check 2nd and 3rd reference images.
Generate SHA-1 for Release Mode
1-First add keystore config in your gradle How to add config in gradle.
2-After Adding Config in gradle change build variant.
3-Then Follow Above Procedure you will get SHA-1 for release mode.
Run the following command to get your sha1: keytool -v -list -keystore "< debug.keystore path >"
If you do not know the path of debug.keystore
, you may find your debug.keystore
path by checking windows-->preferences-->android-->build
I prepared step by step tutorial to show how you can use google map android v2 on emulator(android 4.2.2)
have a look at to my blog: http://umut.tekguc.info/en/content/google-android-map-v2-step-step
I saw lots of posts about this issue, so I will keep it simple + examples.
To get the SHA1 for ClientID for Sign In with Google+ and more actions:
General Form:
keytool -list -v -keystore <your_keystore_full_path> -alias <your_alias_name>
For Debug, replace with your debug.keystore path, for Example :
keytool -list -v -keystore C:\Users\DAVID\.android\debug.keystore -alias androiddebugkey
Password: android
For Release, replace with your keystore path and alias password, for Example :
keytool -list -v -keystore C:\ProjectsData\keystore\my-release-key.keystore -alias alias_name
Password: Your alias password.
Using Google Play app signing feature & Google APIs integration in your app?
If you use Google Play app signing, Google re-signs your app. Thats how your signing-certificate fingerprint is given by Google Play App Signing as shown below:
Read more How to get Release SHA-1 (Signing-certificate fingerprint) if using 'Google Play app signing'
from a Debug Keystore we can get the SHA1 value in Eclipse
. Accessing from the menu:
Window
-> Preferences
-> Android
-> Build
but it doesn´t work for a production Keystore
.
So, to get the SHA1 value from a production Keystore go to:
Android Tools
-> Export Signed Application Package
. Follow the process for signing your apk and the SHA1 will showed as a certificate.
keytool is a key and certificate management utility. It allows users to administer their own public/private key pairs and associated certificates for use in self-authentication (where the user authenticates himself/herself to other users/services) or data integrity and authentication services, using digital signatures.
For Windows
keytool -list -v -keystore "%USERPROFILE%\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
Other
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
Authorization on Android uses a SHA1 fingerprint and package name to identify your app instead of a client ID and client secret.
http://docs.oracle.com/javase/6/docs/technotes/tools/windows/keytool.html
In Gnu/Linux
First
You need key.jks, for example in my case this file it's in folder in /Desktop/Keys
/Desktop/Keys/key.jks
Second
cd /usr/lib/jvm/java-1.7.0-openjdk-amd64
Now you need excecute this command
keytool -list -v -keystore /PATH/file.jks -alias YourAlias -storepass *** -keypass ***
remplacing this fields
-keystore
-alias
-storepass
-keypass
For example
keytool -list -v -keystore /home/david/Desktop/Keys/key.jks -alias MyAlias -storepass 456 -keypass 123
Good Luck!!
Step 1 : First locate your JDK's bin folder in your windows pc. See the image below.
Mine is :
C:\Program Files\Java\jdk1.8.0_131\bin
Step 2 : Now search for Command Prompt by typing "cmd" in windows 10 search bar. Then open Command Prompt as Administrator mode. See the image below:
Step 3 : Now copy this path and type it into Command Prompt
C:\Program Files\Java\jdk1.8.0_131\bin
In Command Prompt :
cd C:\Program Files\Java\jdk1.8.0_131\bin
After pressing Enter button you will go to the bin folder.
Your setup is done. Now generate your SHA1 key for Release mode.
Release SHA1 Key :
keytool -list -v -keystore C:\Users\Turzo\Desktop\earninglearning.keystore -alias turzo -storepass 12345678 -keypass 12345678
First there is same .jar
file that in fb-sdk android-support-v4.jar
.
Then generate SHA1
key using:
PackageInfo info;
try {
info = getPackageManager().getPackageInfo(
"com.example.worldmission", PackageManager.GET_SIGNATURES);
for (Signature signature : info.signatures) {
MessageDigest md;
md = MessageDigest.getInstance("SHA");
md.update(signature.toByteArray());
String something = new String(Base64.encode(md.digest(), 0));
Log.e("Hash key", something);
System.out.println("Hash key" + something);
}
} catch (NameNotFoundException e1) {
Log.e("name not found", e1.toString());
} catch (NoSuchAlgorithmException e) {
Log.e("no such an algorithm", e.toString());
} catch (Exception e) {
Log.e("exception", e.toString());
}
Best way ever with all steps:
For Release Keystore SHA1 Key:
C:\Users\hiren.patel>cd..
C:\Users>cd..
C:\>cd "Program Files"
C:\Program Files>cd Java
C:\Program Files\Java>cd jdk_version_code
C:\Program Files\Java\jdk_version_code>cd bin
C:\Program Files\Java\jdk_version_code\bin>keytool -list -v -keystore "D:\Hiren Data\My Root Folder\My Project Folder\keystore_title.jks" -alias my_alias_name -storepass my_store_password -keypass my_key_password
Replace below thing:
jdk_version_code
D:\Hiren Data\My Root Folder\My Project Folder\keystore_title.jks
my_alias_name
my_store_password
my_key_password
Done
Open Command Prompt in Windows and go to the following folder .
C:\Program Files\Java\jdk1.7.0_05\bin
Use commands cd <next directory name>
to change directory to next.
Use command cd ..
to change directory to the Prev
Now type the following command as it is :
keytool -list -v -keystore "%USERPROFILE%\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
In Addition to Lokesh Tiwar's answer
For release builds add the following in the gradle:
android {
defaultConfig{
//Goes here
}
signingConfigs {
release {
storeFile file("PATH TO THE KEY_STORE FILE")
storePassword "PASSWORD"
keyAlias "ALIAS_NAME"
keyPassword "KEY_PASSWORD"
}
}
buildTypes {
release {
zipAlignEnabled true
minifyEnabled false
signingConfig signingConfigs.release
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
Now running the signingReport as in Lokesh's Answer would show the SHA 1 and MD5 keys for the release builds as well.
This solution is for android studio 3.5 version:
I had a problem during opening with command
[keytool -list -v -keystore C:\Users\MG\Desktop\test.jks -alias test]
Therefore, i download https://sourceforge.net/projects/portecle/. Then just open .jks file from the jar program. it will show you all relevant information
I have easy answer. To find SH1 do these simple steps
step 1 Go to setting and you can also press ctrl + alt + s
step 2 Go to Experimental and then unTick the option named Do not build Gradle task during Gradle sync and then press ok
step 3 Go to File then choose the option of Sync Project with Gradle files
step 4 click on Gradle on the right side of panel then Tasks then android then double click on signingReport
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
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.
For Android Studio 4.2 and newer version ,follows these steps to generate SHA Key . Steps are given in these pictures.
Steps:-
1) Click on the gradle. Top right on the Android Studio. As you can see in this picture.
2) Now click on icon as seen in below picture. A new searchable windows/screen will open.
3) Now type,gradle signingreport and press Enter to start generating SHA KEY as seen in below picture.
4) Your SHA Key will generate as seen in this picture. Using these steps you can generate SHA KEY in Android Studio 4.2.