Gets the MD5, SHA1 and SHA256 of a keystore. You’ll need this for many signin solutions, such as Google SignIn, Facebook, Twitter, etc.
Android Studio
Using Android Studio is the easiest, simply execute this gradle task from the Gradle panel: Project name > Tasks > android > signingReport. It will give you all the signatures of all the configurations, so debug and release.
Command line
Basic example, which will request password and alias where needed:
# Make sure you have the store password ready
keytool -list -v -keystore <filename>
You can also pass the extra parameters -alias
, -storepass
and -keypass
.
With the debug keystore, this looks like:
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
Facebook desires a Base64 encoded hash of you keystore. Generate it so:
keytool -exportcert -keystore <filename> -alias <alias> | openssl sha1 -binary | openssl base64
Troubleshooting
On Windows, the right JDK tools are often not in the PATH.
Navigate to the \bin
folder of the JDK first, usually something like:
C:\Program Files\Java\jdk1.8.0_<minor>\bin
Also, the path to your debug key will look like %USERPROFILE%
.
cd C:\Program Files\Java\jdk1.8.0_<minor>\bin
keytool -list -v -keystore %USERPROFILE%/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android