Android debug Facebook key hash automation?

Currently I use the following manual process to get the new Key Hash for my debug builds from Bitrise:

  1. Download APK
  2. Open Terminal to directory with downloaded APK
  3. keytool -list -printcert -jarfile app-debug.apk
  4. Copy the SHA1 fingerprint (e.g. CD:A1:EA:A3:5C:5C:68:FB:FA:0A:6B:E5:5A:72:64:DD:26:8D:44:84)
  5. Past the SHA1 fingerprint in this online Hex to base64 tool
  6. Click ‘Convert’
  7. Copy the ‘Output (base64)’ value (e.g. ********************=)
  8. Past the base64 value into the app Facebook Settings page
  9. Click ‘Save’

This then allows the debug build to work. My question is this. Is there a better/automated way to do this?

Hi @Development_Vampr,
thanks for the question.

If you would sign your apk with your release keystore (instead of generating debug signed apk), then you can get your release key hash as described here: https://developers.facebook.com/docs/android/getting-started#.

So using the release keystore, you just read its hash on your local machine, provide it to your facebook project and build your apk using this keystore.

2 Likes

Fantastic solution. Thanks very much.

1 Like