Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Facebook SDK: How to generate a non-debug hash key?

So, I know how to generate the debug hash key with the password of android. I know that for each new device, I need to generate (and upload to facebook) the new hash key.

Now, I am not yet ready to actually be in production, but I'd like to distribute the app to a set of testers that would prefer not to generate hash things on their own. I see references to a non debug hash key:

Next, you will need to generate a Key Hash for the application. For debugging, if using Eclipse, you will want to generate this Key Hash using the Android debug key. When you are ready to publish your app, you will need to generate a Key Hash for your signing keys and update this value in Facebook before your signed app will work.

http://www.techrepublic.com/blog/app-builder/integrate-facebook-logins-in-your-android-app/296

How do you generate this? I've never made a production (signed) app before, is this something to do with that? Is there a downside to signing my app before its done? If it's not, what do I do to let any device run this app with facebook connectivity?

like image 776
J.R. Avatar asked Jan 31 '13 20:01

J.R.


People also ask

How do I get a key hash on Facebook?

Go to the Facebook Developer site. Log into Facebook and, using the dropdown menu in the top-right, go to Developer Settings: In your developer settings, select Sample App from the menu, and add and save your key hash into your profile: You can add multiple key hashes if you develop with multiple machines.

How do I configure APP key hashes on Facebook?

Steps : Go to facebook developer's page : https://developers.facebook.com/ Open the App tabs and than click the Setting. Paste the generate hashkey on HashKey's field = If you don't have it yet, get your key hash part of code.


1 Answers

You can easily generate an own key to sign your application in release mode. See the Android documentation for detailed information: Signing in Release Mode.

Keystore generation example:

$ keytool -genkey -v -keystore my-release-key.keystore
  -alias alias_name -keyalg RSA -keysize 2048 -validity 10000

Then generate the hash for Facebook as you did with the debug key:

$ keytool -exportcert -alias alias_name -keystore my-release-key.keystore
  | openssl sha1 -binary | openssl base64

And finally share your signed apk with your group of testers, that's all.

like image 154
ottel142 Avatar answered Nov 10 '22 01:11

ottel142