0

Possible Duplicate:
Facebook Android Generate Key Hash

I'm trying to obtain a hash key for using facebook with my android application. I downloaded openssl and put it in java\jre7\bin

Here what I type in the console

C:\Program Files (x86)\Java\jre7\bin>keytool -exportcert -alias androiddebugkey
-keystore C:\Users\morgane\.android\debug.keystore ¦ C:\Program Files (x8
6)\Java\jre7\bin\openssl.exe sha1 -binary ¦ openssl base64

I have this error:

Illegal option: ª
keytool -exportcert [OPTION]...

I don't know what the character ª means and how to fix my error.

By the way is the key necessary to make fb works with an android app?

Community
  • 1
  • 1
morg
  • 1,173
  • 4
  • 18
  • 36
  • You're going to have to put the `"C:\Program Files (x8 6)\Java\jre7\bin\openssl.exe"` bit in quotes for the shell to accept it. You're in that directory aren't you - why not just `openssl.exe`? – Rup Jan 25 '13 at 11:57
  • ... and if you're having trouble with the whole sequence of commands why not try writing the output to disk at each step rather than trying to pipe it all together? – Rup Jan 25 '13 at 11:58
  • tried just with openssl instead of the entire address, still have the same error ? – morg Jan 25 '13 at 12:01
  • OK, try doing the parts separately: `keytool -exportcert -alias androiddebugkey -keystore C:\Users\morgane\.android\debug.keystore > cert.txt` then `openssl.exe sha1 -binary < cert.txt > cert-sha1.bin` and finally `openssl.exe base64 < cert-sha1.bin` to see where the error really is. (You may need to change the intermediate step paths to somewhere writeable if you're not running as an admin user.) – Rup Jan 25 '13 at 12:16
  • Yes, I have Access denied for the 1st part. I should change the debug.keystore's path? – morg Jan 25 '13 at 12:22
  • 2
    No, the `>cert` part: e.g. `keytool -exportcert -alias androiddebugkey -keystore C:\Users\morgane\.android\debug.keystore > C:\Users\morgane\.android\cert.txt`, `openssl.exe sha1 -binary < C:\Users\morgane\.android\cert.txt > C:\Users\morgane\.android\cert-sha1.bin`, `openssl.exe base64 < C:\Users\morgane\.android\cert-sha1.bin` – Rup Jan 25 '13 at 13:12

1 Answers1

0

My bet would be that it's the pipe character which is not recognized by cmd.exe and instead passed to keytool as an argument, which causes the error from keytool. Try typing the pipe character yourself on the keyboard if you copy/pasted it from somewhere.

Daniel Roethlisberger
  • 6,958
  • 2
  • 41
  • 59