I generated Hash from AppSignatureHelper class which works for debug build, same didn't work for release build, so I generated a hash using keystore and alias using command https://developers.google.com/identity/sms-retriever/verify#computing_your_apps_hash_string and updated to SMS text, this too didn't work.
-
Possible duplicate of [How to generate 11 char hash key for Sms Retriever with Google App signing](https://stackoverflow.com/questions/51365778/how-to-generate-11-char-hash-key-for-sms-retriever-with-google-app-signing) – Sayan Mukherjee Mar 27 '19 at 05:50
3 Answers
First publish app on play store then do these steps :
- Go to Release management in developer console.
- Click on App signing.
I have added an example you can check in below SS.
EDIT 1:-
Steps for Release Hashkey:
- Download Openssl (Download from here), I have downloaded for 64 bit OS, you can find more here
- Extract downloaded zip file to C:\ drive only
- Open command prompt
keytool -exportcert -alias **myaliasname** -keystore **"C:\Users\hiren.patel\Desktop\mykeystore.jks"** | "C:\openssl-0.9.8e_X64\bin\openssl.exe" sha1 -binary | "C:\openssl-0.9.8e_X64\bin\openssl.exe" base64
Kindly change Alias Name and Keystore with it's path as your requirement.
Note:
Please put your details where I have marked between ** **.Terminal would ask for Password of Keystore. You have to provide password for the same Keystore.
So finally you would get the Release Hashkey.
Done
EDIT 2:
Use this command in linux :
echo 33:4E:48:84:19:50:3A:1F:63:A6:0F:F6:A1:C2:31:E5:01:38:55:2E | xxd -r -p | openssl base64
if you don't have linux OS then you can do this online : using this link :
https://rextester.com/l/bash_online_compiler
Note : USE API SIGNING KEY FROM DEVELOPER CONSOLE.
Edit 3:
Try generating hash without alias for Google APK Sign Enabled
i.e
keytool -exportcert -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
NOTE : SHA-256 certificate fingerprint, take this from developer console

- 2,225
- 1
- 14
- 30
-
-
-
this will not give 11 digit character which is required to be added to SMS text right? let me get first 11 character of encoded hash and try – wasim.shariff Jan 16 '19 at 12:19
-
i tried with first 11 characters of the hash obtained by generating using online compiler, it didn't help. – wasim.shariff Jan 16 '19 at 12:41
-
Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/186787/discussion-between-wasim-and-abhinav-gupta). – wasim.shariff Jan 16 '19 at 13:18
Finally this solved my problem How to generate 11 char hash key for Sms Retriever with Google App signing
The solution mentioned by @farhan in his question helped

- 607
- 1
- 7
- 14
Finally I have found solution for SMS retriever api wont read OTP from SMS automatically in release build using below script.
download this file https://github.com/michalbrz/sms-retriever-hash-generator/blob/master/google_play_sign.rb
Change this code in script
--package NAME Your app package, e.g com.test.app
--google-play-key KEY_PATH Google Play public key (in DER format) used to sign release app
--keystore KEYSTORE_PATH Path to keystore (.jks file)
--keystore-password PASSWORD Password to the keystore - required only when option "--keystore" is specified
--key-alias KEY_ALIAS Alias of key in the keystore - required only when option "--keystore" is specified
Then run below command
ruby google_play_sign.rb --package com.your.app --google-play-key deployment_cert.der

- 304
- 2
- 11