0

I am trying to get hashkey in-order to connect my phonegap for android app with facebook by following the below 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

13) Again copy following code and paste openssl base64 -in debug_sha.txt > debug_base64.txt

14) you will get debug_base64.txt in openssl bin folder

15) open debug_base64.txt file Here is your Key hash.

But whenever i am executing step 13 i am getting error as

openssl has stopped working. A problem caused the program to stop working correctly. windows will close the program and notify you if a solution is available. Could anyone please help me out, i am quite new to this android world ...

Adi
  • 33
  • 1
  • 8

1 Answers1

0

Open your command prompt and go to the Java directory where the java keytool is located. It seems in your case that is: C:\Program Files\Java\jdk1.6.0_05\bin.

Now, in the command prompt, type:

keytool -exportcert -alias androiddebugkey -keystore [PATH TO KEYSTORE] | [PATH TO OPENSSL] sha1 -binary | [PATH TO OPENSSL] base64

Where, you should replace [PATH TO KEYSTORE] with the directory path to the android debug.keystore. For example:

C:\Users\Chris\.android\debug.keystore

And you should replace [PATH TO OPENSSL] with the directory path to the openssl application file. For example:

C:\OpenSSL-Win32\bin\openssl

Now, when you hit enter after entering the full line of code it will ask for a password, which is: android

If you have done everything successful then it will give you a string right in the command prompt that you can copy and paste and use. If it doesn't ask for a password then check the directory paths.

chRyNaN
  • 3,592
  • 5
  • 46
  • 74