JAVA - Android - getting hash key for Facebook Integration

I am trying to implement Facebook into my app to allow things like sending stuff to the user's wall, updating status', etc.

So after downloading the stuff I was told to get a key using the keystore file. I decided to be brave and create my own keystore file (for publishing stuff later) and did so successfully.

After creating the file though I am having all sorts of problems trying to retreieve a key from it, i entered the command via keytool/command prompt and it asked me for my keystore password...

After entering the password i set in the first place, I am getting nothing but wierd ascii symbols and letters and my keystore details also in the middle of it. What is going wrong??

UPDATE: Ok, I am aware you may need to use OpenSSL to display the text correctly. I have installed OpenSSL but how do I use it to get the Hash code?

This question and answers originated from www.stackoverflow.com
Question by (2/16/2011 11:14:26 AM)

Answer

I always use this method under Linux, because it fails in the original way:

keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore > key.out
cat key.out | openssl sha1 -binary > key.bin
cat key.bin | openssl base64

You will get the key you need to enter on page mobile, android section of your Facebook apllication. Every time you use different keytore to sign your app, you need to change the key on the facebook page also.

Answer by

Find More Answers
Related Topics  java  android  facebook  sdk  keystore
Related Questions
  • Key hash for Facebook Android SDK

    I'm very sorry to be asking you but I can't figure out how to get the Key Hash required to use the Facebook Android SDK. I am very new at this and figured out that i can use keytool with these comma…
  • Why should I use debug.keystore when generate facebook hash key for android?

    I have seen some examples that use ~/.android/debug.keystore for generating the facebook hash key for android. Is this correct? Or should I use the keystore that I use to sign my apk?
  • key hash for android-facebook app

    I m working on Android app, in which I want to integrate facebook posting feature, i downloaded the facebook-android-sdk and I got readme.md(text file) in there, in which it is mentioned to generate…
  • Facebook Android Generate Key Hash

    Hey I'm trying to create an android app with Facebook integration, I've gotten to the part in the docs where you have to generate a key hash file, it specifies to run the following code keytool -…
  • Android facebook key hash

    after spending hours of figuring out how to sign an app (at last i used eclipse, and not the command line), i want to create a key hash to my app described here . For this i have in the C:\Users\Fam…
  • Trying to generate key hash for Android Facebook with keytool

    So I am trying to get a hash so Facebook can use SSO with my android app, but I am having an issue. so I run this: keytool -exportcert -alias statusp -keystore my-release-key.keystore | openss…
  • How to create Android Facebook Key Hash?

    I do not understand this process at all. I have been able to navigate to the folder containing the keytool in the Java sdk. Although I keep getting the error openssl not recognised as an internal or…
  • try to obtain the hash key on MAC for integrating facebook in my Android app

    If someone has ever done this-obtained the hash key using the key tool on MAC please tell how u did it cause I'm pulling my hair out here. Here is what I did: First I found out that I should t…
  • Generating Facebook SDK's Key Hash for Android app in Amazon AppStore

    I'm publishing an Android app at Amazon AppStore and doubted about integration with Facebook. The instructions on Facebook's site are very clear in case if I'm using just my certificate to sign a…
  • Facebook Android Invalid Key

    When i try to implement Facebook Connect in my android application i get the following error 11-02 16:41:31.660: D/Facebook-authorize(13194): Login failed: invalid_key:Android key mismatch. Y…