2011-06-01 92 views
2

花搞清楚如何簽署應用程序小時後(最後我用日食,而不是在命令行),我想創建一個關鍵哈希我的應用程序描述here。 爲此,我在C:\ Users \ Family \ workspace \ MyKeys文件夾中創建了sample.keystore和samplesigned.apk,以及keytool.exe和jli.dll。Android的Facebook的密鑰散列

在CMD.EXE我瀏覽到C:\用戶\家庭\工作區\ MyKeys當我運行此命令:

keytool -exportcert -alias samplekey -keystore sample.keystore我得到這個jibberish:enter image description here 的samplekey是在創建密鑰的別名日食:

enter image description here

我從here下載開放SSL和它安裝到C:\ Program Files文件\的GnuWin32。在命令行導航我試着這個命令:openssl -help,這導致了一個命令列表,這意味着我安裝它正確(我希望)。

現在我嘗試此代碼:

C:\Users\Family\workspace\MyKeys>keytool -exportcert -alias samplekey -keystore sample.keystore | c:\program files\gnuwin32\bin\openssl sha1 -binary | c:\program f 
iles\gnuwin32\bin\openssl base64 

錯誤:「C:\程序」沒有被識別爲一個內部或外部的命令, 運行的程序或批處理文件。

我還添加了C:\ Program Files文件\的GnuWin32 \ bin添加到環境變量PATH中。

我有點失落。

+0

看看這裏http://stackoverflow.com/questions/4388992/key-hash-for-android-facebook-app/17732453#17732453 – Shahar 2016-03-21 13:37:51

回答

5

您需要引用您的命令中的路徑,否則它將在第一空間中斷開(即 C:\Users\Family\workspace\MyKeys>keytool -exportcert -alias samplekey -keystore sample.keystore | "c:\program files\gnuwin32\bin\openssl" sha1 -binary | "c:\program f iles\gnuwin32\bin\openssl" base64)。

不確定的,如果這是真正的問題,但嘗試。

+0

感謝我的答案!我不知道爲什麼我沒有嘗試過...... – erdomester 2011-06-01 12:11:51