我希望为我的应用程序生成一个应用程序签名,以后将与Facebook集成。在Facebook的一个教程中,我发现了这个命令:

keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64

在教程中,它说通过运行这个cmd,我的生成签名的进程将开始。

但是,这个命令会给出一个错误:

openssl is not recognized as an internal or external command

我怎样才能摆脱这个?


当前回答

IDK如果这是相关的,但如果你已经安装了Git,你可以在“C:\Program Files\Git\usr\bin”中找到openssl,这个位置你可以在终端中使用你的密钥库命令。

哦,对了,命令:

"C:\Users\YOURPATH/filename. exe -exportcert -alias keystore -keystore "C:\Program Files\Git\usr\bin\openssl" base64 . jks" | "C:\Program Files\Git\usr\bin\openssl" sha1 -二进制|

其他回答

步骤1

从https://code.google.com/archive/p/openssl-for-windows/downloads下载用于windows的SSL。

步骤2

解压文件夹到OpenSSL,并粘贴到“C:\Program Files”。

步骤3

在环境变量中添加“C:\Program Files\OpenSSL\bin”(编辑系统环境变量>环境变量> Path > New)。它将使openssl在终端中工作。

步骤4

将“C:\Program Files\Android\Android Studio\jre\bin”添加到环境变量中。它将使keytool在终端中工作。

步骤5

打开一个终端并执行:

keytool -exportcert -alias androiddebugkey -keystore .android\debug.keystore | openssl sha1 -binary | openssl base64

密码应该是android。

使用整个路径,像这样:

exportcert -alias androiddebugkey -keystore ~/.android
/debug.keystore | "C:\openssl\bin\openssl.exe" sha1 -binary | "C:\openssl\bin\op
enssl.exe" base64

这对我很管用。

对于那些像我现在一样迷路的人,请关注乌萨马·萨瓦尔的回应 但如果:

“your_openssl_path / bin / openssl.exe”

不管用,试试看

your_openssl_path / bin / openssl.exe。

没有引号。

“c:\openssl\bin\openssl.exe”=>不适合我

c:\openssl\bin\openssl.exe =>为我工作

对于那些想要安装windows二进制版本openssl(32位和64位)的人,你可以在这里找到它:

http://slproweb.com/products/Win32OpenSSL.html

提供二进制发行版的网站的最新列表在这里

http://www.openssl.org/related/binaries.html

请遵循以下步骤,我希望你的钥匙工作正常:

Step 1 You will need OpenSSL. You can download the binary from openssl-for-windows project on Google Code. Step 2 Unzip the folder, then copy the path to the bin folder to the clipboard. For example, if the file is unzipped to the location C:\Users\gaurav\openssl-0.9.8k_WIN32, then copy the path C:\Users\gaurav\openssl-0.9.8k_WIN32\bin. Step 3 Add the path to your system environment path. After your PATH environment variable is set, open the cmd and type this command: C:\>keytool -exportcert -alias androiddebugkey -keystore [path to debug.keystore] | openssl sha1 -binary | openssl base64 Type your password when prompted. If the command works, then you will be shown a key.