Step 1. (Skip it if you sign your APK's directly)
First of all go to your Google Play Console and download your app signing certificate(deployment_cert.der
).
Then go to folder where you have installed your Java Jdk and open the bin folder in terminal. Then type the following command to import the app signing certificate into a temporary key store:
keytool -importcert -file deployment_cert.der -keystore temporary.keystore -alias PlayDeploymentCert
Where you must mention the full path to your app signing certificate file
.
If you get keytool command not found error, just type the following command as follows,
./keytool -importcert -file deployment_cert.der -keystore temporary.keystore -alias PlayDeploymentCert.
Step 2:
In the docs which you have mentioned above, all the steps are explained but to just get the Hash Key for your app type the following command,
keytool -exportcert -alias PlayDeploymentCert -keystore MyProductionKeys.keystore | xxd -p | tr -d "[:space:]" | echo -n com.example.myapp `cat` | sha256sum | tr -d "[:space:]-" | xxd -r -p | base64 | cut -c1-11
If you are using App Signing by Google Play and performed the Step 1 exactly I did then just type the temporary.keystore
in place of MyProductionKeys.keystore
and change the package name com.example.myapp
with your app's package name. Then press enter and you will get your Hash Key.
For those who are directly signing their APK's you need to mention the full path to your KeyStore file and Change the enter your Alias Key after -alias
and change the com.example.myapp
according to your app's package name.
Then press enter and you will get your Hash Key.
Alternatively, you can get your app's hash string with the AppSignatureHelper class from the SMS retriever sample app. However, if you use the helper class, be sure to remove it from your app after you get the hash string. Do not use hash strings dynamically computed on the client in your verification messages.