Find the key hash for a signed app

前端 未结 7 1539
隐瞒了意图╮
隐瞒了意图╮ 2020-11-29 17:31

I have signed my app and exported it to a folder on my desktop called app in this folder is my app itself and the keystore. How do i find the key hash that i can copy into t

7条回答
  •  伪装坚强ぢ
    2020-11-29 18:09

    1. You should know where is your keystore file. For me is C:\Users\Selvin\Desktop\selvin.kp
    2. You should know your alias in keystore. For me is selvin
    3. You should know path to keytool. C:\Program Files\Java\jdk1.6.0_22\bin\keytool.exe
    4. You should know path to openssl. C:\OpenSSL-Win32\bin\openssl.exe
    5. You should know password to keystore. For me is ***** hehe

    Then, you should call:

    C:\Program Files\Java\jdk1.6.0_22\bin\keytool.exe" -exportcert -alias selvin -keystore c:\users\selvin\desktop\selvin.kp | C:\OpenSSL-Win32\bin\openssl sha1 -binary | C:\OpenSSL-Win32\bin\openssl base64

    Replace my path and alias with proper ones.

    Then you should see:

    Enter keystore password:

    Enter your password and you should get something like this: NfhDlIH7XWJzUZRjL+pZySrMX1Q=

    EDITED: NfgDlIG7XWJzUZRUL+bZySrMX1Q= <- is a bad hash. Or you got so lucky that your key made the same collision as

    error:keytool error: java.lang.Exception: Alias does not exist

    If hash not working:

    First, call

    C:\Program Files\Java\jdk1.6.0_22\bin\keytool.exe" -exportcert -alias selvin -keystore c:\users\selvin\desktop\selvin.kp

    Type password and read the error

    If you don't remember your alias keytool error: java.lang.Exception: Alias does not exist I used selvinn to show error.

    For a list of all your entries/aliases:

    C:\Program Files\Java\jdk1.6.0_22\bin\keytool.exe -list -keystore c:\users\selvin\desktop\selvin.kp

    second edit

    enter image description here

提交回复
热议问题