【发布时间】:2017-04-25 07:29:48
【问题描述】:
我正在尝试在 Google Play 中发布我的应用并从 Google Play 收到此消息。
我们拒绝了您的应用程序,包名称为 xxx.xxx.xxx.xxx,因为它违反了我们的恶意行为或用户数据政策。如果您提交了更新,您之前的应用版本仍可在 Google Play 上找到。
此应用使用的软件包含对用户的安全漏洞,或允许在未经适当披露的情况下收集用户数据。
下面是问题
主机名验证器 您的应用正在使用 HostnameVerifier 接口的不安全实现。您可以在这篇 Google 帮助中心文章中找到有关如何解决此问题的更多信息。
这是我的使用方法:
static HostnameVerifier hostnameVerifier = new HostnameVerifier() {
@Override
public boolean verify(String hostname, SSLSession session) {
if(hostname.equalsIgnoreCase("staging.hostname") || hostname.equalsIgnoreCase("production.sostname")){
return true;
}else{
return false;
}
}
};
然后这样称呼它:
HttpsURLConnection conn = (HttpsURLConnection) requestURL
.openConnection();
conn.setHostnameVerifier(hostnameVerifier);
请让我知道我做错了什么。提前致谢。
【问题讨论】:
-
这里哪个值是主机名? @Ishan Khanduja
-
你的包名?
标签: android google-play android-security