Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Key Hash

Tags:

android

Hi friends i wanna to generate Key hash to incorporate FaceBook Application in my Apps.. I am having Open SSL Zip. pl guide me how to generate key..

like image 873
VenkateshRaghavan Avatar asked Jan 04 '11 14:01

VenkateshRaghavan


People also ask

What is android key hash?

The key hash is a machine specific security check for authenticity. If you use multiple machines for development of the application, you need to add and save multiple key hash to your profile to authenticate every machine.

Where can I find key hashes?

Click "Show Advanced Settings", and in the "Device Settings" tab, under "Android", fill the "App Package Name" with your application's package name, and the "Key Hashes" field with the SHA256 value you copied.

What is Facebook hash key?

Facebook uses the key hash to authenticate interactions between your app and the Facebook app. If you run apps that use Facebook Login, you need to add your Android development key hash to your Facebook developer profile.


2 Answers

Type this in your terminal (mac)

keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64 

Or this into the console (windows)

keytool -exportcert -alias androiddebugkey -keystore %HOMEPATH%\.android\debug.keystore | openssl sha1 -binary | openssl base64 

You will have to enter a password. The password is: android

A code will come up and that code is your key hash.

like image 193
SirRupertIII Avatar answered Oct 05 '22 04:10

SirRupertIII


In order to generate key hash you need to follow some easy steps.

  1. Download Openssl from: http://code.google.com/p/openssl-for-windows/downloads/list

  2. Make a openssl folder in C drive

  3. Extract Zip files into openssl folder

  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 code and hit enter

    keytool -exportcert -alias androiddebugkey -keystore debug.keystore > c:\openssl\bin\debug.txt 
  7. Now you need to enter password, Password = android.

  8. 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. comes to C drive and give the path of openssl Bin folder

  11. copy the following code and paste openssl sha1 -binary debug.txt > debug_sha.txt

  12. you will get debug_sha.txt in openssl bin folder

like image 35
Vijay Kumar Avatar answered Oct 05 '22 04:10

Vijay Kumar