Skip to content

Generate android app hash key

Akshay Kumar edited this page Jun 24, 2019 · 7 revisions

Run this command on the directory where testpress_JSK_key.jks file should be present. Put app package name in place of YOUR_PACKAGE. After running the command you will be asked for the password for jks file.

keytool -exportcert -alias YOUR_ALIAS -keystore testpress_JSK_key.jks | xxd -p | tr -d "[:space:]" | echo -n YOUR_PACKAGE `cat` | sha256sum | tr -d "[:space:]-" | xxd -r -p | base64 | cut -c1-11

Mac user
Install coreutils brew install coreutils

keytool -exportcert -alias YOUR_ALIAS -keystore testpress_JSK_key.jks | xxd -p | tr -d "[:space:]" | echo -n YOUR_PACKAGE `cat` | shasum -a 256 | tr -d "[:space:]-" | xxd -r -p | base64 | cut -c1-11

above command can silently fail without any warning and giving an invalid hash key. Make sure it's generating the correct hash key only.

Add this key in institute setting the field for Android app hash key. This will allow detecting OTP from SMS at the time of registration automatically.