Android MD5 debug fingerprint missing from debug keystore - android

I have built a new development machine and installed Android SDK. I tried to obtain the Android MD5 debug fingerprint but cannot seem to get it to generate. I have deleted the debug.keystore to create a new one and only the SHA1 fingerprint is present.
Please advise
Here is my debug.keystore contents:
c:>"C:\Program Files\Java\jdk1.7.0\bin\keytool" -list -keystore "C:\users\me\.android\debug.keystore
Enter keystore password:
******* WARNING WARNING WARNING *******
* The integrity of the information stored in your keystore *
* has NOT been verified! In order to verify its integrity, *
* you must provide your keystore password. *
******* WARNING WARNING WARNING *******
Keystore type: JKS
Keystore provider: SUN
Your keystore contains 1 entry
androiddebugkey, May 2, 2011, PrivateKeyEntry,
Certificate fingerprint (SHA1): F8:A5:0E:DD:61:5D:FC:86:D9:33:13:48:30:E0:EF:37:
47:81:60:EF
c:>
I am running Windows7 64 bit. The MD5 fingerprints are also not showing in my production keystore that I restored from a backup from the previous system (WindowsXP SP3).

Follow these steps:-
c:>cd "C:\Program Files\Java\jdk1.6.0\bin>keytool" -list -keystore "C:\users\me.android\debug.keystore"
*note :- Replace me with your username
after this you get MD5 ,
Copy that MD5 paste it in https://developers.google.com/maps/documentation/android/v1/maps-api-signup
and generate API KEY for map, use that API KEY in main.xml file.
May it helps you.
Reply if not works

Your command yhould be for the debug certificate :
"C:\Program Files\Java\jdk1.7.0\bin\keytool" -list -alias androiddebugkey -keystore "C:\users\me\.android\debug.keystore" -storepass android -keypass android
(from : http://code.google.com/android/add-ons/google-apis/mapkey.html)

I found the answer. There is another post on SO (Link) that states that rolling back from
jdk-7-ea-bin-b140-windows-x64
to
jdk-6u25-windows-x64
resolves the issue. THIS WORKED FOR ME!
dranfi, your answer is technically correct, but that's what I used in the first place.
jdk-7-ea-bin-b140-windows-x64 obviously has some issues to resolve.
I perhaps should have stated the javaSDK version in the first place -sorry!

Java 7 (1.7.0) changed the default output from the keytool command. See JDK 7 changes keytool output .

Add the -v option to print all possible fingerprints, so complete command will look like this, then select the MD5 output:
keytool -v -list -alias androiddebugkey -keystore ~/.android/debug.keystore -storepass android -keypass android

Related

Cannot see google maps on android when I upload it for release (works in debug), trying to get SHA1 from my created keystore

(Mac)
I created a keystore with alias and password with the same name (projectOne) and when I try to get the SHA1 from that created keystore and put it on my created google console maps I have trouble getting the SHA1 out.
I type this in the terminal but it does not let me access the keystore.
keytool -list -v -keystore ~/.android/ projectOne.keystore -alias projectOne
It says this (roughly translated):
Invalid option/Unauthorized: projectOne.keystore
Now I use the SHA for debug:
keytool -list -v -keystore ~/.local/share/Xamarin/Mono\ for\ Android/debug.keystore -alias androiddebugkey -storepass android -keypass android
And this does not work when I try to "release" it. So I assume I have to get the SHA1 from my own created keystore but as I mentioned above. It says it is an invalid option/Unauthorized option.
Based from this documentation you need to first find the .keystore file that your .apk was signed with. The keystore used will depend on if your app's .apk package was created as a debug build, or if it was packaged with a different .keystore file.
For builds that you have signed with your projectOne.keystore file, you need to substitute your own values for the .keystore file, keystore password, and alias name from when you created the keystore file.
You can follow these tutorial and forum which suggested to verify that the alias or password you use is correct.

How to obtain Signing certificate fingerprint (SHA1) for OAuth 2.0 on Android?

I'm trying to register my android app following the steps in https://developers.google.com/console/help/#installed_applications which leads me to follow
http://developer.android.com/tools/publishing/app-signing.html.
However, I'm not sure how to get the signing certificate fingerprint (SHA1).
I first used the Eclipse ADT plugin to export and create the keystore/key.
Then, I tried doing keytool -list keystore mykeystore.keystore and it gives me a MD5 Certificate fingerprint. Do I need to redo the signing (meaning I can't use the eclipse export wizard)?
Can I use a debug certificate first?
Start an export process to create an apk for your app and use your production key. The very last page displays both your SHA1 and MD5 certificate fingerprints
I know this question has been answered but this is how I found my signature for the default keystore. In Eclipse, if you go to Windows -> Preferences -> Android -> Build
I think this will work perfectly. I used the same:
For Android Studio:
Click on Build > Generate Signed APK.
You will get a message box, just click OK.
Now there will be another window just copy Key Store Path.
Now open a command prompt and go to C:\Program
Files\Java\jdk1.6.0_39\bin> (or any installed jdk version).
Type keytool -list -v -keystore and then paste your Key Store
Path (Eg. C:\Program Files\Java\jdk1.6.0_39\bin>keytool -list -v
-keystore "E:\My Projects \Android\android studio\signed apks\Hello World\HelloWorld.jks").
Now it will Ask Key Store Password, provide yours and press Enter to get your SHA1 and MD5 Certificate keys.
If you are using Mac or even Linux, just copy and paste this onto the Terminal application and you will get the SHA1 key immediately. No need to change anything.
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
Example output:
Alias name: androiddebugkey
Creation date: 17 Feb 12
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: 4f3dfc69
Valid from: Fri Feb 17 15:06:17 SGT 2012 until: Sun Feb 09 15:06:17 SGT 2042
Certificate fingerprints:
MD5: 11:10:11:11:11:11:11:11:11:11:11:11:11:11:11:11
SHA1: 11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:01:11
Signature algorithm name: SHA1withRSA
Version: 3
use this in the command line
c:\Program Files\Java\jdk1.6.25\bin>keytool -list -v -keystore c:\you_key_here.key
Open terminal (in Unix, in MAC), (cmd in Windows) and cd to this (your java) path:
C:\Program Files\Java\jdk1.6.0_43\bin>
Run this command:
keytool -list -v -keystore C:\Users\leon\.android\debug.keystore -alias androiddebugkey -storepass android -keypass android
Just change the path to debug.keystore and you will get both MD5 and SHA-1 fingerprints.
keytool -list -v -keystore "keyStoreName"
Run this command from the directory where the keystore of your app exists.
In Android Studio, follow these steps:
Click Gradle properties menu at right side of your android studio IDE.
Expand Task tree.
Click on signingReport
You can see your SHA1 at the bottom console
See if you want to use Google Map at that time you need MD5 fingerprint for generating api kay for using google map in your android application.
Keytool command generated MD5 fingerprint if you use JDK 1.6 and it generates SHA1 fingerprint if you use JDK 1.7.
So the thing is that if you want to sign your application for publishing then read this.
And if you want to use google-map read this.
If you are using IntelliJ (12+?), go to menu Build/Generate signed Api
After filling a popup, get the data in the field "key store path" (e.g. C:\Users\user\Documents\store\store)
And run in a command line:
>keytool -list -v -keystore "C:\Users\user\Documents\store\store"
....
MD5: 11:C5:09:73:50:A4:E5:71:A2:26:13:E0:7B:CD:DD:6B
--> SHA1: 07:0B:0E:E8:F7:22:59:72:6A:1C:68:05:05:CF:2E:6F:59:43:48:99
SHA256: E6:CE:DA:37:C1:18:43:C1:A3:F0:9E:8F:1A:C2:69:AF:E6:41:F7:C0:18:
1D:1D:55:5D:F0:52:6C:EE:77:84:A7
...
Good luck
If any one using the Android studio...
click: Build > Generate Signed in APK
Create a new key: this will generated ".jks" files
Use following command to read the data(SHA1 and other info):
$ keytool -list -v -keystore filename.jks
For those using OpenSSL you can retrieve the SHA1 fingerprint this way:
OpenSSL> dgst -sha1 my-release-key.keystore
Which would result in the following output:
I was so confusing first time, but I propose you final working solution for Windows:
1) Open cmd and go to your Java/jdk/bin directory (just press cd .. to go one folder back and cd NAME_FOLDER to go one folder forward), in my case, final folder: C:\Program Files\Java\jdk1.8.0_73\bin>
2) Now type this command keytool -list -v -keystore C:\Users\YOUR_WINDOWS_USER\.android\debug.keystore -alias androiddebugkey -storepass android -keypass android
As result you have to get something like this:
Here is my easy solution for this:
Click on Gradle button, you can find at the right side top. you will see all the gradle files. Now go to android, and double click on signingReport. Once the gradle build finishes, you see the SHA key. Check the below images for step by step guide.
Once you click on Gradle check the below images. Hope this helps someone.
STEP 1:
STEP 2:
If you are using Android Studio. You can get fastly the SHA1 certificate fingerprint (debug,release... all Build Types!!) through Gradle Tasks:
signingReport
SHA1 is shown in Messages Logs
Android Plugin (configured in the gradle app) creates a debug mode for default.
com.android.application
File route to keystore:
HOME/.android/debug.keystore
I recommend attach debug.keystore to build.gradle. To do this put a file debug.keystore to a app folder and then Add SigningConfigs in gradle app:
apply plugin: 'com.android.application'
android {
................
signingConfigs {
debug {
storeFile file("../app/debug.keystore")
storePassword "android"
keyAlias "androiddebugkey"
keyPassword "android"
}
release {
storeFile file("../app/debug.keystore")
storePassword "android"
keyAlias "androiddebugkey"
keyPassword "android"
}
}
........
}
Extra: If you want creates for release, put a file release.keystore to a app folder. (This example uses the same debug.keystore)
If you are using Android Studio. You don't need to generate a SHA1 fingerprint using cmd prompt. You just need to create a project with default Maps Activity of Android Studio.In the project you can get the fingerprint in google_maps_api.xml under Values folder. Hope this will help you. :)
Try this One:
Windows----preferences----Android--build---sh1 code copy from here
I think this will work perfectly. I used the same:
For Android Studio:
Click on Build > Generate Signed APK.
You will get a message box, just click OK.
Now there will be another window just copy Key Store Path.
Now open a command prompt and go to C:\Program Files\Java\jdk1.6.0_39\bin> (or any installed jdk version).
Type keytool -list -v -keystore and then paste your Key Store Path (Eg. C:\Program Files\Java\jdk1.6.0_39\bin>keytool -list -v -keystore "E:\My Projects \Android\android studio\signed apks\Hello World\HelloWorld.jks").
Now it will Ask Key Store Password, provide yours and press Enter to get your SHA1 and MD5 Certificate keys.
Now add this SHA1 key to the google developers console in credentials tab and also change the build variants in android studio to release mode.
Please Click on Gradle from Right side of Menu
Then Click on :app
Then Click android folder
Then SigningReport file name is exist there
Double click on that.
It Will start executing and in a while it will show you SHA-1 Code
Just copy the code.
And paste it where you need it
For those on mac looking for keytool. follow these steps:
Firstly make sure to install Java JDK
http://docs.oracle.com/javase/7/docs/webnotes/install/mac/mac-jdk.html
Then type this into command prompt:
/usr/libexec/java_home -v 1.7
it will spit out something like:
/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home
keytool is located in the same directory as javac. ie:
/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/bin
From bin directory you can use the keytool.
If you are on Mac/Linux, then you can get SHA1 fingerprint by writing following line in the terminal:
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
There are 2 things possible after this
It will ask you for the password
Just type
android
and press enter, you can find the SHA1 key in the output shown below.
It will ask you to download a suitable program (and some list will
be given)
Just type following in terminal
sudo apt install openjdk-8-jre-headless
and then again run following in terminal: keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
This time, you will be led to step 1, where you need to just enter the password as
android
and you will get your SHA1 fingerprint below in the output.
Open your command prompt
Navigate working directory to 1.8.0/bin
paste keytool -list -v -alias androiddebugkey -keystore %USERPROFILE%\.android\debug.keystore
Press enter if it ask you a password
If you want to obtain fingerprint-sha1 key from signing keystore.jks file
Run the following command from terminal:
keytool -list -v -keystore <.../path/keystore.jks>
Example
keytool -list -v -keystore /Users/Home/Projects/Keystore/myApp_keystore.jks
Enter keystore password:
Keystore type: JKS
Keystore provider: SUN
Your keystore contains 1 entry
Alias name:myApp_alias
Owner: CN=xxx, OU=xxx Dev, O=ZZZ, L=Dhaka, ST=Dhaka, C=BD
..........
Certificate fingerprints:
MD5: 12:10:11:12:11:11:11:11:11:11:33:11:11:11:11:11
SHA1: 11:44:11:11:55:11:17:11:11:66:11:11:88:11:11:77:11:11:01:11
.....................
Using portecle :
File > Open Keystore file
Enter Keystore password
Right click on alias name > Certificate details > SHA-1 Fingerprint
Easiest way to Get SHA-1 For Release and Debug mode android studio gradle. Check this
I wanted to post a notice to those that are having the same issue as me. I went through the steps to generate my debug SHA-1 and my release SHA-1. I was attempting to connect Google Sign-In API with my app.
I ran into the issue that the debug .apk would work fine, it would connect and authenticate with Google Sign-In. My release .apk would also work, when installed manually to the phone. When I posted my release .apk to the Google play store, my google Sign-in would not authenticate and I would get an issue!
For the longest time I couldn't figure it out, but I found that my app was being signed by google, i.e., the message on the top of the Developer console was showing: Google Play App Signing is enabled for this app.
I went to my Release Management tab, then scrolled down to App Signing, and found the SHA-1 there. After adding this to my code and on "firebase console" which I was using as the backend for Google Sign-in, everything seemed to work. It looks like my release keystore was getting replaced with the google signed certificate... I'm not really sure if this is what was happening, but it resolved my issue and allowed my Google Play Store release apk to correctly authenticate with the google sign in!
Step by step solution:
Open your command prompt or Terminal for Mac
Change directory to directory of the keytool file location. Change directory by using command cd <directory path>. (Note: if any directory name has space then add \ between the two words. Example cd /Applications/Android\ Studio.app//Contents/jre/jdk/Contents/Home/bin/)
To find the location of your keytool, you go to android studio..open your project. And go to
File>project Structure>SDK location..and find JDK location.
Run the keytool by this command:
keytool -list -v –keystore <your jks file path> (Note: if any directory name has space then add \ between the two words. example
keytool -list -v -keystore /Users/username/Desktop/tasmiah\ mobile/v3/jordanos.jks)
Command prompt you to key in the password.. so key in your password.. then you get the result
Here is tool for lazy coders:
1 add dependency:
compile 'com.vk:androidsdk:1.6.9'
2 add following lines somewhere in your activity/application:
String[] fingerprints = VKUtil.getCertificateFingerprint(this, getPackageName());
Log.d("SHA1", fingerprints[0]);
3 Open logcat and catch message.
4 Profit!
In latest version of Android Studio best way to get the SHA-1 key is form terminal. ,
open terminal in Android studio
Copy the
command( keytool -list -v -keystore ~/.android/debug.keystore -alias
androiddebugkey -storepass android -keypass android)
Paster it on terminal and press the enter key

Invalid fingerprint for generating Google Map key for android application

I have successfully generated the fingerprint Certificate for google map key by using these command
keytool -list -alias androiddebugkey -keystore "C:\Users\pc\.android
\debug.keystore" -storepass android -keypass android
and i got this result
androiddebugkey, Aug 25, 2012, PrivateKeyEntry,
Certificate fingerprint (SHA1): 68:1F:B8:80:C0:B9:96:D1:6E:95:86:69:CD:DB:0E:28:DC:9E:89:51
when i try to register Certificate fingerprint on this site https://developers.google.com/android/maps-api-signup
page replied me The fingerprint you entered is not valid. Please press the Back button on your browser and enter a valid certificate fingerprint
where is problem please help.
I find the solution of my problem just changed the command by this
keytool -list -v -alias androiddebugkey -keystore C:\Users\<user>\.android\debug.keystore -storepass android -keypass android
If your having issues finding the debug key path or dont want to use the adb you can get the fingerprint in eclipse:
go to window-->preferences and find the android section. Select the build sub-setting.
for the production fingerprint when your exporting your signed application using ADT right before you click finish the hash will be there. just copy it.

Problems getting MD5 fingerprint

I try to generate a MD5 fingerprint to obtain a map api key using Java7.
I do it on the way, described at developer page
"C:\Program Files\Java\jdk1.7.0\bin\keytool" -list -alias androiddebugkey -keystore C:\Users\username\.android\debug.keystore -storepass android -keypass android
The problem is, I'm getting SHA1 Fingerprint and not MD5
androiddebugkey, 01.08.2011, PrivateKeyEntry,
Certificate fingerprint (SHA1): xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx
Any ideas why?
Thnak you in advance
Interesting. Well, you can get the entire cert information using this command.
keytool -list -v -keystore C:\Users\username\.android\debug.keystore
You'll need to enter android as the password when prompted. That will give you everything in the keystore, which should only be one certificate rather than looking for a specific alias. It should show you both an MD5 and a SHA1 fingerprint. Give that a try and let me know.
The only thing I can think of is that jdk1.7's keytool gets information differently than jdk1.6(returns SHA1 by default?). This is just a guess and has not been verified but it is the only thing I can really think of.
Edit: It appears my guess might be correct. JDK 7 changes keytool output
Ok. I solved the problem with this answer
I changed my call to "C:\Program Files\Java\jre6\bin\keytool" and ... everything works

How can I get the MD5 fingerprint from Java's keytool, not only SHA-1?

As I want to use Google maps in my application, I need the debug certificates' MD5 fingerprint. I tried following.:
(Here I copied the debug.keystore file from C:\Documents and Settings\Administrator.android in bin folder)
C:\Program Files\Java\jdk1.7.0\bin>keytool -list -alias androiddebugkey -keystore debug.keystore -storepass android -keypass android
But got the following results:
androiddebugkey, May 27, 2011, PrivateKeyEntry,Certificate fingerprint (SHA1): "some code"
However that is not working to get MAP API key. Is SHA1 is same as MD5?
What should I do to get the MD5 certificate?
With JDK 1.7 installed, keytool always outputs by default SHA1 fingerprint, not MD5.
you can get the MD5 Certificate by adding -v option.
use the following code:-
C:\Program Files\Java\jdk1.7.0\bin>keytool -v -list -alias
androiddebugkey -keystore debug.keystore -storepass android -keypass android
it will output MD5 certificate as well.
To get MD5 value and SHA1...etc fallow this below:
Before this dont forget to copy the debug.keystore to a folder Androidkeystore like that created in C drive.
C:\Program Files\Java\jdk1.7.0_05\bin>keytool -v -list -keystore C:\Androidkeyst
ore\debug.keystore
it asks here..
Enter keystore password: android
enter you got here MD5 & SHA1..etc
Keystore type: JKS
Keystore provider: SUN
Your keystore contains ? entry
Alias name: androiddebugkey
Creation date: ?? ???, ????
Entry type: PrivateKeyEntry
Certificate chain length: 1
Certificate[?]:
Owner: CN=Android Debug, O=Android, C=US
Issuer: CN=Android Debug, O=Android, C=US
Serial number: 67b6344b
Valid from: Mon Jun 18 20:33:56 IST 2012 until: Wed Jun 11 20:33:56 IST 2042
Certificate fingerprints:
MD5: C2:61:51:3E:BC:C8:0C:DB:75:B6:E7:C4:90:AD:91:39
SHA1: CD:5E:8A:0F:4E:0F:2E:FD:92:5E:5E:4R:CF:F8:44:33:2C:8C:B8:97
SHA256: B5:BF:75:60:DB:62:09:49:F1:38:CH:49:18:22:18:95:03:C9:5C:14:F6:
B0:F4:21:D2:19:B8:FF:38:D2:B9:FD
Signature algorithm name: SHA256withRSA
NOTE: if there are any spaces in the directory path you MUST enclose it in quotes. e.g. use this format:
-keystore "C:\Users\Your Name\.android\debug.keystore"
Hello in the year 2021.
The keytool of JDK 8 and newer does not print MD5 anymore, even if you try the standard suggestion to add the "-v" option to the "keygen -list" command.
I guess MD5 is no more considered secure enough and has been removed.
At the same time there are still places like Amazon "Security Profile Management" for LWA etc. requiring you to submit the MD5 signature of your certificate.
Here is a command which will deliver it (use the password "android" for the Android Studio keystore):
keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | \
openssl dgst -md5
And if you want to have colon character inbetween, then add the following "sed" command:
keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | \
openssl dgst -md5 | \
sed 's/[a-fA-F0-9][a-fA-F0-9]/&:/g; s/:$//'
The above command works on Linux, macOS and even Windows (in git bash):
If you are using jdk 7:
Use -v option.
The easiest way to get SHA 1,MD 5 is to click on Gradle in the upper hand right side near the corner of the screen of Android Studio. Then click on the name of the app(e.g android123(root): it should appear like this). After that, you will find a subfolder named android and clicking on it go for the signingReport.It should run in the console and should show you the SHA 1,MD 5. Hope it helps.
add -v
right after keytool and before -list
keytool -v -list
copy ' debug.keystore ' file to c:\ or Some folder
you try going
c:\Program Files\Java\jdk1.6.25\bin folder
and input
c:\Program Files\Java\jdk1.6.25\bin>keytool -list -keystore c:\debug.keystore
password is 'android'
The -v flag gives the SHA1 certification as well. Without that flag you only get the MD5 fingerprint.
I have solved the problem in Windows 8 by opening the Command Prompt (Admin), then type:
C:\Program Files (x86)\Java\jre7\bin>keytool -v -list -keystore C:\<Your Path>\<Your Keystore>
After that, simply go to https://code.google.com/apis/console/
As they changed to a new interface, you have to go to the APIs & auth tab on the left side, then go to Registered Apps, select your existing API key to replace it or create a new one, using the SHA1 code generated previously.
That's how I got it working.
It's not true that JDK 1.7 keytool ALWAYS return SHA1 fingerprint. Look there to solve the problem instead of downgrade your JDK: http://code.google.com/p/android/issues/detail?id=19035#makechanges
Simply export your project using your keystore in eclipse and in the last step you will get both SHA-1 and MD-5..
Look at this question for more details.

Categories

Resources