Skip to content

Instantly share code, notes, and snippets.

@pfieffer
Last active September 7, 2022 10:05
Show Gist options
  • Save pfieffer/1948df5d794a253a12afd69f95b4d116 to your computer and use it in GitHub Desktop.
Save pfieffer/1948df5d794a253a12afd69f95b4d116 to your computer and use it in GitHub Desktop.
Get key Hash for android app integration to Services like google and facebook login

To sign your apk:

https://developer.android.com/studio/publish/app-signing.html
Build and sign your app from terminal: keytool -genkey -v -keystore my-release-key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias my-alias

Facebook:

To get debug key certificate:
keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64

To get release key certificate:
keytool -exportcert -alias YOUR_RELEASE_KEY_ALIAS -keystore YOUR_RELEASE_KEY_PATH | openssl sha1 -binary | openssl base64

Google

To get debug key certificate:
keytool -exportcert -list -v \ -alias androiddebugkey -keystore ~/.android/debug.keystore

To get release key certificate
keytool -exportcert -list -v \ -alias <your-key-name> -keystore <path-to-production-keystore>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment