开发者

Trying to generate key hash for Android Facebook with keytool

So I am trying to get a hash so Facebook can use S开发者_如何学CSO with my android app, but I am having an issue.

so I run this:

keytool -exportcert -alias statusp -keystore my-release-key.keystore | openssl sha1 -binary | openssl enc -a -e

And it gives me an error that -exportcert is an illegal option, but it still gives me a key hash! However, it gives me the same key hash if I use the debug key template Facebook provides. So I don't think it's right. It also didn't ask me for my password(s) when making the key hash.

This seems so simple, yet I don't know why I'm having so much trouble. Can anyone offer any hints or suggestions?


I had the same problem, I spend a couple of hours to find a solution, but actually the Facebook SDK provides the solution by itself.

in the DialogListener class I modified the onFacebookError method:

 @Override
    public void onFacebookError(FacebookError error) {
         Log.d("myTag",error.getmessage);
    }

Execute the app (which was sign with the same key i use for the market), and on LogCat will be a message under this tag with the correct key.

We had also created a simple project which does all the work, and returns the correct key on an alert-box and on LogCat. You can find it on our blog.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜