4

我有一个奇怪的问题。我正在尝试将 Facebook 集成到我的应用程序中。功能部分工作得很好,但问题是它只有在直接从我的电脑连接时才能工作,即如果将我的手机连接到 eclipse 并发送应用程序,它工作正常。如果我提取 apk 并直接从我的手机安装该应用程序不会让我登录,也不会创建会话等。

有人可以让我知道这里有什么问题吗?

更新1:

遵循官方 facebook 开发者网站,按照 SK9 的推荐创建密钥。

C:\Java\jdk1.7.0_10\bin>keytool -exportcert -alias myAppfull -key store myAppfull | C:\openssl-0.9.8k_X64\bin\openssl sha1 -binary | C:\openssl-0.9.8k_X64\bin\openssl base64 我得到密码提示。我输入用于在 eclipse 中导出的密码,它给出了一个代码。我进入了开发者页面。

其中:myAppfull 是我使用 eclipse 导出时使用的别名和密钥库。

还是同样的问题?有什么我想念的吗?

谢谢!

更新 2:

有效!谢谢!!可能对其他人有用。在下面检查我的答案!

4

3 回答 3

10

感谢 SK9 和 Vizz。我做了更多的研究并想出了如何解决这个问题。

这对于使用 ECLIPSE 创建要发布的密钥库的人很有用。

1) 打开命令提示符并在我的例子中给出 JDK Bin 文件夹的路径 (C:\Java\jdk1.7.0_10\bin)。

2) 复制此代码 keytool -exportcert -alias "youraliasnamethatwasgivenwhileexportineclipse" -keystore yourkeystorethatsavedwhileexportineclipse > c:\openssl\bin\release.txt

3) 现在您需要输入密码,Password = "samepasswordthatyouenterwhilecreatingthekeystoreineclipse"。

4) 在 openssl Bin 文件夹中查看你会得到一个名为 release.txt 的文件

5) 现在将目录更改为我打开的 ssl 文件夹:C:\openssl-0.9.8k_X64\bin\

6) 复制以下代码并粘贴 openssl sha1 -binary release.txt > release_sha.txt

7)您将在 openssl bin 文件夹中获得 release_sha.txt

8) 再次复制以下代码并粘贴 openssl base64 -in release_sha.txt > release_base64.txt

9) 你将在 openssl bin 文件夹中获得 release_base64.txt

10) 打开 release_base64.txt 文件 - Bingo 你有 hashkey - 复制密钥。

将此粘贴到 facebook 开发者网站中的调试密钥旁边。它应该开始工作!

于 2013-06-26T02:13:07.720 回答
2

检查 APK 的签名证书和在 Facebook 开发者帐户上注册的证书是否匹配。好像他们没有。

脸书#5。将您的发布密钥哈希添加到列表中。

于 2013-06-25T23:54:36.897 回答
0

我很久以前面临完全相同的问题。当您在一行中混合两个命令(结果键已损坏)时,问题似乎出现了(仅在 Windows 中)。我所做的是分别运行命令。我不记得我这样做的确切方式,但我找到了这个,这似乎与我发现的非常相似。

Exporting keystore cert
keytool -exportcert -alias <insert the name of your alias here> -keystore <insert the route of your key here> -storepass android -keypass android > namefile.bin

Converting to sha1
<insert the route of your \bin\openssl here > sha1 -binary namefile.bin > namefile.sha1

Converting to base64
<insert the route of your \bin\openssl here > base64 -in namefile.sha1 -out namefile.base64

Done, Android hash key for Facebook app is:
<insert the route of your \bin\openssl here > base64 -in namefile.sha1

资料来源:另一个 Stackoverflow 问题

于 2013-06-26T02:11:01.153 回答