Trying to create an android app with Facebook integration, I've gotten to the part in the docs where you have to generate a key hash file, it specifies to run the following code
keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore
| openssl sha1 -binary
| openssl base64
When I run this in my terminal I get an error for Keystore tampered with or password was incorrect,
I just want to generate my Key Hash
Can anyone point me in the right direction?
I was able to do perform the requested task with some of the solutions here, but thought to myself, boy that is stupid... why not to write a small Java code that does this and pack it into a Jar, so I did...
A link to download the Jar
Works on Windows 8... didn't try any other OS.
Generate Debug hash key
Generate Release hash key
In order to generate release key hash you need to follow some easy steps.
1) Download Openssl
2) Make a openssl folder in C drive
3) Extract Zip files into this openssl folder created in C Drive.
4) Copy the File debug.keystore from .android folder in my case (C:\Users\SYSTEM.android) and paste into JDK bin Folder in my case (C:\Program Files\Java\jdk1.6.0_05\bin)
5) Open command prompt and give the path of JDK Bin folder in my case (C:\Program Files\Java\jdk1.7.0_40\bin).
6) Copy the following code and hit enter
keytool -exportcert -alias abcd-keystore D:\Projects\MyAppFolder\keystore.txt | C:\openssl\bin\openssl sha1 - binary | C:\openssl\bin\openssl base64 ex - keytool -exportcert -alias (your sing apk alias name enter here like my sign apk alian name is abcd )-keystore "signed apk generated keystore apth enter here" | "openssl bin folder path enter here" sha1 - binary | "openssl bin folder path enter here" base64
7) Now you need to enter password, Password = (enter your sign keystore password here)
8) you got keystore which are used for release app key hash
Hi everyone its my story how i get signed has key for facebook
first of all you just have copy this 2 methods in your first class
**Call funcation getAppKeyHash() from your oncreate methode if you want signed hash then make signed build install signed build and run you will get hash key in dialog then just note it and update it on facebook dev account and comment that function and make another signed APK **
In order to generate key hash you need to follow some easy steps.
1) Download Openssl from: here.
2) Make a openssl folder in C drive
3) Extract Zip files into this openssl folder created in C Drive.
4) Copy the File debug.keystore from .android folder in my case (C:\Users\SYSTEM.android) and paste into JDK bin Folder in my case (C:\Program Files\Java\jdk1.6.0_05\bin)
5) Open command prompt and give the path of JDK Bin folder in my case (C:\Program Files\Java\jdk1.6.0_05\bin).
6) Copy the following code and hit enter
7) Now you need to enter password, Password = android.
8) If you see in openssl Bin folder, you will get a file with the name of debug.txt
9) Now either you can restart command prompt or work with existing command prompt
10) get back to C drive and give the path of openssl Bin folder
11) copy the following code and paste
12) you will get debug_sha.txt in openssl bin folder
13) Again copy following code and paste
14) you will get debug_base64.txt in openssl bin folder
15) open debug_base64.txt file Here is your Key hash.
At last :)
Here my story :
Add this code to your main activity, after you set layout.
Change PROJECTNAME to your package name!