Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generate a key hash for Facebook apps in Android

On https://developers.facebook.com/docs/android/getting-started/facebook-sdk-for-android/ we show how to get the key hash but i don't know what i can to do with" keytool -exportcert -alias androiddebugkey -keystore %HOMEPATH%.android\debug.keystore | openssl sha1 -binary | openssl base64". On the website we talk about Java's keytool utility but i don't know what is it? Please I want to create my facebook app for android i don't know how all of this work. I need someone to help me step by step. Thanks you for Advance.

like image 637
Ange Bagui Avatar asked Oct 27 '13 14:10

Ange Bagui


People also ask

What is key hash in Android?

You will have to enter a password. The password is: android. A code will come up and that code is your key hash. Follow this answer to receive notifications.


1 Answers

Keytool is part of Java JDK. The keytool command you mentioned will output a base64, sha1 encrypted representation of your debug key. Your app is signed with this debug key each time you compile it. Facebook uses this key to verify that your computer compiled the app. So in the Facebook Manage App interface, you would put the output of the keytool command.

If you run into trouble running the command, it has most likely to do with incorrect paths. Try:

"C:\Program Files\Java\jdk1.6.0_33\bin\keytool.exe" -exportcert -alias androiddebugkey -keystore %HOMEPATH%\.android\debug.keystore | "C:\Users\A\Downloads\openssl-0.9.8h-1-bin\bin\openssl.exe" sha1 -binary | "C:\Users\A\Downloads\openssl-0.9.8h-1-bin\bin\openssl.exe" base64

Where you change the paths in quotes to the paths of openssl.exe and keytool.exe on your computer. (You might have to download openssl first)

like image 118
ln e Avatar answered Sep 29 '22 17:09

ln e