我正在开发一个Android应用程序,我想在其中集成一个Facebook 发布功能。我下载了Facebook-Android SDK,然后 readme。Md(文本文件)在那里,其中提到要生成 Android的键散列。我如何生成它?


当前回答

以下是步骤

Download openssl from Google code (If you have a 64 bit machine you must download openssl-0.9.8e X64 not the latest version) Extract it. create a folder- OpenSSL in C:/ and copy the extracted code here. detect debug.keystore file path. If u didn't find, then do a search in C:/ and use the Path in the command in next step. detect your keytool.exe path and go to that dir/ in command prompt and run this command in 1 line- $ keytool -exportcert -alias androiddebugkey -keystore "C:\Documents and Settings\Administrator.android\debug.keystore" | "C:\OpenSSL\bin\openssl" sha1 -binary |"C:\OpenSSL\bin\openssl" base64 it will ask for password, put android that's all. u will get a key-hash

欲了解更多信息,请访问这里

其他回答

我已经这样做了Linux操作系统和Windows操作系统:

Linux:

下载Openssl 打开终端 keytool -exportcert -alias **myaliasname** -keystore **/home/comp-1/Desktop/mykeystore. xmlJks ** | openssl sha1 -binary | openssl base64

请更改别名和Keystore与它的路径作为您的要求。

终端将询问密钥库的密码。您必须为相同的密钥存储库提供密码。

最后你会得到Release Hashkey。

窗口:

释放Hashkey的步骤:

下载Openssl(从这里下载),我已经下载了64位操作系统,你可以在这里找到更多 解压下载的zip文件到C:只\驱动器 打开命令提示符 "C:\Users\hiren.patel\Desktop\mykeystore. keytool -exportcert -alias **myaliasname** -keystore **"\openssl-0.9.8e_X64\bin\openssl.exe" sha1 -二进制| "C:\openssl-0.9.8e_X64\bin\openssl.exe" base64

请更改别名和Keystore与它的路径作为您的要求。

注意:请将您的详细信息放在我标记的** **之间。

终端将询问密钥库的密码。您必须为相同的密钥存储库提供密码。

最后你会得到Release Hashkey。

Done

我创建了一个适用于Windows和Mac OS x的小工具,只需放入密钥存储文件,并获取散列密钥。

如果您想要默认调试。Keystore文件,使用默认别名和密码。否则,使用您自己的密钥存储库文件和值。

看看吧,下载Windows版或Mac OS X版 (Dev-Host有时可能会宕机…所以如果链接坏了,PM我,我会修复它)。

我希望这对你们有帮助……

2014年12月31日-编辑: 更改主机为AFH。 如果链接坏了,请告诉我

2013年11月21日-编辑:

根据用户的要求,我添加了一个默认的密钥存储库位置和一个捐赠按钮。如果我帮了你,尽管用吧。:)

要获得Android密钥哈希码,请遵循以下步骤:

下载OpenSSL for Windows 现在解压缩到C盘 打开CMD提示符 输入cd C:\Program Files\Java\ jdk1.6.0_26\bin 然后只输入keytool -export -alias myAlias -keystore c:\ users \您的用户名\。android\myKeyStore | C:\openssl-0.9.8 k_win32 \bin\openssl sha1 -二进制| C:\openssl-0.9.8 k_win32 \bin\openssl enc -a -e 完成

在Android Studio中,只需点击右侧侧边栏面板“Gradle”即可显示gardel面板: -YOURAPPNAME ——任务 ——安卓 ----(双击)signingReport(启动Gradle Daemon)

然后你会看到结果:

Config: debug
Store: C:\Users\username\.android\debug.keystore
Alias: AndroidDebugKey
MD5: C8:46:01:EA:36:02:D1:21:1B:23:19:91:D4:32:CB:AC
SHA1: 38:AB:4C:01:01:D7:62:E0:61:D1:9F:52:04:0C:E5:07:4E:E4:9B:39
SHA-256: 1B:8C:DC:35:48:10:01:2C:1F:BD:01:64:F1:01:06:01:60:01:A6:8B:10:15:2E:BF:7B:C4:FD:38:4C:C1:74:01
Valid until: Saturday, February 12, 2050

SHA1副本:

38:AB:4C:01:01:D7:62:E0:68:D1:9F:52:04:0C:E5:07:4E:E4:9B:39

进入本页

粘贴SHA1并生成您的Facebook密钥哈希代码。

以下是步骤

Download openssl from Google code (If you have a 64 bit machine you must download openssl-0.9.8e X64 not the latest version) Extract it. create a folder- OpenSSL in C:/ and copy the extracted code here. detect debug.keystore file path. If u didn't find, then do a search in C:/ and use the Path in the command in next step. detect your keytool.exe path and go to that dir/ in command prompt and run this command in 1 line- $ keytool -exportcert -alias androiddebugkey -keystore "C:\Documents and Settings\Administrator.android\debug.keystore" | "C:\OpenSSL\bin\openssl" sha1 -binary |"C:\OpenSSL\bin\openssl" base64 it will ask for password, put android that's all. u will get a key-hash

欲了解更多信息,请访问这里