Android 应用程序未通过 SSL 错误处理程序获得批准 [英] Android App is not approved with SSL Error Handler
问题描述
我上个月发布了一个正式版 Android 应用,但我在使用 SSL 错误处理程序时遇到了问题.
I released a production Android app last month, but I had trouble with the SSL Error Handler.
我遵循了 Stackoverfollow 和 Google 的教程,但是 Google 仍然没有批准我的应用(注意:这个 QA 不是重复的).
I followed Stackoverfollow's and Google's tutorials, however Google doesn't still approve my app (note: this QA is not a duplicate).
我的代码实现如下:
任何使用 WebViewClient 的 Fragment 或 Activity,我都像这样控制了 SSL 错误
Any Fragment or Activity that uses WebViewClient, I've controlled SSL Error like this
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
LogI("onReceivedSslError: " + error.getCertificate());
AlertDialog.Builder builder = new AlertDialog.Builder(ctx);
AlertDialog alertDialog = builder.create();
String message;
switch (error.getPrimaryError()) {
case SslError.SSL_UNTRUSTED:
message = "The certificate authority is not trusted.";
break;
case SslError.SSL_EXPIRED:
message = "The certificate has expired.";
break;
case SslError.SSL_IDMISMATCH:
message = "The certificate Hostname mismatch.";
break;
case SslError.SSL_NOTYETVALID:
message = "The certificate is not yet valid.";
break;
case SslError.SSL_DATE_INVALID:
message = "The date of the certificate is invalid.";
break;
default:
message = "A generic error occurred.";
break;
}
message += " Do you want to continue anyway?";
alertDialog.setTitle("SSL Certificate Error");
alertDialog.setMessage(message);
alertDialog.setButton(DialogInterface.BUTTON_POSITIVE, "OK", (dialog, which) -> handler.proceed());
alertDialog.setButton(DialogInterface.BUTTON_NEGATIVE, "Cancel", (dialog, which) -> handler.cancel());
alertDialog.show();
}
那么,为什么我的应用未获批准?接下来我该怎么办?
So, Why is my app not approved? What should I do next?
感谢您的建议!
更新 1:我在 2019 年发布了我的应用程序并更新了很多次(没有问题).但是从 2021/5 开始,我遇到了这个问题.
Update 1: I released my app in 2019 and updated it many times (there was no problem). But from 2021/5 I've got this problem.
推荐答案
可能这些错误来自旧的 APKs, AABs 版本,在提交新的 APKs, AABs 之前删除/停用它
May these errors are from old APKs, AABs version, remove/deactivate it before submitting new APKs, AABs
这篇关于Android 应用程序未通过 SSL 错误处理程序获得批准的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!