facebook开发者,获取应用的密钥散列

2019-01-23  本文已影响23人  JellyCai

集成facebooksdk之后,在应用内调用

try {
            PackageInfo info = getPackageManager().getPackageInfo(
                    "com.zy",
                    PackageManager.GET_SIGNATURES);
            for (Signature signature : info.signatures) {
                MessageDigest md = MessageDigest.getInstance("SHA");
                md.update(signature.toByteArray());
                Log.d("KeyHash:", Base64.encodeToString(md.digest(), Base64.DEFAULT));
            }
        } catch (PackageManager.NameNotFoundException e) {
        } catch (NoSuchAlgorithmException e) {
        }
上一篇下一篇

猜你喜欢

热点阅读