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
Great blog post on the subject
Extracting the Key Hash from .p12 key
Great and simple hexadecimal editor for mac: HexFiend
OpenSSL should be preinstalled on mac, and here is the link for Windows version.
Link
SIMPLEST SOLUTION OUT THERE FOR THIS PROBLEM:
I have had this Problem for two months now. My key hashes have been pyling up to 9. Today i finally found the simple solution:
STEP 1:
Install the facebook sdk you downloaded from the facebook developer page on your phone. Don´t install the normal facebook app. Make sure you can log into facebook. Then log out.
STEP 2:
Export your app with your final release key as an apk, like you would when uploading it to the playstore.
STEP 3:
Put the Apk file on your phone via usb cable or usb stick.
STEP 4:
Install your app, using a file manager: Example
STEP 5:
Launch your app and try to log in with facebook. A dialog will open and tell you: "the key YOURHASHKEY has not been found in the facebook developer console"
STEP 6:
Write down the key.
STEP 7:
Put it into your facebook developer console and save. Now you are done. Anyone that downloads your app, published with earlier used keystore can log into facebook.
Enjoy
The password of the debug certificate is android and not Android
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
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.
Try passing the password for the key and store as part of the command
keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore -keypass android -storepass android \
| openssl sha1 -binary \
| openssl base64