I tried using:
keytool -exportcert -alias <RELEASE_KEY_ALIAS> -keystore <RELEASE_KEY_PATH> | PATH_TO_OPENSSL_LIBRARY\bin\openssl sha1 -binary | PATH_TO_OPENSSL_LIBRARY\bin\openssl base64
This didn't seem to work for me as it said:
What do it do?
Use the following command to get SHA-1 hash of your signing key.
keytool -list -v -keystore KEYSTORE_PATH -alias ALIAS_NAME
Open your Gradle menu in Android studio.
Expand the "Tasks"
Inside "android", please click on "signingReport"
In you run tab, you will find the SHA-1 key.
Related
The Facebook error message is :
Invalid key hash. The key hash xxxxxxx= does not match any stored key hashes...
I know this issue has been already treated but i still have the problem. I wrote below the detailled process but i should have miss something. Please help.
I am working on windows 10/Cordova/android.
Open cmd window as adminstrator
npm update -g cordova
cordova platform update android
cd platforms\android\build\outputs\apk; rm *.apk
keytool -genkey -v -keystore myapp.keystore -alias myappalias-keyalg RSA -keysize 2048 -validity 10000
cordova build android –release
Create platforms\android\release-signing.properties file including:
storeType=jks
keyAlias=myappalias
keyPassword=mypass
storePassword=mypass
remove the app from the android-smartphone
cordova run android –release
The key hash i cut& paste in the facebook field is given by the command:
keytool -exportcert -list -v -alias myappalias -keystore myapp.keystore | openssl sha1 -binary | openssl base64
It includes the sign =
Any Idea ?
Try this:
keytool -exportcert -alias <RELEASE_KEY_ALIAS> -keystore <RELEASE_KEY_PATH> | openssl sha1 -binary | openssl base64
You can also use this.
keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64
I have been trying to get my key hash for my release to work for hours now, and I must be doing something wrong because I have searched and tried so many different things,
Now lets say my alias is john_doe_key, and my keysotre is located at /Users/loaner/Downloads/UEat/app/app-release.apk
I would have my command in my terminal look like this correct?
keytool -exportcert -alias john_doe_key -keystore ~/Users/loaner/Downloads/UEat/app/app-release.apk | openssl sha1 -binary | openssl base64
or is that not right?
I have tried this and logging the key like face books says in the guide.
Thanks for the help in advance
From reading your comment and seeing what you have so far, you're trying to get the key hash for Facebook, right?
First, make sure that you have signed your apk (which is your app). You can sign your apk in Android Studio by Build -> "Generate Signed APK...". When you sign your apk, you create your keystore and an alias for that keystore. I think your are confusing "keystore" with the "apk".
Also, you have to include your alias and keystore passwords in your command.
It should look like this:
keytool -exportcert -keystore keystore_file -alias alias_name -storepass keystorepassword -keypass aliaspassword | openssl sha1 -binary | openssl base64
Also, make sure that you are creating a "Release Build", which can be selected from the Build Variants menu.
Generate a key store
$ keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
Sign an apk.
$ jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore my_application.apk alias_name
well i am stuck on this step too
$ keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64 Enter keystore password: android
please any body explain it
after i tried on cmd i get it and it do as follow
first locate keytool in your system by cd \path\
after that write this line as it is
$ keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64
and this one mean ~/.android/debug.keystore
the path where your keystore exported from eclips
and to make sure that the hashkey generated is really right the cmd should ask you about the password you use to generate keystore
I run the script below like Facebook said. There is no compiling problem. The problem is it never gives me a password question after process finished and according to facebook documentation it means my keystore path is incorrect. But debug.keystore file is in correct path! C:\Users\KSM45.android
Please let me know where do I make mistake? I just want to login with facebook!
(From documentation page: Also make sure you are using the correct password - for the debug keystore, use 'android' to generate the keyhash. General Rule: If the tool does not ask for password, your keystore path is incorrect.)
keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64
Try to delete your keystore in ~/.android/debug.keystore then clean your project in eclipse and run your app so the eclipse plugin re-create your keystore.
I tried it on WinXP at work today and it didn't work. After few trying I realized this
this is the line i ran and failed:
keytool -exportcert -alias androiddebugkey -keystore C:\Documents and Settings\Administrator.android\debug.keystore | openssl sha1 -binary | openssl base64
the thing is, you should put "quotation marks" around your debug.keystore path
just like this:
keytool -exportcert -alias androiddebugkey -keystore "C:\Documents and Settings\Administrator.android\debug.keystore" | openssl sha1 -binary | openssl base64
Well.. first of all, sorry for my english..
The api facebook works perfectly in the emulator but when i put it on a mobile it doesnt work.. just open and close the window.. so..
I found this 2 commands to generate the Hash Key but i dont know witch one is the correct or what im doing wrong, because i write any password and the command works but at the mobile not..
This is for debug mode.. and the password is default "android"
keytool -exportcert -alias androiddebugkey -keystore /Users/user/.android/debug.keystore | openssl sha1 -binary | openssl enc -a -e
This is for release mode.. and the password is the password of your signing key..
keytool -exportcert -alias androiddebugkey -keystore /Users/user/Desktop/testsing | openssl sha1 -binary | openssl enc -a -e
What I am doing wrong?
Thank you!!
You can try this way to bu sure 100%
Go to Your folder on command prompt with Java\bin like example: C:\Program Files\Java\jdk1.7.0_09\bin>
Prepare your commands
from facebook developer tutorial:
keytool -exportcert -alias androiddebugkey -keystore
%HOMEPATH%.android\debug.keystore | openssl sha1 -binary | openssl
base64
if you have any problem with openssl you can download it and install example on C:\OpenSSL and then
keytool -exportcert -alias androiddebugkey -keystore
%HOMEPATH%.android\debug.keystore | "C:\OpenSSL\bin\openssl" sha1 -binary | "C:\OpenSSL\bin\openssl" base64