Quick Tip: Key Hash For Facebook Android Application in AIR

It may be a little tricky to setup “Native Android App” section for your Facebook application. Especially the field “Key Hashes”. Facebook provides instructions for acquiring debug version hash but is not very clear about how to get one for signed application. There is a lot of valid answers around the internet, but the one I needed was still missing. Imagine this simple scenario where you export and sign (using .p12 cert) your AIR Android project, you have an .apk file and want to get a key hash for facebook. Then I finally found the answer:
- Unzip .apk file and extract META-INF\CERT.RSA file
- run keytool -printcert -file CERT.RSA
- notice SHA1 bytes are printed like 29:37:F1:CB:06…
- copy SHA1 bytes into HEX to BASE64 converter
- see your BASE64 key hash in output field
Hey Jozef !
Really nice job .. I expend a a lot of time thinking about why is just working on debug ….
But i still dont know how i “Unzip .apk file” in my mac .
Can you give me a light !?
Cheers
Pedro
you can rename file.apk to file.zip and unzip, or you can setup your mac unziping tool to open .apk files for you (not sure how this is done on macs)