DEV Community

Discussion on: How to generate 11 char hash key for Sms Retriever?

 
jyotishman profile image
Jyotishman Saikia • Edited

Have you built your app using a signed key? If not you can generate your Keystore using the Android studio just with some clicks.
If you have already generated your Keystore than you can use the below command to generate your 11 digits unique hash key.

keytool -exportcert -alias my_alias -keystore path_to_my_keystore | xxd -p | tr -d "[:space:]" | echo -n my_app_package_name `cat` | shasum -a 256 | tr -d "[:space:]-" | xxd -r -p | base64 | cut -c1-11

Replace

my_alias with your alias name, path_to_my_keystore to the exact path of Keystore file and my_app_package_name with your application package name, eg- com.example

Finally, enter the password and 11 digit unique hash will be generated.

Thread Thread
 
iampapagray profile image
John Graham

After entering the password, nothing happens. No response and the prompt isn't returned. It seems its just stuck

Thread Thread
 
appi2393 profile image
Apurva Jain

keytool -exportcert -alias my_alias -keystore path_to_my_keystore | xxd -p | tr -d "[:space:]" | echo -n my_app_package_name 'cat' | shasum -a 256 | tr -d "[:space:]-" | xxd -r -p | base64 | cut -c1-11

Should work fine with above command. cat replaced with 'cat'