Transferred from: http://www.dotblogs.com.tw/newmonkey48/archive/2014/04/17/144779.aspx
App to use Facebook to share, set the app's key hash in the Facebook app
But how is keyhash going to get it?
Two sites can be tested
Http://blog.changyy.org/2011/05/android-facebook-sdk.html
http://blog.rx836.tw/blog/android-facebook-key-hashes/
Need to download OpenSSL
http://blog.rx836.tw/blog/android-facebook-key-hashes/
After downloading, decompress, as below, to the bottom of the bin material to obtain Openssl.exe
C:\Users\Tom\Downloads\openssl-0.9.8h-1-bin\bin
Put it in the Java catalogue below
C:\Program Files\java\jdk1.6.0_23\bin
and get keystore placement from eclipse.
[WINDPW], [Preferences], [Android], [Build] Default debug KeyStore
What I have got here is
C:\Users\Tom\.android\debug.keystore
Then use the Keytool under Java bin to get Keyhash
Make the following command
Keytool-exportcert-alias Androiddebugkey-keystore C:\Users\Tom\.android\debug.keystore | OpenSSL sha1-binary | OpenSSL base64
will display the following and enter the preset password for Android
Enter KeyStore Password: Android
You'll get Keyhash.
And then to the Facebook---management application----your own application----the key hash is filled in with the keyhash.
Debug.keystore's preset information is as follows
Keystore Name: "Debug.keystore"
Keystore Password: "Android"
Key alias: "Androiddebugkey"
Key Password: "Android"
CN: "Cn=android debug,o=android,c=us"
So the password only fills Android
Attention:
The alias and password that cannot be played will affect the results of keyhash, and must be the same as the alias and password at the time.
Mac Platform
- First open a terminal (open a command prompt in Windows).
- Navigate in the terminal to the directory where your Android debug.keystore is stored.
- Mostly It'll located under "/users/user_name/.android/" (in Windows would be C:\Documents and settings\.android).
Once you is in the ". Android" directory, run the following command.
Keytool-exportcert-alias Androiddebugkey-keystore Debug.keystore | OpenSSL sha1-binary | OpenSSL base64
When it prompts to a password, type android and hit Enter
Copy the value printed in the terminal, which ends with a "=" and paste it in the Key Hash field in Facebook. Then click the Save Changes button.
Android-facebook Keyhash Set