Facebook:无效的哈希密钥

时间:2018-04-10 05:39:32

标签: android-facebook

我正在使用三台设备来测试Facebook登录。在联想k8笔记上测试时显示无效的哈希键。我在Facebook控制台上放置了发布和调试密钥。 生成发布密钥 -

  

keytool -exportcert -alias -keystore    | PATH_TO_OPENSSL_LIBRARY \ bin \ openssl sha1 -binary   | PATH_TO_OPENSSL_LIBRARY \ bin \ openssl base64

生成deubg密钥

try {
            PackageInfo info = getPackageManager().getPackageInfo(
                    "in.technitab.fitmode",
                    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 | NoSuchAlgorithmException e) {
            Log.e("TAG", e.getMessage());
        }

0 个答案:

没有答案