解决Google Play审核中的WebViewClient.onReceivedSslError问题
Google Play应用市场提交应用审核,出现因WebViewClient.onReceivedSslError问题导致拒绝通过。
Google Paly给出的详情地址:support.google.com/faqs/answer…
处理起来其实也相对简单,主要是针对用到WebViewClient对象重写onReceivedSslError()方法。
如:
@Override
public void onReceivedSslError(WebView view, final SslErrorHandler handler, SslError error) {
AlertDialog.Builder builder = new AlertDialog.Builder(view.getContext());
builder.setMessage("SSL认证失败,是否继续访问?");
builder.setPositiveButton("确定", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
handler.proceed();
}
});
builder.setNegativeButton("取消", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
handler.cancel();
}
});
AlertDialog dialog = builder.create();
dialog.show();
// 上报SslError信息到服务端,以便排查具体问题
CornLog.e(view, handler, error);
...
}
复制代码
项目主工程通过直接搜索WebViewClient,对应重写onReceivedSslError()方法,相对都很简单,主要问题在,针对项目中直接引入的jar包和通过gradle dependencies引入的外部库,需要统一核查。
通过gradle dependencies引入的外部库,通常是以aar形式存在,项目构建过程中,最终都会将aar中的有效部分,如jar文件,拷贝到当前项目构建目录,参与整体构建过程。
于是,构建完成后,可以通过命令直接查找项目目录下的jar文件,将其中的WebViewClient相关类都找到,并逐一排查,对于涉及到的自己的独立jar文件或gradle dependencies引入的外部库,可以自行修改,对于外部第三方(如QQ,微博等相关的登录分享库等)的库,可以考虑是否需要升级新的版本(新的版本很可能已经解决,因为第三方也会收到同样的问题或有人已经反馈过),或者反馈给第三方等方式解决。
使用搜索命令:
find . -name '*.jar' -exec zipgrep -i WebViewClient {} \;
输出结果为:
...
com/corn/biz/activity/BbsDetailActivity$LoanWebViewClient.class:Binary file (standard input) matches
com/corn/biz/activity/BbsDetailActivity.class:Binary file (standard input) matches
com/sina/weibo/sdk/web/client/AuthWebViewClient.class:Binary file (standard input) matches
com/sina/weibo/sdk/web/client/BaseWebViewClient.class:Binary file (standard input) matches
com/sina/weibo/sdk/web/client/DefaultWebViewClient.class:Binary file (standard input) matches
com/sina/weibo/sdk/web/client/ShareWebViewClient.class:Binary file (standard input) matches
com/sina/weibo/sdk/web/WeiboSdkWebActivity$1.class:Binary file (standard input) matches
com/sina/weibo/sdk/web/WeiboSdkWebActivity$2.class:Binary file (standard input) matches
com/sina/weibo/sdk/web/WeiboSdkWebActivity.class:Binary file (standard input) matches
sdk/meizu/auth/ui/AuthActivity$1.class:Binary file (standard input) matches
sdk/meizu/auth/ui/AuthActivity.class:Binary file (standard input) matches
com/cmic/sso/sdk/widget/a$1.class:Binary file (standard input) matches
com/cmic/sso/sdk/widget/a.class:Binary file (standard input) matches
com/tencent/connect/auth/a$a.class:Binary file (standard input) matches
com/tencent/connect/auth/a.class:Binary file (standard input) matches
com/tencent/open/c$a.class:Binary file (standard input) matches
com/tencent/open/c.class:Binary file (standard input) matches
com/tencent/open/TDialog$FbWebViewClient.class:Binary file (standard input) matches
com/tencent/open/TDialog.class:Binary file (standard input) matches
...
复制代码
逐一排查每项涉及到的外部文件,并确认是否已经处理好onReceivedSslError()方法。
作者:HappyCorn
链接:https://juejin.im/post/5cb1416a6fb9a0685727dd92
来源:掘金
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
解决Google Play审核中的WebViewClient.onReceivedSslError问题的更多相关文章
- 【已解决】Android ADT中增大AVD内存后无法启动:emulator failed to allocate memory 8
[问题] 折腾: [已解决]Android ADT中增大AVD内存后无法启动:emulator failed to allocate memory 8 过程中,增大对应AVD的内存为2G后,结果无法启 ...
- 解决GOOGLE不能用的办法
解决GOOGLE不能用的办法 首先平时用用百度还是足够了,但是说实话,百度在进行一些尝试搜索时真的没GOOGLE好用,经常找到一大堆广告,却不是自己想要的,比如搜索里面的双引号.and.site.fi ...
- 我的Android进阶之旅------>如何解决Android 5.0中出现的警告: Service Intent must be explicit:
我的Android进阶之旅-->如何解决Android 5.0中出现的警告: java.lang.IllegalArgumentException: Service Intent must be ...
- Android App在Google App Store中搜不到
情景:Android App在Google App Store上架成功,三星手机可以在Google App Store中搜索到,但是三星tablet却无法在Google App Store中搜索到,目 ...
- 我的Android进阶之旅------>怎样解决Android 5.0中出现的警告: Service Intent must be explicit:
我的Android进阶之旅-->怎样解决Android 5.0中出现的警告: java.lang.IllegalArgumentException: Service Intent must be ...
- Get your site working on Google Search Console , 在 Google Search Console中运行您的网站, Google Search Console
1 1 https://support.google.com/webmasters/topic/4564315? Search Console Help SEARCH CONSOLEHELP FORU ...
- php大力力 [051节] 支付宝支付.申请支付资质,等待审核中
https://beecloud.cn/doc/payapply/?index=6 支付宝支付申请支付资质 一.注册支付宝用户 在支付宝官网注册成为用户 二.签约对应支付产品 应用集成支付宝支付,需要 ...
- Google Chrome浏览器中如何使用命令
Google Chrome浏览器中如何使用命令 | 浏览:2974 | 更新:2014-02-23 23:12 | 标签:chrome 1 2 3 分步阅读 Google Chrome浏览器有很多的特 ...
- 解决cocos2dx在Xcode中运行时报:convert: iCCP: known incorrect sRGB profile 的问题
解决cocos2dx在Xcode中运行时报:convert: iCCP: known incorrect sRGB profile 的问题 本文的实践来源是参照了两个帖子完成的: http://dis ...
随机推荐
- AVL Tree 操作
1.AVL树是带有平衡条件的二叉查找树, 一棵AVL树是其每个节点的左子树和右子树的高度最多差1的二叉查找树. 2.AVL树的删除要比插入复杂.如果删除相对较少,那么用懒惰删除的方法是最好的策略. 3 ...
- Global一点小经验
Global: Global.asax 文件,有时候叫做 ASP.NET 应用程序文件,提供了一种在一个中心位置响应应用程序级或模块级事件的方法,他位于应用程序根目录下. 这个 Global.asax ...
- 数据结构和算法总结(一):广度优先搜索BFS和深度优先搜索DFS
前言 这几天复习图论算法,觉得BFS和DFS挺重要的,而且应用比较多,故记录一下. 广度优先搜索 有一个有向图如图a 图a 广度优先搜索的策略是: 从起始点开始遍历其邻接的节点,由此向外不断扩散. 1 ...
- SSM-Spring-07:Spring基于注解的di注入
------------吾亦无他,唯手熟尔,谦卑若愚,好学若饥------------- 注解: 说起注解,哇哦,每个人都或多或少的用到过 像什么@Overried,@Test,@Param等等之前就 ...
- 【手记】走近科学之为什么明明实现了IEnumerable<T>的类型却不能调用LINQ扩展方法
比如Json.NET的JObject明明实现了IEnumerable<T>,具体来说是IEnumerable<KeyValuePair<string, JToken>&g ...
- PHP 的 uniqid 函数产生的 id 真的是唯一的么?
PHP 的 uniqid 函数产生的 id 真的是唯一的么? 最近使用到了 uniqid,就产生了疑问?uniqid 生成的 id 由什么组成?真的是唯一的么?什么情况下会产生冲突? 从文档中看到 u ...
- Spring 数据处理框架的演变
欢迎大家前往腾讯云+社区,获取更多腾讯海量技术实践干货哦~ 定量分析的成败在很大程度上取决于采集,存储和处理数据的能力.若能及时地向业务决策者提供深刻并可靠的数据解读,大数据项目就会有更多机会取得成功 ...
- Undoing Merges
I would like to start writing more here about general Git tips, tricks and upcoming features. There ...
- SQL Server 日志和代理的错误日志
本文介绍的日志不是事务日志,而是SQL Server 日志和代理的错误日志,按照主体把错误日志分为SQL Server.SQL Server Agent.Database Mail,以及 Window ...
- React从入门到放弃之前奏(4):Redux中间件
redux 提供了类似后端 Express 的中间件概念. 最适合扩展的是redux中的 store.dispatch 方法,中间件实际就是通过 override redux的store.dispat ...