Reputation: 1002
A lot of these questions were asked. but none worked for me.
Question:
I was able to get the correct key using AppSignatureHelper.java in debug mode and all working as expected. And I've published my app on play store and used the same class on signed apk to retrieve HASH key but it's not working. I tried all other ways mentioned in a lot previous questions like this. and below code using keystore:
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
None of them working in the published app. SMS simply not reading!! Any help would be appreciated.
Upvotes: 2
Views: 1316
Reputation: 7240
You should get the hash key from the keystore file not from AppSignatureHelper class ...
Google in its documentation mentioned it officially "If you use the helper class, be sure to remove it from your app after you get the hash string"
So generate the hash key from the keystore file ...
Check this on how to generate the Hash String : Computing your app hash string
Note : If you use app signing by Google Play, download your app signing certificate (deployment_cert.der) from the App signing section of the Google Play console.
Then, import the app signing certificate into a temporary key store
Upvotes: 1