0

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.

Steve Vinoski
  • 19,847
  • 3
  • 31
  • 46
wasim.shariff
  • 607
  • 1
  • 7
  • 14
  • 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 Answers3

4

First publish app on play store then do these steps :

  1. Go to Release management in developer console.
  2. Click on App signing.

I have added an example you can check in below SS.

enter image description here

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. enter image description here

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

Abhinav Gupta
  • 2,225
  • 1
  • 14
  • 30
0

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

wasim.shariff
  • 607
  • 1
  • 7
  • 14
0

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