Hemendra  Khatik
Hemendra Khatik

Reputation: 481

unable to get 11 character long hash string for my android app

Docs Google's docs is not clear can someone please help me in this I already searched a lot no one is giving proper explanation about it. I've marked over lines which are making me confuse... like where to append the hex sting where to write the fuckin command they didn't mentioned and they said compute the sha-256 sum of the combined string but how??? at last they give you one more command by saying you will get the 11 characters long hash which is working fine but I'm getting wrong hash key again.

I need proper explanation of this docs many people are searching for this already it will help them as well

enter image description here

Upvotes: 2

Views: 901

Answers (1)

Vaibhav Goyal
Vaibhav Goyal

Reputation: 1972

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.

Upvotes: 0

Related Questions