Certificate fingerprint (SHA1) should I change it with release Certificate? - android

I am new to Google Play Game Services and recently managed to include it to an app. I generated a Certificate fingerprint with a terminal using this commant on MAC to test it:
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
My question is, when I upload my app to my dev account, should I change the certificate from debug to release? If yes, how can I do that?
is it using the same command but instead of "debug.keystore" -> release.keystore?

Yes, you will need to change it. See that your using androiddebugkey. When you release the app you will need to sign the app and then use the same key to generate the certificate.
If you using Android Studio, you can easily create a new key store and a new key alias. (Build -> Generate Signed APK)
Generate the release Certificate:
keytool -list -v -keystore ~/MyPath/my.new.keystore -alias mynewalias -storepass keystorepassword -keypass aliaspassword
EDIT: List the certificate fingerprints (SHA1, MD5) using this command line:
keytool -v -list -keystore yourkeystore -alias youralias

Related

google SignIn in android getting Invalid SHA-1 certificate fingerprint error

I want to integrate google SignIn to my android app. I have followed all the steps as per the documents. i have created a cerificate finger print through cmd using the following command.
keytool -list -keystore C:\Users\ufxyhy\.android\debug.keystore
I have entered the password when it prompted and then I got a key showing as SHA-256, and it shows as invalid fingerprint when creating OAuth client ID.
The result I am getting in cmd is follows
Keystore type: JKS
Keystore provider: SUN
Your keystore contains 1 entry
androiddebugkey, 18-May-2018, PrivateKeyEntry,
Certificate fingerprint (SHA-256):
00:00:****************:00:00:00:00:00
It shows as SHA-256, How can I create correct SHA-1 finger print for debug?
you can get SHA1 with follow command
keytool -list -v -keystore {keystore_name} -alias {alias_name}
eg:
keytool -list -v -keystore C:\Users\me\Desktop\release.jks -alias sample
you can also get it in android studio directly as in image
You need to provide default keystore password and key password which you have not provided run below code and check.
keytool -list -keystore C:\Users\ufxyhy\.android\debug.keystore -alias androiddebugkey -storepass android -keypass android

Release.Keystore for Map API

I have run the following command to get SHA1 key, and use it in the Google Map API to generateAPI Key.
However, when I use release version of the APK, the application does not show the map
keytool -list -v -keystore "%USERPROFILE%\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
I dont see release.keystore in the %USERPROFILE%\.android directory
this command is just for your debug keystore, you need to do the same thing with your release Keystore

get android release Certificate Fingerprints

I am using Android Studio on Mac El Capitan. How do I get the release Certificate Fingerprints? I need it for Firebase. I am not sure exactly how to get it.
Just to test it (with the debug fingerprint), run the following command in any directory with the terminal.
$ keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore -list -v
Then copy the SHA1 value and paste it into your Firebase console.
Be careful, the above will work for the debug environment, if you want to set up the release fingerprint you will have to create a keystore, check out this post to see how to do it, and then run the same command but instead of ~/.android/debug.keystore you should put ~/YOUR/PATH/TO/KEYSTORE
$ keytool -exportcert -alias androiddebugkey -keystore ~/YOUR/PATH/TO/KEYSTORE -list -v
Android: What is a keystore file, and what is it used for?
As this question is to get RELEASE certificate fingerprint, easy way to get RELEASE fingerprint is,
Open terminal
Go to directory where project's .jks file located
Finally get it by,
keytool -exportcert -alias ALIAS_NAME -keystore KEYSTORE_NAME_WITH_EXTENSION -list -v
Example :
ALIAS_NAME_HERE : kakha
KEY_FULL_PATH : C:\Users\kakha\key.jks
keytool -exportcert -alias "ALIAS_NAME_HERE"-keystore "KEY_FULL_PATH" -list -v
as #lasec0203 said, you dont need to use alias...
Just use this code;
keytool -list -v -keystore "/fullpath/upload-keystore.jks"
and after that, enter your keystore than you will get the your certificate fingerprint.

How to generate production sha1 key for Android?

I am building an android application where I am using google login. I earlier I have generated debug sha1 certificate key and it was working fine used below code - keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
Now I need to generate production. Could anyone help me to figure this out how to generate SHA1 key for production release.

Android: Released vs Debug Fingerprint (Sha1)

I was trying to obtain my Sha1 fingerprint for release and debug. Fortunately, I was able to obtain the debug version code through
keytool -list -alias androiddebugkey -keystore C:\Users\Name.android\debug.keystore -storepass android -keypass android
I was wondering how I would get the release? I tried
keytool -list -alias androidreleasekey -keystore C:\Users\Name.android\debug.keystore -storepass android -keypass android
but unfortunately it came out as keytool error: java.lang.Exception: Alias <androidreleasekey> does not exist.
*Actually my result may have been my released key store since I already built it as released app... I'm not entirely sure though.
You need to find the location of the release keystore file and the name of the alias that you used to build your app.
To do this in Android Studio select Build > Generate Signed APK. You should see a dialog similar to below.
Get the location of the full file path for the release keystore from the Key store path. Then use this path along with the Key alias that is listed to get the SHA1 as you tried previously:
keytool -list -alias myappsalias -keystore
C:\users\dell-laptop\AndroidStudioProjects\myapp\myapp_release.keystore -storepass android -keypass android

Categories

Resources