Key hash for Facebook Android SDK
Solution 1:
You can install Open SSL from here , that should make your command work
Solution 2:
I created a batch script facebookkeydebug.bat, which return desired Facebook key hash. Just edit the script, set correct paths, keystore name and run it.
:: Getting Android key hash for Facebook app on Windows
:: Requirement: OpenSSL for Windows (http://code.google.com/p/openssl-for-windows/downloads/list)
:: Usage: set paths and run facebookkeydebug.bat
@echo Exporting keystore cert
keytool -exportcert -alias androiddebugkey -keystore C:\Users\myusername\.android\debug.keystore -storepass android -keypass android > debug.keystore.bin
@echo Converting to sha1
C:\PROGRAMS\openssl-0.9.8k_X64\bin\openssl sha1 -binary debug.keystore.bin > debug.keystore.sha1
@echo Converting to base64
C:\PROGRAMS\openssl-0.9.8k_X64\bin\openssl base64 -in debug.keystore.sha1 -out debug.keystore.base64
@echo Done, Android hash key for Facebook app is:
C:\PROGRAMS\openssl-0.9.8k_X64\bin\openssl base64 -in debug.keystore.sha1
@pause
EDIT: I published a repo with some batch scripts for signing and getting cert keys on Windows: https://github.com/petrnohejl/Android-Scripts
Solution 3:
- Download and install OpenSSL from http://slproweb.com/products/Win32OpenSSL.html based on windows 32 or 64 bit.(Note: Download and install first visual C++ 208 redisributable from that site also )
- Put the bin directory of installed OpenSSL in windows path.
- Open the command prompt and go to C:\Users{User_Name}.android
- now put this command on cmd "keytool -exportcert -alias androiddebugkey -keystore debug.keystore | openssl sha1 -binary | openssl base64".(refer https://developers.facebook.com/docs/android/getting-started#samples)
- Now enter password "facebook" without double quote.
- Now a hash key will be generated
- Finally go to the Facebook Developer site. Make sure you are logged into Facebook and, using the dropdown menu in the top-right, go to your 'Developer Settings':
- Once you're in your developer settings, select 'Sample App' from the navigation on the left, and add and save your key hash into your profile: