gpt4 book ai didi

google-play-services - 如何修复包含不安全的 TrustManager 实现的应用程序?

转载 作者:行者123 更新时间:2023-12-01 18:12:23 24 4
gpt4 key购买 nike

在开发者控制台中我的应用名称旁边看到了来自 Google 的警告,内容涉及 TrustManager 的不安全实现。我浏览了代码,但没有使用 TrustManager 或 checkServerTrusted 方法的单一位置,因此我不确定在哪里处理 Google 建议的异常。我能想到的唯一可能的地方是 IAB(应用内计费)相关库。有什么想法吗?

更新
虽然每个人造成此错误的原因可能有所不同,但在我的特定情况下,问题出在 Flurry 分析库上。我有一个相当旧的版本,一旦删除它,问题就消失了。

最佳答案

在您的事件中添加以下代码

public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {
try {
chain[0].checkValidity();
} catch (Exception e) {
throw new CertificateException("Certificate not valid or trusted.");
}
}

关于google-play-services - 如何修复包含不安全的 TrustManager 实现的应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35700090/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com