3

在开发者控制台中我的应用名称旁边看到来自 Google 的警告,关于 TrustManager 的不安全实施。我浏览了代码,但没有一个地方使用 TrustManager 或 checkServerTrusted 方法,所以我不确定在哪里处理谷歌建议的异常。我能想到的唯一可能是在 IAB(应用内计费)相关库中。有任何想法吗?

更新
虽然这个错误的原因可能因人而异,但在我的特殊情况下,问题出在 Flurry 分析库上。我有一个相当旧的版本,一旦我删除它,问题就消失了。

4

1 回答 1

0

在您的活动中添加以下代码

public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {
                try {
                    chain[0].checkValidity();
                } catch (Exception e) {
                    throw new CertificateException("Certificate not valid or trusted.");
                }
            }
于 2016-12-01T07:16:04.410 回答