Code Monkey home page Code Monkey logo

android-sms-hash-generator's Introduction

android-sms-hash-generator

Small and effective python script to compute the android app's hash to properly configure the SMS Signup with autoverification code.

Download

Download the latest version from Releases page.

Requirements

  • JDK
  • Python3

Usage

smshash.py needs four parameters:

  • keystore: the absolute or relative path of your Android keystore
  • alias: the alias of the keystore
  • keypass: the passphrase of the keystore
  • appid: your app's package name

Example:

python3 smshash.py path/keystore MyAndroidKey xxxxxxxxxxxx com.example.myapp

For help:

python3 smshash.py -h

Please note:
On Windows, smshash.py and xxd_w.exe must be placed in the same folder.
xxd_w.exe is not used on other platforms.

Why

Google Play services uses the hash string to determine which verification messages to send to your Android app. The hash string is made of your app's package name and your app's public key certificate. According to Google documentation it can be generated with this command:

keytool -exportcert -alias MyAndroidKey -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

But that command has some issues:

  • It's not multi platform: it works fine on Linux, it could work on Mac with a small change, it does not work at all on Windows.
  • It does not emit an error if the keytool command fails and it generates the hash of the error message instead.

This python script does not have those issues, it is multi platform and if the keytool command fails (for instance because the keystore passphrase is wrong), the script stops and emit an error message.

android-sms-hash-generator's People

Contributors

cshion avatar emaori avatar francescomapelli avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.