2011-06-01 91 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