Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
123 views
in Technique[技术] by (71.8m points)

android - Find the key hash for a signed app

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 the facebook developers page. i have openssl installed but cant seem to generate the key hash ive tried many other threads on stack and none have seemed to help, thanks

James

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
  1. You should know where is your keystore file. For me is C:UsersSelvinDesktopselvin.kp
  2. You should know your alias in keystore. For me is selvin
  3. You should know path to keytool. C:Program FilesJavajdk1.6.0_22inkeytool.exe
  4. You should know path to openssl. C:OpenSSL-Win32inopenssl.exe
  5. You should know password to keystore. For me is ***** hehe

Then, you should call:

C:Program FilesJavajdk1.6.0_22inkeytool.exe" -exportcert -alias selvin -keystore c:usersselvindesktopselvin.kp | C:OpenSSL-Win32inopenssl sha1 -binary | C:OpenSSL-Win32inopenssl 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 FilesJavajdk1.6.0_22inkeytool.exe" -exportcert -alias selvin -keystore c:usersselvindesktopselvin.kp

Type password and read the error

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

For a list of all your entries/aliases:

C:Program FilesJavajdk1.6.0_22inkeytool.exe -list -keystore c:usersselvindesktopselvin.kp

second edit

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...