Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

facebook key hash, android keystore confusion

keytool -exportcert -alias mykeystore -keystore mykeystore| openssl sha1 -binary | openssl base64

hello, I am using the above command to generate my facebook key hash. It asks for my password and gives me a key hash. I put this key hash in the facebook app settings, yet it does not work for my signed android app.

When I was debugging the android app, I saw the console message saying it didn't recognize "android key hash blahblahblah" so I copied "blahblahblah" into the facebook app, and that worked - my android app was able to use the facebook stuff while in debug mode. But clearly that was only for the debug keystore. Now for the real keystore the one it generates is still wrong, so a production version of my app will not be able to use facebook api.

One thing about my keystore is that it was made in eclipse. It is one keystore with two keys in it. I have noticed that eclipse keystore acts different than command line keystore things, and that they are incompatible for signing things. Yet I have already released a version of my app so I need to make due with the keys I am already using.

Insight appreciated.

like image 499
CQM Avatar asked Dec 31 '11 06:12

CQM


2 Answers

Use keytool -list to list the aliases you have. If you are not sure which one you used to sign the APK you released, try both. One should work.

like image 193
Nikolay Elenkov Avatar answered Nov 07 '22 21:11

Nikolay Elenkov


I had this same problem - debug hash key worked but production key did not. I ended up installing OpenSSL from a different source than I originally installed, re-created the hash key, and it fixed the problem. This is the site where I got OpenSSL that worked: http://gnuwin32.sourceforge.net/packages/openssl.htm.

like image 21
alice_silver_man Avatar answered Nov 07 '22 22:11

alice_silver_man