我正在开发一个Android应用程序,我想在其中集成一个Facebook 发布功能。我下载了Facebook-Android SDK,然后 readme。Md(文本文件)在那里,其中提到要生成 Android的键散列。我如何生成它?
当前回答
在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密钥哈希代码。
其他回答
我创建了一个适用于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 完成
Linux
开放式终端:
用于调试构建
keytool -exportcert -alias androiddebugkey -keystore debug.keystore | openssl sha1 -binary | openssl base64
你会发现debug。Keystore来自”。Android "文件夹复制并粘贴在桌面上,并运行上述命令
发布版本
keytool -exportcert -alias <aliasName> -keystore <keystoreFilePath> | openssl sha1 -binary | openssl base64
注意:确保在这两种情况下,它必须要求密码。如果它不要求输入密码,则意味着命令中有错误。
我犯了一个小错误,应该记住。如果你正在使用你的密钥库,那么给出你的别名,而不是androiddebugkey…
我的问题解决了。现在,如果我的设备上安装了Facebook,那么我的应用程序仍然在Facebook登录集成上获得数据。只关心你的哈希键。
请看下文。
C:\Program Files\Java\jdk1.6.0_45\bin>keytool -exportcert -alias here your alias name -keystore "G:\yourkeystorename.keystore" |"G:\ssl\bin\openssl" sha1 -binary | "G:\ssl\bin\openssl" base64
然后按Enter -它会要求您输入密码,然后输入您的密钥库密码,而不是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
欲了解更多信息,请访问这里
推荐文章
- 警告:API ' variable . getjavacompile()'已过时,已被' variable . getjavacompileprovider()'取代
- 安装APK时出现错误
- 碎片中的onCreateOptionsMenu
- TextView粗体通过XML文件?
- 如何使线性布局的孩子之间的空间?
- 如何测试Facebook本地连接
- 我如何找到哪个程序正在使用端口80在Windows?
- 在Windows中有像GREP这样的模式匹配实用程序吗?
- DSL元素android.dataBinding。enabled'已过时,已被'android.buildFeatures.dataBinding'取代
- ConstraintLayout:以编程方式更改约束
- PANIC: AVD系统路径损坏。检查ANDROID_SDK_ROOT值
- 如何生成字符串类型的buildConfigField
- Recyclerview不调用onCreateViewHolder
- 如何在iOS中使用Swift编程segue
- 如何在Windows命令提示符下运行.sh ?