I'm working on adding Facebook API integration with ionic/Cordova and am trying to find the debug hash key that is generated for my app when I do:
ionic build android
I know that it generates a new .keystore file at /userhomedir/.android/debug.keystore. But what does it set as the alias and password? And how can I retrieve this hash key after Cordova has created it for my app. I don't see the hash key being printed anywhere during the build process.
I need the generated hash key to give to Facebook API to use their sign on SDK
It seems Cordova use ~/android/debug.keystore with the password android
To get it :
keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64
With password : android
One answer that worked for me is this one:
Copy the apkname.apk file you want to know the hash of to the 'Java\jdk1.7.0_79\bin' folder
Run this command keytool -list -printcert -jarfile apkname.apk
Copy the SHA1 value and convert it using this site
Use the converted Keyhash value (ex. zaHqo1xcaPv6CmvlWnJk3SaNRIQ=)
keytool -genkey -v -keystore my-release-key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias my-alias
Related
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
i am using appcelerator Studio 6.0.4GA SDK , i am having issue by finding debug.keystore
when i write in Terminal :
keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64
its return keyhash , i've put this keyhash in Facebook developer app but its still giving error key hash not matched , where i can get this keyhash, since i am using Mac and Appcelerator Studio .
There are 2 types of key-hashes developers need to put into FB app settings.
- Development Key Hash -
As mentioned in FB docs here, you need to run this command for all development builds,
keytool -exportcert -alias androiddebugkey -keystore debug.keystore | openssl sha1 -binary | openssl base64
androiddebugkey is the key_alias name
debug.keystore is the keystore file name which is stored in your mac user home-directory in a hidden folder .android
after running this command, it will ask for a password, put android, it's the default password for this default keystore.
- Production Key Hash -
Same command is used to get production key-hash but with your own keystore file, alias_name & password.
keytool -exportcert -alias <alias_name> -keystore <keystore_file_path> | openssl sha1 -binary | openssl base64
put alias_name as same as you used to create your production keystore.
put same password you used to generate your production keystore.
To save the work, you can simply use zON/CPoDnIgHvMure4hh9HWdR58= which represents the default dev-keystore for Titanium Android apps.
Here is the solution might help someone else
1- navigate to /Users/YOUR_USER_NAME/Library/Application Support/Titanium/mobilesdk/osx/<YOUR_SDK_VERSION>
2- type in terminal
keytool -exportcert -alias tidev -keystore dev_keystore | openssl sha1 -binary | openssl base64
3- put the password : tirocks
they keyhash will print out
I've got a problem with my application on Google Play! I have a Facebook connection and it works fine when I test in Eclipse, but when I distribute it on Google, I get this error message: "remote app id does not match stored id". Any ideas?
Here is an article explaining how to sign your Android app. http://developer.android.com/tools/publishing/app-signing.html
There is information there on how to generate your keys as well as how to use them within Eclipse.
Here is the example from that page on how to generate a private key:
$ keytool -genkey -v -keystore my-release-key.keystore
-alias alias_name -keyalg RSA -keysize 2048 -validity 10000
Make sure you read the whole page, there is lots of good information there.
I've entered this command :
C:\Program Files\Java\jdk1.7.0_21\bin>keytool -exportcert -alias MYALIAS -ke
ystore "C:\xxxxx\xxxxx.keystore" | "C:\OpenSSL\bin\openssl" sha1 -bi
nary | "C:\OpenSSL\bin\openssl" base64
The alias is correct, the path to...
I don't understand why the key is steel incorrect...
Thanks for your help...
I created facebook application and i put key in key hash
still facebook login failed
error is Invalid key error.
Plz help me.
my application is ready but this problem cause delay in publishing my application.
the steps that i followed to get key hash are
copied all file from OpenSSl into jdk
set path to C:/programfiles/java/jdk/bin in command prompt
then run= keytool -export -alias androiddebugkey -keystore "[PATH]\debug.keystore" -storepass android -keypass android | openssl sha1 -binary | openssl enc -a -e
got hash key +ZRWQIs5LsdDsBNdoJ8wT2RyYrE=
copied into native android app in hash key but still error occurred plz help me
Use the below command to generate your keyhash.
keytool -exportcert -alias androiddebugkey -keystore [your path]/.android/debug.keystore | openssl sha1 -binary | openssl base64
use "android" as a password.
For more information on facebook Single Sign-On you can check the link
I'm using Windows 7.
I have tried several times with the debug.keystore with appears in c:\users\YOURUSER.android\ using the command:
keytool -list -alias androiddebugkey -keystore c:\Users\YOURUSER\.android\debug.keystore -storepass android -keypass android
It gives me a MD5, but then I go to Google MD5 registration page and it sais it is not a valid fingerprint.
I searched for more information, and I finally created a new debug.keystore into c:\users\YOURUSER\ to avoid rewriting the original one. I used this command:
keytool -genkey -keypass android -keystore c:\users\YOURUSER\debug.keystore -alias androiddebugkey -storepass android -validity 10000 -dname "CN=Android Debug,O=Android,C=US"
It works, so I use the previous command to get the MD5, and it gives me a new MD5. Then I go to Google again and the same problem: "not a valid fingerprint".
The I made a second attempt. This is what I did then:
1) Opened a Windows7 terminal, went to c:\program files\java\jdk1.7.0\bin\
2) Wrote command:
keytool -genkey -v -keystore c:\eclipse\my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
3) Then I tried to get the MD5 code from my keystore, using comand:
keytool -list -alias alias_name -keystore c:\eclipse\my-release-key.keystore
and writing the password I am asked. It gives me a MD5.
4) I go to maps api key sign up and write the MD5. "FINGERPRINT NOT VALID"
I don't know what the problem is. And I am supposed to do this for every app I program? What a headache!
Can anybody help me please?
Are you sure you get the MD5 and not the SHA1 fingerprint? Tryed the -v option?
see: How can I get the MD5 fingerprint from Java's keytool, not only SHA-1?
google maps has deprecated its previous version API v1 and introduced a new version of google maps API v2.
previously we generated md5 key but now we need to generate sha-1 fingerprint certificate.
The Maps API key is based on a short form of your application's digital certificate, known as its SHA-1 fingerprint. The fingerprint is a unique text string generated from the commonly-used SHA-1 hashing algorithm. Because the fingerprint is itself unique, Google Maps uses it as a way to identify your application.
please go through the links it could help you
https://developers.google.com/maps/documentation/android/start#the_google_maps_api_key
https://developers.google.com/maps/documentation/android/intro#sample_code
also see the same kind of post in stack over flow
How to implement Google Maps new version of API v2
In command line you need to open Java-> jdk-> bin
as for me it is "C:\Program Files\Java\jdk1.7.0_03\bin"
There is "keytool" program which u need. In command line enter "cd C:\Program Files\Java\jdk1.7.0_03\bin"
And enter "keytool -list -v -keystore C:\Users\John\.android\debug.keystore"
So the final string in command line must look like:
"C:\Program Files\Java\jdk1.7.0_03\bin>keytool -list -v -keystore C:\Users\John\.android\debug.keystore". Whare usually u need only to change the name "John"
There will be SHA-1, MD5, etc
Finally, go to Google Access API google access api