我希望为我的应用程序生成一个应用程序签名,以后将与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
我怎样才能摆脱这个?
Steps to create Hash Key.
1: Download openssl from Openssl for Windows . I downloaded the Win64 version
2:Unzip and copy all the files in the bin folder including openssl.exe(All file of bin folder)
3:Goto to the folder where you installed JDK for me it’s C:\Program Files\Java\jdk1.8.0_05\bin
4:Paste all the files you copied from Openssl’s bin folder to the Jdk folder.
然后进入C:\Program Files\Java\ jdk1.8.0_05\bin,按shift键,右键单击并打开cmd
C:\Program Files\Java\jdk1.8.0_05\bin>//cmd path
这是给Sha1的
"C:\User\ABC\.android. keytool -exportcert -alias androiddebugkey -keystore "Keystore " | openssl sha1 -binary | openssl base64 . Keystore
//和ABC是系统名放置自己的系统名
首先在cmd中导航到Java/jre/bin文件夹
cd c:\Program Files (x86)\Java\jre7\bin
然后使用:[change debug。]到系统上正确位置的密钥库路径]
安装openssl(适用于Windows 32或64,根据您的需要在c:\openssl)
keytool -exportcert -alias androiddebugkey -keystore "C:\Users\vibhor\.android\debug.keystore" | "c:\openssl\bin\openssl.exe" sha1 -binary | "c:\openssl\bin\openssl.exe" base64
因此整个命令是这样的:[提示在执行时输入密钥库密码]
c:\Program Files (x86)\Java\jre7\bin>keytool -exportcert -alias androiddebugkey
-keystore "C:\Users\vibhor\.android\debug.keystore" | "c:\openssl\bin\openssl.ex
e" sha1 -binary | "c:\openssl\bin\openssl.exe" base64
Enter keystore password:
Steps to create Hash Key.
1: Download openssl from Openssl for Windows . I downloaded the Win64 version
2:Unzip and copy all the files in the bin folder including openssl.exe(All file of bin folder)
3:Goto to the folder where you installed JDK for me it’s C:\Program Files\Java\jdk1.8.0_05\bin
4:Paste all the files you copied from Openssl’s bin folder to the Jdk folder.
然后进入C:\Program Files\Java\ jdk1.8.0_05\bin,按shift键,右键单击并打开cmd
C:\Program Files\Java\jdk1.8.0_05\bin>//cmd path
这是给Sha1的
"C:\User\ABC\.android. keytool -exportcert -alias androiddebugkey -keystore "Keystore " | openssl sha1 -binary | openssl base64 . Keystore
//和ABC是系统名放置自己的系统名
我今天也遇到了同样的问题,通过以下视频(SSL安装)解决了它- https://www.youtube.com/watch?v=PoAc1lpfK8I&ab_channel=GleyGames
然后,我使用Usamas命令,并运行它(在命令中更改路径后),我从java安装中的bin文件夹中运行它,使用CMD。
对我有效的全面命令:
(来自C:\Program Files\Java\ jdk-11.0.12\bin):
keytool -exportcert -alias androiddebugkey -keystore "C:\Users\USERNAME\.android\debug.keystore" | "C:\Program Files\OpenSSL-Win64\bin\openssl" sha1 -binary | "C:\Program Files\OpenSSL-Win64\bin\openssl" base64