2

I am trying to get hash key for facebook (Native Android App) login using following command

C:\Program Files\Java\jre6\bin>keytool -exportcert -alias androiddebugkey -keystore "C:\Users\Combitech\.android\debug.keystore"

I have entered password "android" but instead of hash key i got some output like follow

☺☺♂♣ 071♂0      ♠♥U♦♠‼☻US1►0♫♠♥U♦
431004061248Z071♂0      ♠♥U♦♠‼☻US1►0♫♠♥U♦
☺☺☺♣ ♥é☺☼ 0é☺0é☺"0
☺☺♂♣ ♥é☺☺ I$F╠≥C½?k½~U▬éïP▄ûπ^?╢Äïï▲D╓♣╥h☺⌡═Æ╠■≥        ,♦Wm#≥W▓♦↓┴1¡┼╩ú♀⌠,-62º ═V¶■‼   ûªE¢⌂φg╢çpSúuαΩ√:ôp∩<û╕úxj↓╠G♠=↔x ╥s0²↓¬}é←êR╜s╜↓■6║/6HεC≥Éq1J═α┐3í2PU╓i-←ë¿Φαπ°Åφε÷àX░R‼   ☺Lje      -w╘²L▲♣╧♦'7←âDτ╜
╤Ω▲£6uü░K■o↕ö§q┼6▌⌂(≡}º3EC┴bo>√ßS─▌a«¼╡τ▐ïñºñ¢._w]¥±▒0'σ√»?oÄ╙⌠X»C█2â1)√7zod

Any one have any idea how to solve this issue.

2
  • Do you want to get the SHA1,MD5 keys ? Commented Nov 20, 2013 at 10:25
  • I want to get Key Hashes for Native Android App. Commented Nov 20, 2013 at 10:27

5 Answers 5

1

To show the SHA1 hash (you need for Google APIs) and all other hashes use this command instead:

keytool -list -v -keystore "C:\Users\Combitech\.android\debug.keystore"
Sign up to request clarification or add additional context in comments.

1 Comment

for anyone on a Mac the path to the Android debug keystore is ~/.android/debug.keystore
1

The command you are looking for may be:

"C:\Program Files\Java\jdk1.6.0_22\bin\keytool.exe" -exportcert -alias androiddebugkey -keystore "C:\Users\Combitech\.android\debug.keystore" | C:\OpenSSL-Win32\bin\openssl sha1 -binary | C:\OpenSSL-Win32\bin\openssl base64

Tips:

  • Better use full path of keytool.exe location and also full path of openssl.
  • Do not forget to change the keystore path with your path "C:\Users\Combitech\.android\debug.keystore"

More info here

1 Comment

fixed with your keystore alias and pathfilename
0

You can get both MD5 fingerprint and SHA1 fingerprint from your eclipse itself. Try this :

Windows > Preferences > Android > Build

Note that there will be two different keys one will be default and another for your custom keystore used for app development.

Comments

0

Try out as below. And also make sure you debug keystore file is correct.

You should add '-v' to your keytool command. A -v to your command will get fingerprints in MD5, SHA1 and SHA256.

 keytool -list -v -keystore C:\Users\Combitech\.android\debug.keystore

You don't need to add the double quotes on the debug.keystore file path.

Comments

0

try this code.It will return hash key in your log cat. and dont forget to change the package name

try {
            PackageInfo info = context.getPackageManager().getPackageInfo(
                    "com.example.package", PackageManager.GET_SIGNATURES); //Your package name here
            for (Signature signature : info.signatures) {
                MessageDigest md = MessageDigest.getInstance("SHA");
                md.update(signature.toByteArray());
                Log.v("KeyHash:", Base64.encodeToString(md.digest(), Base64.DEFAULT));
                }
        } catch (NameNotFoundException e) {
        } catch (NoSuchAlgorithmException e) {
        }

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.