Facebook应用中的Android Hash键更改 [英] Android Hash key changes in Facebook app

查看:126
本文介绍了Facebook应用中的Android Hash键更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图把我的debbug哈希键,它是:e3U9nzK7A8gyWoCiNUZQA / C + bZI =。
但是每次我把它放在我的Facebook应用程序的关键哈希部分,它会自动更改为e3U9nzK7A8gyWoCiNUZQA%2FC%2BbZI%3D,使我的应用程序无用。
我用两个方法来获取这个密钥,并返回相同的方法:keytool -exportcert -alias androiddebugkey -keystore〜/ .android / debug.keystore | openssl sha1 -binary | openssl base64



和:

  private void getAppKeyHash(){
try {
PackageInfo info = getPackageManager()。getPackageInfo(getPackageName(),PackageManager.GET_SIGNATURES);
(签名签名:info.signatures){
MessageDigest md;

md = MessageDigest.getInstance(SHA);
md.update(signature.toByteArray());
String something = new String(Base64.encode(md.digest(),0));
Log.d(Hash key,something);
}
}
catch(NameNotFoundException e1){
// TODO自动生成的catch块
Log.e(name not found,e1.toString( ));
}

catch(NoSuchAlgorithmException e){
// TODO自动生成的catch块
Log.e(no such an algorithm,e.toString( ));
}
catch(异常e){
Log.e(exception,e.toString());
}

}


解决方案

我也有同样的问题,意识到这是Facebook的一个bug。请参阅链接。非常懊恼。



修改



唯一的工作解决方案解决方法似乎是通过Web界面强制登录,因为SSO是使用hashkey的。



如果使用登录按钮:

  LoginButton authButton =(LoginButton)view.findViewById(R.id.authButton); 
authButton.setLoginBehavior(SessionLoginBehavior.SUPPRESS_SSO);资料来源:



编辑2



它可以解决;我问一个朋友(通过Skype,他在mac上)为我添加它们。他设法让它正确(但我不知道如何)。



编辑3



现在这个问题似乎已经为我解决了。输入的哈希键不再被重写。无论是由fb团队解决还是要求从我重新启动计算机,我不知道。


I'm trying to put my debbug hash key, which is : "e3U9nzK7A8gyWoCiNUZQA/C+bZI=". But every time i put it inside the key hash section on my Facebook App it changes to "e3U9nzK7A8gyWoCiNUZQA%2FC%2BbZI%3D" automatically, making my app useless. I used two methods to get this key, and it returned the same : keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64

and :

 private void getAppKeyHash() {
    try {
        PackageInfo info = getPackageManager().getPackageInfo(getPackageName(), PackageManager.GET_SIGNATURES);
        for (Signature signature : info.signatures) {
            MessageDigest md;

            md = MessageDigest.getInstance("SHA");
            md.update(signature.toByteArray());
            String something = new String(Base64.encode(md.digest(), 0));
            Log.d("Hash key", something);
        } 
    }
    catch (NameNotFoundException e1) {
        // TODO Auto-generated catch block
        Log.e("name not found", e1.toString());
    }

    catch (NoSuchAlgorithmException e) {
        // TODO Auto-generated catch block
        Log.e("no such an algorithm", e.toString());
    }
    catch (Exception e){
        Log.e("exception", e.toString());
    }

}

解决方案

I have the same problem, and realised this is a bug on facebook´s end. See link. Very anoying.

Edit

The only working solution (but ugly) until it is solved seems to be to force login through web interface, since SSO is the one using the hashkey.

If using the login-button:

LoginButton authButton = (LoginButton) view.findViewById(R.id.authButton);
authButton.setLoginBehavior(SessionLoginBehavior.SUPPRESS_SSO);

Source: Android - Force Facebook connection - Stack Overflow

Edit 2

It can be solved though; I asked a friend (over Skype, he´s on a mac) to add them for me. And he managed to get it right (but I do not know how).

Edit 3

Now this issue seems to have solved itself for me. Entered hashkeys no longer gets rewritten. Whether it is solved by fb-team or just required a computer restart from me I do not know.

这篇关于Facebook应用中的Android Hash键更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆