关于webview:小程序webview嵌入公众号网页并实现微信支付下载pdf

场景在微信小程序开发中,应用小程序web-view组件能够在小程序中嵌入一个H5利用。如果在公众号曾经开发实现了一个网页,之后又想在小程序中也开发一个雷同的利用,就能够间接应用webview组件间接套用一个已公布的公众号页面节俭很多开发成本。当有差异化性能时就能够通过微信sdk的接口进行以后是否小程序/公众号的判断,而后进行webview新页面的开发。 我的公众号网页是Vue+iView写的,小程序比较简单因为外围逻辑只是与webview进行通信,所以是原生编写。本篇次要解说应用webview遇到的一些问题解决办法以及调起领取、下载性能。简略建设一个原生小程序我的项目构造: 退出webview首先建设一个homepage.wxml,内容次要是一个webview组件嵌入公众号页面https://test.xxxx.com/wxgzh,传入openid和appid用于外部传递给生成订单的后端接口,ver参数能够保障页面不缓存(最新的页面): <!--index.wxml--><view class="container"> <web-view src="https://test.xxxx.com/wxgzh/?someid=38127&openid={{openid}}&appid={{appid}}&ver={{ver}}#/index"></web-view></view>在首页加载时调用官网wx.login接口申请用户登录小程序,登录后调取后端的登录接口去获取openid最终传递到webview中。homepage.js //homepage.jsconst app = getApp()Page({ data: { ver:'timesp', openid:'', appid:'' }, onLoad: function() { const accountInfo = wx.getAccountInfoSync(); console.log(accountInfo.miniProgram.appId, '小程序 appId') this.setData({ ver:new Date().getTime(), appid:accountInfo.miniProgram.appId, }) this.doLogin(); }, getLoginData(code){ let that = this; wx.request({ method:'post', url: app.globalData.baseUrl+'wx/wx/user/login', data: { data:{ appId:this.data.appid, code: code }, token:'' }, success (res) { console.log('获取openid胜利',res) that.setData({openid:res.data.data.openid}); }, fail(res){ console.log('获取openid失败') } }) }, doLogin:function(){ let that = this; wx.login({ success (res) { if (res.code) { //发动网络申请 that.getLoginData(res.code) } else { wx.showToast({ title: '登录失败!', }) console.log('登录失败!' + res.errMsg) } } }) }})给小程序加返回按钮到这里其实是曾经实现能够在小程序中关上公众号页面了,然而有个问题,当webview页面在外部进行多层跳转时,想返回上一层发现微信是没有明确的返回按钮的,影响体验。解决办法是在公众号网页外部本人实现一个公共有返回按钮的TopBar组件,然而咱们公众号页面是不须要这个TopBar的。有一个解决办法是创立一个两头者空页面作为小程序的初始页面index.js,当页面加载时立刻跳转到实在的首页homepage,这样做就能够强制让小程序显示出返回按钮了:index.js ...

August 21, 2022 · 2 min · jiezi

关于webview:小程序webview嵌入h5兼容iphonex安全区域

阐明:本文小程序专指 微信小程序iphonex: 实指iphonex及后续刘海屏机器平安区域: 本文特指底部平安区域要做的事件如何在小程序webview加载h5页面以及应用webview的益处本文不做赘述,文本次要解决为了解决:间接关上h5页面中能够失常适配iphonex平安区域,待h5嵌入到小程序的webview中后不起作用,次要解决h5页面在小程序webview中适配iphonex的问题。 问题体现h5独自页面浏览时候,能够适配iphonex的底部平安区域(左图),嵌入小程序后适配有效(右图仅h5示例) 网上查看了解决方案大略有: 在小程序里判断以后是否为iphonex,而后将参数拼接到url上,在h5里承受参数,独自减少一个款式,如iphonex-fix.iphonex-fix { padding-bottom: 34px/64rpx;}通过媒体查问,判断以后设施尺寸来确定@media only screen and (min-device-width: 375px)and (max-device-width: 415px) and (min-device-height: 812px) and (max-device-height: 897px) and (-webkit-min-device-pixel-ratio: 2) { .iphonex-fit { padding-bottom:34px; }应用苹果官网推出适配计划css函数env()、constant()来适配 (举荐),具体实现可参考https://www.cnblogs.com/cangq...@supports (bottom: constant(safe-area-inset-bottom)) or (bottom: env(safe-area-inset-bottom)) { @action-button-height: 60px; .my__container { padding-bottom: calc(~"@{action-button-height} + constant(safe-area-inset-bottom)"); padding-bottom: calc(~"@{action-button-height} + env(safe-area-inset-bottom)"); } .my__action { padding-bottom: calc(~"@{action-button-height} + constant(safe-area-inset-bottom)"); padding-bottom: calc(~"@{action-button-height} + env(safe-area-inset-bottom)"); }}本文也是在毫不犹豫的抉择来 3种解决方案,嵌入小程序后发现的,问题点在于在h5独自显示失常,放到微信开发者工具中不失常,webview又无奈像chrome浏览器进行debugger。迫于交付压力,改用了第2种计划,然而又甘心啊。。问题的转折点在于偶尔发现最新版的开发者工具,在webview页面中多了一个debugger按钮,点开发现居然能够调试嵌入的h5页面了 解决形式通过排查发现,通过第三种办法写的css,在小程序下是能够失效的,然而因为款式优先级问题被笼罩掉了。解决方案就是在反对平安区域的机型上,减少css权重,在外层嵌套了my-wrap @supports (bottom: constant(safe-area-inset-bottom)) or (bottom: env(safe-area-inset-bottom)) { // 减少class权重 .my-wrap { @action-button-height: 60px; .my__container { padding-bottom: calc(~"@{action-button-height} + constant(safe-area-inset-bottom)"); padding-bottom: calc(~"@{action-button-height} + env(safe-area-inset-bottom)"); } .my__action { padding-bottom: calc(~"@{action-button-height} + constant(safe-area-inset-bottom)"); padding-bottom: calc(~"@{action-button-height} + env(safe-area-inset-bottom)"); } }}

April 14, 2022 · 1 min · jiezi

关于webview:技术干货-关于-WKWebview-网络拦截你想知道的都在这里

原生 WKWebView 在独立于 app 过程之外的过程中执行网络申请,申请数据不通过主过程,因而在 WKWebView 上间接应用 NSURLProtocol 是无奈拦挡申请的。 然而因为 mPaas 的离线包机制强依赖网络拦挡,所以基于此,mPaaS 利用了 WKWebview 的暗藏 api,去注册拦挡网络申请去满足离线包的业务场景需要,参考代码如下: [WKBrowsingContextController registerSchemeForCustomProtocol:@"https"]然而因为出于性能的起因,WKWebView 的网络申请在给主过程传递数据的时候会把申请的 body 去掉,导致拦挡后申请的 body 参数失落。 在离线包场景,因为页面的资源不须要 body 数据,所以离线包能够失常应用不受影响。然而在 H5 页面内的其余 post 申请会失落 data 参数。 为了解决 post 参数失落的问题,mPaas 通过在 js 注入代码,hook 了 js 上下文里的 XMLHTTPRequest 对象解决。 通过在 JS 层把办法内容组装好,而后通过 WKWebView 的 messageHandler 机制把内容传到主过程,把对应 HTTPBody 而后存起来,随后告诉 JS 端持续这个申请,网络申请到主过程后,在将 post 申请对应的 HttpBody 增加上,这样就实现了一次 post 申请的解决。整体流程能够参考如下: 常见问题通过下面的机制,既满足了离线包的资源拦挡诉求,也解决了 post 申请 body 失落的问题。然而在一些场景还是存在一些问题,须要开发者进行适配。 mPaaS 容器和三方容器混用导致三方容器申请 body 失落1.1 问题场景典型的场景,是在 App 内同时集成了多个 WKWebView 容器,常见的问题景象如下:关上 mPaaS 容器后在关上三方的 WK 页面,三方 WK 页面内的 post 申请 body 参数失落。 ...

May 28, 2021 · 1 min · jiezi

关于webview:微信小程序内嵌webview相关知识点整理

前言随着微信小程序的广泛应用,越来越多的商家抉择将营销营垒抉择迁徙到了小程序中,但受其小程序体积限度的影响,不可能齐全满足商户的要求,应运而生的web-view组件很好的解决的这一问题。一方面内嵌web-view可能间接运行在小程序中,大大减少了商户的开发成本,另一方面可能实现小程序与h5的跳转,有良好的扩展性,不便商户多端间引流。 一、web-view内嵌h5与传统小程序比照通过查找相干材料发现,内嵌web-view和微信小程序在离线能力、页面切换体验、二次渲染,操作响应和开发灵活性上有如下比照,在不同场景下可能性能上有些许出入,仅供参考。 /内嵌web-view微信小程序离线能力低高页面切换体验中高二次渲染高低操作响应高低开发灵活性高低表格起源:https://segmentfault.com/a/11...从上表中能够比照出 H5 相较于小程序的优缺点,开发者能够依据理论须要抉择。此外,应用web-view还有以下长处:己方账号(第三方)与小程序openId/UnionId的关联绑定,实现免登陆比方你是某门户网站,须要辨认本人小程序上的用户与网站用户的关系,能够通过三种办法绑定关系,公众号,小程序原生,小程序web-view内嵌跳转三种办法。 内嵌H5的富文本,缩小反复开发比方你是门户网站,社区,以往有大量的新闻和帖子,外面带了各种css款式的富文本,音视频自定义的点击事件等,小程序的原生组件可能无奈兼容,这时候间接内嵌这些H5新闻,将会大大降低开发成本。 热更新,缩小公布审核内嵌H5能够缩小频繁提交小程序审核,商户只须要从新公布h5的版本,就能够更新内嵌web-view的内容。 二、web-view小程序配置2.1 配置域名业务域名中配置的就是小程序以及 H5 和 H5 中援用 iframe 的域名。如果 H5 中有内嵌的 iframe 也要配置进去,须要服务端进行配合,将校验文件搁置在将要嵌套的业务域名的根目录。 2.2 根底库抉择web-view 要在根底库1.6.4以上的版本库能力应用,微信官网统计根底库在1.6.4+ 的覆盖率已达 95% 以上,这个指标能满足产品的需要。 2.3 h5引入微信jssdkweb-view要在微信sdk引入之后,微信sdk版本要求至多1.3.2,其中蕴含了h5和小程序间接的通信办法。 <script type="text/javascript" src='//res.wx.qq.com/open/js/jweixin-1.4.0.js'></script>2.4 web-view和小程序间通信官网给出了两种通信办法。 postMessage 通信 在 H5 中须要先用 wx.miniProgram.postMessage 接口,把须要分享的信息,推送给小程序。 在用户点击了小程序后退、组件销毁、分享这些非凡事件之后,小程序页面通过 bindmessage 绑定的函数读取 post 信息。设置 web-view 组件的 URL 通信 H5 跳转小程序:<view> <web-view src="{{url}}" ></web-view></view// h5中跳转小程序navigateToWeixin() { wx.miniProgram.navigateTo({url: '/pages/shop/index'});}// 小程序跳转h5--第一步<view> <web-view src="{{url}}" ></web-view></view>// 小程序跳转h5--第二步:在小程序的 js 文件中设置通过 URL 以问号传参的形式传入参数到 H5中if(!option.page){ this.setData({ url: `${this.data.url}?${test}` });} else { this.setData({ url: `${this.data.url}${option.page}?${test}` });}三、内嵌web-view调试解决方案首先通过微信开发者工具关上,这里url本地调试能够跟局域网链接,开发者工具能够实时显示,如果跟的是线上链接,可能只能通过预览扫码。右键点击页面,左上角会呈现调试,能够在右图的调试器中对h5进行调试。 ...

January 26, 2021 · 1 min · jiezi

微信小程序-webview-与-h5-通过-postMessage-实现实时通讯的实现

原文:https://pantao.parcmg.com/pre... 在做 React Native 应用时,如果需要在 App 里面内嵌 H5 页面,那么 H5 与 App 之间可以通过 Webview 的 PostMessage 功能实现实时的通讯,但是在小程序里面,虽然也提供了一个 webview 组件,但是,在进行 postMessage 通讯时,官方文档里面给出了一条很变态的说明: 网页向小程序 postMessage 时,会在特定时机(小程序后退、组件销毁、分享)触发并收到消息。e.detail = { data },data 是多次 postMessage 的参数组成的数组这里面已经说的很明白了,不管我们从 H5 页面里面 postMessage 多少次,小程序都是收不到的,除非: 用户做了回退到上一页的操作组件销毁用户点击了分享这里面其实我没有完全说对,官方其实说的是 小程序后退,并没有说是用户做回退操作,经过我的实测,确实人家表达得很清楚了,我们通过微信官方的SDK调起的回退也是完全可行的: wx.miniProgram.navigateBack()大体思路从上面的分析和实测中我们可以知道,要实现无需要用户操作即可完成的通讯,第三种情况我们是完全不需要考虑了的,那么来仔细考虑第 1 和第 2 种场景。 第 1 种方式:回退当我们想通过网页向小程序发送数据,同时还可以回退到上一个页面时,我们可以在 wx.miniProgram.postMessage 之后,立马调用一次 wx.miniProgram.navigateBack(),此时小程序的操作是: 处理 postMessage 信息回退到上一页我们在处理 postMessage 的时候做一些特殊操作,可以将这些数据保存下来 第 2 种方式:组件销毁这是我感觉最合适的一种方式,可以让小程序拿到数据,同时还保留在当前页面,只需要销毁一次 webview 即可,大概的流程就是: 小程序 postMessage小程序 navigateTo 将小程序页面导向一个特殊的页面小程序的那个特殊页面立马回退到 webview 所在的页面webview 所在的页面的 onShow 里面,做一次处理,将 webview 销毁,然后再次打开触发 onMessage 拿到数据H5 页面再次被打开这种方式虽然变态,但是至少可以做到实时拿到数据,同时还保留在当前 H5 页面,唯一需要解决的是,在做这整套操作前,H5 页面需要做好状态的缓存,要不然,再次打开之后,H5 的数据就清空了。 ...

August 20, 2019 · 4 min · jiezi

Android使用WebView加载H5页面播放视频音频退出后还在播放问题解决

Android中经常会使用到WebView来加载H5的页面,如果H5页面中有音频或者视频的播放时,还没播放完就退出界面,这个时候会发现音频或者视频还在后台播放,这就有点一脸懵逼了,下面是解决方案: 方案一: 在webview所在的activity中的onPause()和onResume()方法中写上两句话。public void onPause() { super.onPause(); webview.onPause(); } public void onResume() { super.onResume(); webview.onResume(); } 方案二: //添加一下代码解决问题 webView退出之后音频视频还在播放问题private AudioManager audioManager;private AudioManager.OnAudioFocusChangeListener listener;@Overrideprotected void onResume() { if (audioManager!= null) { audioManager.abandonAudioFocus(listener); audioManager = null; } super.onResume();}@Overrideprotected void onPause() { audioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE); listener = new AudioManager.OnAudioFocusChangeListener() { @Override public void onAudioFocusChange(int focusChange) { } }; int result = audioManager.requestAudioFocus(listener, AudioManager.STREAM_MUSIC, AudioManager.AUDIOFOCUS_GAIN_TRANSIENT); if (result == AudioManager.AUDIOFOCUS_REQUEST_GRANTED) { } super.onPause();}以下是个人公众号(longxuanzhigu),之后发布的文章会同步到该公众号,方便交流学习Android知识及分享个人爱好文章: ...

July 15, 2019 · 1 min · jiezi

浏览器exe桌面应用用javafx-webview-打造自己的浏览器

背景项目需要做一个客户端的壳,内置浏览器,访问指定 的url 采用技术java 1.8开始吧!java环境配置略 hello worldimport javafx.application.Application;import javafx.beans.value.ChangeListener;import javafx.beans.value.ObservableValue;import javafx.concurrent.Worker;import javafx.concurrent.Worker.State;import javafx.scene.Group;import javafx.scene.Scene;import javafx.scene.control.ScrollPane;import javafx.scene.web.WebEngine;import javafx.scene.web.WebView;import javafx.stage.Stage;//www.qingmiaokeji.cnpublic class Main extends Application { @Override public void start(final Stage stage) { stage.setWidth(400); stage.setHeight(500); Scene scene = new Scene(new Group()); final WebView browser = new WebView(); final WebEngine webEngine = browser.getEngine(); ScrollPane scrollPane = new ScrollPane(); scrollPane.setContent(browser); webEngine.getLoadWorker().stateProperty() .addListener(new ChangeListener<State>() { @Override public void changed(ObservableValue ov, State oldState, State newState) { if (newState == Worker.State.SUCCEEDED) { stage.setTitle(webEngine.getLocation()); } } }); webEngine.load("http://www.baidu.com"); scene.setRoot(scrollPane); stage.setScene(scene); stage.show(); } public static void main(String[] args) { launch(args); }}效果 ...

June 14, 2019 · 1 min · jiezi

浏览器exe桌面应用用javafx-webview-打造自己的浏览器全屏自适应屏幕

接着上一篇 全屏 Scene scene = new Scene(new Group()); stage.setMaximized(true);自适应屏幕 ScrollPane scrollPane = new ScrollPane(); scrollPane.setFitToHeight(true); scrollPane.setFitToWidth(true); scrollPane.setContent(browser);

June 14, 2019 · 1 min · jiezi

WebView的基本使用及相关特性

WebView 是一个显示网页内容的组件,可以显示网络上的一些在线内容并且可以作为 Web 浏览器滚动显示的内容,它使用 WebKit作为渲染引擎来显示网页,里面包括放大、缩小、执行文本搜索等进行前后导航的方法。 注意 :如果要在 WebView 中显示在线网页等内容时,需要在 AndroidManifest.xml 文件中添加网络权限,参考如下: <uses-permission android:name="android.permission.INTERNET" />基本用法默认情况下 WebView 不启用 JavaScript ,网页错误也将被忽略,如果仅仅是在 UI 上显示一段 HTML,这就会非常好, 用户在不需要再阅读之前与用户交互,网页不需要与用户交互 ,如果你需要一个完整的浏览器,你需要调用相应的 Intent 去启动浏览器去执行某些操作,而不是使用 WebView 来显示,调用系统浏览器使用如下代码: Uri uri = Uri.parse("https://www.example.com");Intent intent = new Intent(Intent.ACTION_VIEW, uri);startActivity(intent); 使用 WebView 主要有两种使用方式,在 Activity 等 onCreate() 方法直接创建使用或者在布局文件中引入,参考如下: 1. 在代码中直接创建 WebViewWebView webview = new WebView(this);//这里将整个 Activity 窗口作为 WebView 的显示界面,也可单独放在某个布局中setContentView(webview);2. 在布局文件中使用 WebView<WebView android:id="@+id/webView" android:layout_width="match_parent" android:layout_height="match_parent"></WebView>那么,我们如何加载一个网页呢,如果网页是本地的又如何加载呢,还有如何加载一段 HTML 的片段呢,常用的加载方法主要有两个,如下: 1. 加载一个完整的网页这里测试使用百度首页、CSDN首页、腾讯首页进行测试,测试百度首页时,需要设置如下属性网页内容才能正确显示,如果不设置将显示为白屏: webSettings.setJavaScriptEnabled(true);webSettings.setDomStorageEnabled(true);webView.loadUrl("https://www.baidu.com");测试 CSDN 首页时,会提示打开系统带浏览器的应用去打开该页面,设置如下属性才能直接加载网页内容: ...

June 13, 2019 · 2 min · jiezi

WebView,我已经长大了,知道自己区分是否安全了!

一、前言如果你在用 Android 原生系统(Google Play 服务),在使用 WebView 加载某些网页时,一定遇到过以下的安全警告红屏。这是 WebView 的安全浏览保护策略,在 Android 8.0(API Level 26)开始的默认策略,被应用在所有 App 的 WebView 当中。Google 会自己维护一套“不安全”网站的列表,并通过 Google Play 服务,同步到所有的设备上。当你要访问某些被标记为“不安全”的网站时,它就会以此“红屏”警告用户。注意这是默认策略,虽然出发点是为了保护用户,但是有时候我们自己的 App 还是要有自主管控的权利。那我们有办法在自己的 App 内,关闭此项保护吗?毕竟我的应用我做主,安不安全自己来管控。今天就来聊聊,如何在 Android 8.0(API Level 26)中,关闭此安全保护策略。二、什么是WebView的安全策略自 2018 年 4 月起,随着 WebView 66 发布,Google Play 保护机制,将在 WebView 中默认开始此安全浏览策略。而 Android 开发者在使用 WebView 时,无需再进行任何更改,即可享受此项保护服务。自 Android 8.0 开始,WebView 中即已经集成安全浏览功能,并且与 Android 版的 Chrome 采用相同的底层技术。一旦触发 WebView 的安全机制,就会出现类似下图这样的“红屏”警告。Google 会自维护一套不良网站的列表,以确保用户可以在浏览之前,发出警告。为了同步这部分列表,Google 花费了很大的努力,就是为了保护用户的安全。三、如何控制安全策略在 Android 8.0 及以上的设备中,WebView 的安全浏览策略,是默认生效的。也就是说,如果我们想要使用它,我们什么额外的工作都不需要做,但是我们如果不想采用它,就需要通过一个方法将其关闭。3.1 如何监控开启WebView 的安全浏览,是依赖于 Google Play 和 Chrome 更新的,也就是说,虽然你的设备是 Android 8.0,但是此策略也是有可能没有生效的。那么如何确定此功能是否生效呢?WebView 提供了一个方法 startSafeBrowsing() 方法,来主动开启安全浏览策略,在回调中,我们可以知道当前设备是否准备好了,符合开启安全浏览的条件。WebView.startSafeBrowsing(this, object : ValueCallback<Boolean> { override fun onReceiveValue(value: Boolean?) { val isOpen = value ?:false if (isOpen) { Log.i(“cxmy_dev”, “Safe browsing. On”) } else { Log.i(“cxmy_dev”, “Safe browsing. Off”) } }})注意回调内的 value 可能为 null。3.2 如何关闭安全策略WebView 的安全策略是默认开始的,如果想要关闭它,需要通过 WebSettings 这个类,其中有 setSafeBrowsingEnabled(boolean) 方法,可以用于设置是否开启安全模式。webSettings.safeBrowsingEnabled = false此方法是一种全局的策略,也就是要么开启、要么关闭。3.3 配置白名单使用 setSafeBrowsingEnable() 方法,只能做二态的设置,要么开启要么关闭。如果我们想设置,只允许某些 Host 不经过安全策略校验,如何设置呢?WebView 还提供了一个 setSafeBrowsingWhiteList() 的方法,用于设置一个安全策略的白名单。var array = ArrayList<String>()array.add(“example.com”)WebView.setSafeBrowsingWhitelist(array, object : ValueCallback<Boolean> { override fun onReceiveValue(value: Boolean?) { }})setSafeBrowsingWhiteList() 方法很灵活,可以通过配置指定域名及其子域名,或者仅此域名不包含其子域名。还可以直接配置 IP 地址,支持 IPV4 和 IPV6。四、小结时刻今天我们聊到如何关闭 WebView 的安全浏览策略,本文涉及的 API,全部仅支持 API Level 27,使用的时候注意判断。当然,WebView 的安全浏览是有必要的,所以如果你的域名被 Google 误认为是危险链接,可以通过申述的方式解封,申述地址。本文对你有帮助吗?留言、点赞、转发是最大的支持,谢谢!references:protecting-hundreds-of-millions-moresWebkit-WebViewwhitepaper公众号后台回复成长『成长』,将会得到我准备的学习资料,也能回复『加群』,一起学习进步;你还能回复『提问』,向我发起提问。推荐阅读:关于字符编码,你需要知道的都在这里 | 图解:HTTP 范围请求 | Java 异常处理 | 安卓防止用户关闭动画导致动画失效 | Git 找回遗失的代码 | 阿里的 Alpha 助力 App 启动速度优化 ...

March 13, 2019 · 1 min · jiezi

android app内置webview,随android版本升级进程关系的变化

Q最近遇到一个问题:多个应用打不开,闪退。A调查发现闪退的应用都在首屏加载了webview,而在android p上webview的渲染是在另外一个进程上进行的,进程名字类似webview:sandboxed_process0,这个进程是由webview_zygote这样一个进程fork出来的,而webview_zygote由于缺少权限runtime崩溃,从而导致webview加载失败,应用闪退。S增加相应权限webview_zygote.teallow webview_zygote ion_device:chr_file r_file_perms;简单调查了下加载webview的应用,随android版本升级进程关系的变化1.在android o以前webview运行在app进程里2.android owebview运行在单独的进程里com.android.webview:sandboxed_process(n)webview进程是由webview_zygote进程fork出来的而webview_zygote进程是由1号进程init进程forkc出来的能看出不管应用进程运行时是32bit还是64bit,wevview进程的运行时应该是32bit,因为webview_zygote是32bit的,它只能fork 32bit进程出来,生不出别的孩子可以看到32bit,64bit运行时应用的祖宗zygote和zygote64也是init进程fork出来的USER PID PPID VSZ RSS WCHAN ADDR S NAME root 1 0 60588 1576 0 0 S initroot 983 1 4287904 19896 0 0 S zygote64root 984 1 1618076 18836 0 0 S zygotewebview_zygote 1943 1 1396420 11180 0 0 S webview_zygote32 u0_i188 3756 1943 1474636 20108 0 0 S com.android.webview:sandboxeu0_i185 29184 1943 1474636 18096 0 0 S com.android.webview:sandboxe3.android p总体上和android o一样,但是有些区别webview运行在单独的进程里com.android.webview:sandboxed_process(n)webview进程是由webview_zygote进程fork出来的这里稍有不同webview_zygote进程是由zygote fork出来的,当然它也只能是32bit的运行时,它儿子孙子都是USER PID PPID VSZ RSS WCHAN ADDR S NAME root 1 0 60588 1576 0 0 S initroot 572 1 4316640 133916 poll_schedule_timeout 0 S zygote64root 573 1 1628984 120228 poll_schedule_timeout 0 S zygotewebview_zygote 2003 573 1631044 58384 poll_schedule_timeout 0 S webview_zygoteu0_i1 6247 2003 1181360 18528 ep_poll 0 S com.android.webview:sandboxed_process04.不但如此android o和android p编译链接关系上有不同zygote,webview_zygote编译链接关系发生了变化,链接了不同的库问题错误栈I WebViewFactory: Loading com.android.webview version 66.0.3359.158 (code 336015855)W cr_ChildProcLH: Create a new ChildConnectionAllocator with package name = com.android.webview, sandboxed = trueW libprocessgroup: kill(-4305, 9) failed: No such processI libprocessgroup: Successfully killed process cgroup uid 10064 pid 4305 in 95msI cr_BrowserStartup: Initializing chromium process, singleProcess=falseI cr_base : Android Locale: en_US requires .pak files: []E webview_zygote: Unable to restat fd 28: Permission deniedF webview_zygote: jni_internal.cc:616] JNI FatalError called: (com.android.webview:sandboxed_process0) Unable to stat 28W webview_zygote: type=1400 audit(0.0:27): avc: denied { getattr } for path="/dev/ion" dev=“tmpfs” ino=12718 scontext=u:r:webview_zygote:s0 tcontext=u:object_r:ion_device:s0 tclass=chr_file permissive=0W webview_zygote: type=1400 audit(0.0:28): avc: denied { getattr } for path="/dev/ion" dev=“tmpfs” ino=12718 scontext=u:r:webview_zygote:s0 tcontext=u:object_r:ion_device:s0 tclass=chr_file permissive=0W webview_zygote: type=1400 audit(0.0:29): avc: denied { read } for name=“app_process32” dev=“mmcblk0p25” ino=467 scontext=u:r:webview_zygote:s0 tcontext=u:object_r:zygote_exec:s0 tclass=file permissive=0F webview_zygote: runtime.cc:558] Runtime aborting…F webview_zygote: runtime.cc:558] Dumping all threads without appropriate locks held: thread list lock mutator lockF webview_zygote: runtime.cc:558] All threads:F webview_zygote: runtime.cc:558] DALVIK THREADS (1):F webview_zygote: runtime.cc:558] “main” prio=5 tid=1 RunnableF webview_zygote: runtime.cc:558] | group="" sCount=0 dsCount=0 flags=0 obj=0x74d7cf48 self=0xf2f73000F webview_zygote: runtime.cc:558] | sysTid=2332 nice=0 cgrp=default sched=0/0 handle=0xf6b54494F webview_zygote: runtime.cc:558] | state=R schedstat=( 80557599 15727867 94 ) utm=5 stm=3 core=5 HZ=100F webview_zygote: runtime.cc:558] | stack=0xff72b000-0xff72d000 stackSize=8MBF webview_zygote: runtime.cc:558] | held mutexes= “abort lock” “mutator lock”(shared held)F webview_zygote: runtime.cc:558] native: #00 pc 002d975f /system/lib/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, int, BacktraceMap, char const, art::ArtMethod, void, bool)+134)F webview_zygote: runtime.cc:558] native: #01 pc 0036e98b /system/lib/libart.so (art::Thread::DumpStack(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, bool, BacktraceMap*, bool) const+210)F webview_zygote: runtime.cc:558] native: #02 pc 0036b143 /system/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, bool, BacktraceMap*, bool) const+34)F webview_zygote: runtime.cc:558] native: #03 pc 00383df9 /system/lib/libart.so (art::DumpCheckpoint::Run(art::Thread*)+624)F webview_zygote: runtime.cc:558] native: #04 pc 0037e0df /system/lib/libart.so (art::ThreadList::RunCheckpoint(art::Closure, art::Closure)+314)F webview_zygote: runtime.cc:558] native: #05 pc 0037d7d7 /system/lib/libart.so (art::ThreadList::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, bool)+758)F webview_zygote: runtime.cc:558] native: #06 pc 0034d8fb /system/lib/libart.so (art::Runtime::Abort(char const*)+314)F webview_zygote: runtime.cc:558] native: #07 pc 000071b3 /system/lib/libbase.so (android::base::LogMessage::~LogMessage()+494)F webview_zygote: runtime.cc:558] native: #08 pc 00265a0f /system/lib/libart.so (art::JNI::FatalError(_JNIEnv, char const)+122)F webview_zygote: runtime.cc:558] native: #09 pc 0010b4d5 /system/lib/libandroid_runtime.so (_ZZN12_GLOBAL__N_123ForkAndSpecializeCommonEP7_JNIEnvjjP10_jintArrayiP13_jobjectArrayxxiP8_jstringS7_bS3_S3_bS7_S7_ENK3$_0clERKNSt3__112basic_stringIcNS9_11char_traitsIcEENS9_9allocatorIcEEEE+92)F webview_zygote: runtime.cc:558] native: #10 pc 0010b28f /system/lib/libandroid_runtime.so ((anonymous namespace)::ForkAndSpecializeCommon(_JNIEnv, unsigned int, unsigned int, _jintArray, int, _jobjectArray, long long, long long, int, _jstring, _jstring, bool, _jintArray, _jintArray, bool, _jstring, _jstring*)+4958)F webview_zygote: runtime.cc:558] native: #11 pc 001097f1 /system/lib/libandroid_runtime.so (android::com_android_internal_os_Zygote_nativeForkAndSpecialize(_JNIEnv, _jclass, int, int, _jintArray, int, _jobjectArray, int, _jstring, _jstring, _jintArray, _jintArray, unsigned char, _jstring, _jstring)+476)F webview_zygote: runtime.cc:558] at com.android.internal.os.Zygote.nativeForkAndSpecialize(Native method)W VideoCapabilities: Unrecognized profile/level 0/3 for video/mpeg2F webview_zygote: runtime.cc:558] at com.android.internal.os.Zygote.forkAndSpecialize(Zygote.java:139)F webview_zygote: runtime.cc:558] at com.android.internal.os.ZygoteConnection.processOneCommand(ZygoteConnection.java:234)E chromium: [ERROR:devtools_http_handler.cc(292)] Cannot start http server for devtools. Stop devtools.F webview_zygote: runtime.cc:558] at com.android.internal.os.ZygoteServer.runSelectLoop(ZygoteServer.java:204)F webview_zygote: runtime.cc:558] at com.android.internal.os.WebViewZygoteInit.main(WebViewZygoteInit.java:160)F webview_zygote: runtime.cc:558] at java.lang.reflect.Method.invoke(Native method)F webview_zygote: runtime.cc:558] at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)D AutofillManagerServiceImpl: Reset component for user 0 ()F webview_zygote: runtime.cc:558] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)F webview_zygote: runtime.cc:558]F webview_zygote: runtime.cc:558] Aborting thread:F webview_zygote: runtime.cc:558] “main” prio=5 tid=1 NativeF webview_zygote: runtime.cc:558] | group="" sCount=0 dsCount=0 flags=0 obj=0x74d7cf48 self=0xf2f73000F webview_zygote: runtime.cc:558] | sysTid=2332 nice=0 cgrp=default sched=0/0 handle=0xf6b54494F webview_zygote: runtime.cc:558] | state=R schedstat=( 102025203 15767659 98 ) utm=7 stm=3 core=6 HZ=100F webview_zygote: runtime.cc:558] | stack=0xff72b000-0xff72d000 stackSize=8MBF webview_zygote: runtime.cc:558] | held mutexes= “abort lock"F webview_zygote: runtime.cc:558] native: #00 pc 002d975f /system/lib/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, int, BacktraceMap, char const, art::ArtMethod, void, bool)+134)F webview_zygote: runtime.cc:558] native: #01 pc 0036e98b /system/lib/libart.so (art::Thread::DumpStack(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, bool,BacktraceMap*, bool) const+210)F webview_zygote: runtime.cc:558] native: #02 pc 0036b143 /system/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, bool, BacktraceMap*, bool) const+34)F webview_zygote: runtime.cc:558] native: #03 pc 003598b3 /system/lib/libart.so (art::AbortState::DumpThread(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, art::Thread*) const+30)F webview_zygote: runtime.cc:558] native: #04 pc 0034d953 /system/lib/libart.so (art::Runtime::Abort(char const*)+402)F webview_zygote: runtime.cc:558] native: #05 pc 000071b3 /system/lib/libbase.so (android::base::LogMessage::~LogMessage()+494)F webview_zygote: runtime.cc:558] native: #06 pc 00265a0f /system/lib/libart.so (art::JNI::FatalError(_JNIEnv, char const)+122)F webview_zygote: runtime.cc:558] native: #07 pc 0010b4d5 /system/lib/libandroid_runtime.so (_ZZN12_GLOBAL__N_123ForkAndSpecializeCommonEP7_JNIEnvjjP10_jintArrayiP13_jobjectArrayxxiP8_jstringS7_bS3_S3_bS7_S7_ENK3$_0clERKNSt3__112basic_stringIcNS9_11char_traitsIcEENS9_9allocatorIcEEEE+92)F webview_zygote: runtime.cc:558] native: #08 pc 0010b28f /system/lib/libandroid_runtime.so ((anonymous namespace)::ForkAndSpecializeCommon(_JNIEnv, unsigned int, unsigned int, _jintArray, int, _jobjectArray, long long, long long, int, _jstring, _jstring, bool, _jintArray, _jintArray, bool, _jstring, _jstring*)+4958)F webview_zygote: runtime.cc:558] native: #09 pc 001097f1 /system/lib/libandroid_runtime.so (android::com_android_internal_os_Zygote_nativeForkAndSpecialize(_JNIEnv, _jclass, int, int, _jintArray, int, _jobjectArray, int, _jstring, _jstring, _jintArray, _jintArray, unsigned char, _jstring, _jstring)+476)F webview_zygote: runtime.cc:558] native: #10 pc 003cb633 /system/framework/arm/boot-framework.oat (offset 3ab000) (com.android.internal.os.Zygote.nativeForkAndSpecialize+338)F webview_zygote: runtime.cc:558] native: #11 pc 00a0ba7f /system/framework/arm/boot-framework.oat (offset 3ab000) (com.android.internal.os.Zygote.forkAndSpecialize+198)F webview_zygote: runtime.cc:558] native: #12 pc 00a0eb0d /system/framework/arm/boot-framework.oat (offset 3ab000) (com.android.internal.os.ZygoteConnection.processOneCommand+1388)F webview_zygote: runtime.cc:558] native: #13 pc 00a13675 /system/framework/arm/boot-framework.oat (offset 3ab000) (com.android.internal.os.ZygoteServer.runSelectLoop+780)F webview_zygote: runtime.cc:558] native: #14 pc 0040d575 /system/lib/libart.so (art_quick_invoke_stub_internal+68)F webview_zygote: runtime.cc:558] native: #15 pc 003e6b79 /system/lib/libart.so (art_quick_invoke_stub+224)F webview_zygote: runtime.cc:558] native: #16 pc 000a1015 /system/lib/libart.so (art::ArtMethod::Invoke(art::Thread, unsigned int, unsigned int, art::JValue, char const)+136)F webview_zygote: runtime.cc:558] native: #17 pc 001e5ae9 /system/lib/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread, art::ArtMethod, art::ShadowFrame, unsigned short, art::JValue)+236)F webview_zygote: runtime.cc:558] native: #18 pc 001e05d7 /system/lib/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod, art::Thread, art::ShadowFrame&, art::Instruction const, unsigned short, art::JValue)+814)F webview_zygote: runtime.cc:558] native: #19 pc 003e3c1d /system/lib/libart.so (MterpInvokeVirtualQuick+428)F webview_zygote: runtime.cc:558] native: #20 pc 00404094 /system/lib/libart.so (ExecuteMterpImpl+29972)F webview_zygote: runtime.cc:558] native: #21 pc 00dc4ff8 /system/framework/boot-framework.vdex (com.android.internal.os.WebViewZygoteInit.main+198)F webview_zygote: runtime.cc:558] native: #22 pc 001c4d53 /system/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.2471763592+378)F webview_zygote: runtime.cc:558] native: #23 pc 001c937f /system/lib/libart.so (art::interpreter::EnterInterpreterFromEntryPoint(art::Thread, art::CodeItemDataAccessor const&, art::ShadowFrame)+82)F webview_zygote: runtime.cc:558] native: #24 pc 003d52b9 /system/lib/libart.so (artQuickToInterpreterBridge+880)F webview_zygote: runtime.cc:558] native: #25 pc 00411aff /system/lib/libart.so (art_quick_to_interpreter_bridge+30)I WifiService: acquireMulticastLock uid=10087F webview_zygote: runtime.cc:558] native: #26 pc 0040d575 /system/lib/libart.so (art_quick_invoke_stub_internal+68)F webview_zygote: runtime.cc:558] native: #27 pc 003e6c7b /system/lib/libart.so (art_quick_invoke_static_stub+222)F webview_zygote: runtime.cc:558] native: #28 pc 000a1027 /system/lib/libart.so (art::ArtMethod::Invoke(art::Thread, unsigned int, unsigned int, art::JValue, char const)+154)F webview_zygote: runtime.cc:558] native: #29 pc 00347ac5 /system/lib/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod, art::(anonymous namespace)::ArgArray, art::JValue, char const)+52)F webview_zygote: runtime.cc:558] native: #30 pc 00348f15 /system/lib/libart.so (art::InvokeMethod(art::ScopedObjectAccessAlreadyRunnable const&, _jobject, _jobject, _jobject*, unsigned int)+1024)F webview_zygote: runtime.cc:558] native: #31 pc 002fb0c5 /system/lib/libart.so (art::Method_invoke(_JNIEnv, _jobject, _jobject, _jobjectArray)+40)F webview_zygote: runtime.cc:558] native: #32 pc 0011226f /system/framework/arm/boot.oat (offset 10c000) (java.lang.Class.getDeclaredMethodInternal [DEDUPED]+110)W ctxmgr : [PendingIntentCompat]Timed out delivering to pendingIntent=PendingIntent{8dc1703: android.os.BinderProxy@4c24eee}, intent=Intent { (has extras) }, permission=nullF webview_zygote: runtime.cc:558] native: #33 pc 00a0a95b /system/framework/arm/boot-framework.oat (offset 3ab000) (com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run+114)F webview_zygote: runtime.cc:558] native: #34 pc 00a10845 /system/framework/arm/boot-framework.oat (offset 3ab000) (com.android.internal.os.ZygoteInit.main+2836)F webview_zygote: runtime.cc:558] native: #35 pc 0040d575 /system/lib/libart.so (art_quick_invoke_stub_internal+68)F webview_zygote: runtime.cc:558] native: #36 pc 003e6c7b /system/lib/libart.so (art_quick_invoke_static_stub+222)F webview_zygote: runtime.cc:558] native: #37 pc 000a1027 /system/lib/libart.so (art::ArtMethod::Invoke(art::Thread, unsigned int, unsigned int, art::JValue, char const)+154)F webview_zygote: runtime.cc:558] native: #38 pc 00347ac5 /system/lib/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod, art::(anonymous namespace)::ArgArray, art::JValue, char const)+52)F webview_zygote: runtime.cc:558] native: #39 pc 003478ef /system/lib/libart.so (art::InvokeWithVarArgs(art::ScopedObjectAccessAlreadyRunnable const&, _jobject, _jmethodID, std::__va_list)+310)F webview_zygote: runtime.cc:558] native: #40 pc 0028eb11 /system/lib/libart.so (art::JNI::CallStaticVoidMethodV(_JNIEnv, _jclass, _jmethodID*, std::__va_list)+444)F webview_zygote: runtime.cc:558] native: #41 pc 0006c99b /system/lib/libandroid_runtime.so (_JNIEnv::CallStaticVoidMethod(_jclass, _jmethodID, …)+30)F webview_zygote: runtime.cc:558] native: #42 pc 0006ebf3 /system/lib/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vector<android::String8>F webview_zygote: runtime.cc:558] native: #43 pc 00001989 /system/bin/app_process32 (???)F webview_zygote: runtime.cc:558] native: #44 pc 0008b89d /system/lib/libc.so (__libc_init+48)F webview_zygote: runtime.cc:558] native: #45 pc 0000166f /system/bin/app_process32 (???)F webview_zygote: runtime.cc:558] native: #46 pc 00000306 <anonymous:f6b51000> (???)F webview_zygote: runtime.cc:558] at com.android.internal.os.Zygote.nativeForkAndSpecialize(Native method)F webview_zygote: runtime.cc:558] at com.android.internal.os.Zygote.forkAndSpecialize(Zygote.java:139)F webview_zygote: runtime.cc:558] at com.android.internal.os.ZygoteConnection.processOneCommand(ZygoteConnection.java:234)F webview_zygote: runtime.cc:558] at com.android.internal.os.ZygoteServer.runSelectLoop(ZygoteServer.java:204)F webview_zygote: runtime.cc:558] at com.android.internal.os.WebViewZygoteInit.main(WebViewZygoteInit.java:160)F webview_zygote: runtime.cc:558] at java.lang.reflect.Method.invoke(Native method)F webview_zygote: runtime.cc:558] at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)F webview_zygote: runtime.cc:558] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)F webview_zygote: runtime.cc:558]E libc : failed to connect to tombstoned: Permission deniedW webview_zygote: type=1400 audit(0.0:30): avc: denied { write } for name=“tombstoned_crash” dev=“tmpfs” ino=16442 scontext=u:r:webview_zygote:s0 tcontext=u:object_r:tombstoned_crash_socket:s0 tclass=sock_file permissive=0F DEBUG : F DEBUG : ABI: ‘arm’F DEBUG : pid: 2332, tid: 2332, name: webview_zygote >>> webview_zygote <<<F DEBUG : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr ——–F DEBUG : Abort message: ‘jni_internal.cc:616] JNI FatalError called: (com.android.webview:sandboxed_process0) Unable to stat 28’F DEBUG : r0 00000000 r1 0000091c r2 00000006 r3 00000008F DEBUG : r4 0000091c r5 0000091c r6 fff24e2c r7 0000010cF DEBUG : r8 0000000d r9 f2f1c720 r10 fff24f80 r11 f2e2763eF DEBUG : ip fff24dc8 sp fff24e18 lr f502cdd9 pc f5024c7aD Fabric : Using AdvertisingInfo from Preference StoreI Gecko : 1538430036192 addons.xpi WARN List of valid built-in add-ons could not be parsed.: [Exception… “Component returned failure code: 0x80520001 (NS_ERROR_FILE_UNRECOGNIZED_PATH) [nsIXPCComponents_Utils.readUTF8URI]” nsresult: “0x80520001 (NS_ERROR_FILE_UNRECOGNIZED_PATH)” location: “JS frame :: resource://gre/modules/addons/XPIProvider.jsm :: startup :: line 197” data: no] Stack trace: startup()@resource://gre/modules/addons/XPIProvider.jsm:197W webview_zygote: type=1400 audit(0.0:31): avc: denied { read } for name=“app_process32” dev=“mmcblk0p25” ino=467 scontext=u:r:webview_zygote:s0 tcontext=u:object_r:zygote_exec:s0 tclass=file permissive=0I unwind : Malformed section header found, ignoring…F DEBUG :F DEBUG : backtrace:F DEBUG : #00 pc 0001cc7a /system/lib/libc.so (abort+58)F DEBUG : #01 pc 0034db4f /system/lib/libart.so (art::Runtime::Abort(char const*)+910)F DEBUG : #02 pc 000071b3 /system/lib/libbase.so (android::base::LogMessage::~LogMessage()+494)F DEBUG : #03 pc 00265a0f /system/lib/libart.so (art::JNI::FatalError(_JNIEnv, char const)+122)F DEBUG : #04 pc 0010b4d5 /system/lib/libandroid_runtime.so (_ZZN12_GLOBAL__N_123ForkAndSpecializeCommonEP7_JNIEnvjjP10_jintArrayiP13_jobjectArrayxxiP8_jstringS7_bS3_S3_bS7_S7_ENK3$_0clERKNSt3__112basic_stringIcNS9_11char_traitsIcEENS9_9allocatorIcEEEE+92)F DEBUG : #05 pc 0010b28f /system/lib/libandroid_runtime.so ((anonymous namespace)::ForkAndSpecializeCommon(_JNIEnv, unsigned int, unsigned int, _jintArray, int, _jobjectArray, long long, long long, int, _jstring, _jstring, bool, _jintArray, _jintArray, bool, _jstring, _jstring*)+4958)F DEBUG : #06 pc 001097f1 /system/lib/libandroid_runtime.so (android::com_android_internal_os_Zygote_nativeForkAndSpecialize(_JNIEnv, _jclass, int, int, _jintArray, int, _jobjectArray, int, _jstring, _jstring, _jintArray, _jintArray, unsigned char, _jstring, _jstring)+476)F DEBUG : #07 pc 003cb633 /system/framework/arm/boot-framework.oat (offset 0x3ab000) (com.android.internal.os.Zygote.nativeForkAndSpecialize+338)F DEBUG : #08 pc 00a0ba7f /system/framework/arm/boot-framework.oat (offset 0x3ab000) (com.android.internal.os.Zygote.forkAndSpecialize+198)F DEBUG : #09 pc 00a0eb0d /system/framework/arm/boot-framework.oat (offset 0x3ab000) (com.android.internal.os.ZygoteConnection.processOneCommand+1388)F DEBUG : #10 pc 00a13675 /system/framework/arm/boot-framework.oat (offset 0x3ab000) (com.android.internal.os.ZygoteServer.runSelectLoop+780)F DEBUG : #11 pc 0040d575 /system/lib/libart.so (art_quick_invoke_stub_internal+68)F DEBUG : #12 pc 003e6b79 /system/lib/libart.so (art_quick_invoke_stub+224)F DEBUG : #13 pc 000a1015 /system/lib/libart.so (art::ArtMethod::Invoke(art::Thread, unsigned int, unsigned int, art::JValue, char const)+136)F DEBUG : #14 pc 001e5ae9 /system/lib/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread, art::ArtMethod, art::ShadowFrame, unsigned short, art::JValue)+236)F DEBUG : #15 pc 001e05d7 /system/lib/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod, art::Thread, art::ShadowFrame&, art::Instruction const, unsigned short, art::JValue)+814)F DEBUG : #16 pc 003e3c1d /system/lib/libart.so (MterpInvokeVirtualQuick+428)F DEBUG : #17 pc 00404094 /system/lib/libart.so (ExecuteMterpImpl+29972)F DEBUG : #18 pc 00dc4ff8 /system/framework/boot-framework.vdex (com.android.internal.os.WebViewZygoteInit.main+198)F DEBUG : #19 pc 001c4d53 /system/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.2471763592+378)F DEBUG : #20 pc 001c937f /system/lib/libart.so (art::interpreter::EnterInterpreterFromEntryPoint(art::Thread, art::CodeItemDataAccessor const&, art::ShadowFrame)+82)F DEBUG : #21 pc 003d52b9 /system/lib/libart.so (artQuickToInterpreterBridge+880)F DEBUG : #22 pc 00411aff /system/lib/libart.so (art_quick_to_interpreter_bridge+30)F DEBUG : #23 pc 0040d575 /system/lib/libart.so (art_quick_invoke_stub_internal+68)F DEBUG : #24 pc 003e6c7b /system/lib/libart.so (art_quick_invoke_static_stub+222)F DEBUG : #25 pc 000a1027 /system/lib/libart.so (art::ArtMethod::Invoke(art::Thread, unsigned int, unsigned int, art::JValue, char const)+154)F DEBUG : #26 pc 00347ac5 /system/lib/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod, art::(anonymous namespace)::ArgArray, art::JValue, char const)+52)F DEBUG : #27 pc 00348f15 /system/lib/libart.so (art::InvokeMethod(art::ScopedObjectAccessAlreadyRunnable const&, _jobject, _jobject, _jobject*, unsigned int)+1024)F DEBUG : #28 pc 002fb0c5 /system/lib/libart.so (art::Method_invoke(_JNIEnv, _jobject, _jobject, _jobjectArray)+40)F DEBUG : #29 pc 0011226f /system/framework/arm/boot.oat (offset 0x10c000) (java.lang.Class.getDeclaredMethodInternal [DEDUPED]+110)F DEBUG : #30 pc 00a0a95b /system/framework/arm/boot-framework.oat (offset 0x3ab000) (com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run+114)F DEBUG : #31 pc 00a10845 /system/framework/arm/boot-framework.oat (offset 0x3ab000) (com.android.internal.os.ZygoteInit.main+2836)F DEBUG : #32 pc 0040d575 /system/lib/libart.so (art_quick_invoke_stub_internal+68)F DEBUG : #33 pc 003e6c7b /system/lib/libart.so (art_quick_invoke_static_stub+222)F DEBUG : #34 pc 000a1027 /system/lib/libart.so (art::ArtMethod::Invoke(art::Thread, unsigned int, unsigned int, art::JValue, char const)+154)F DEBUG : #35 pc 00347ac5 /system/lib/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod, art::(anonymous namespace)::ArgArray, art::JValue, char const)+52)F DEBUG : #36 pc 003478ef /system/lib/libart.so (art::InvokeWithVarArgs(art::ScopedObjectAccessAlreadyRunnable const&, _jobject, _jmethodID, std::__va_list)+310)F DEBUG : #37 pc 0028eb11 /system/lib/libart.so (art::JNI::CallStaticVoidMethodV(_JNIEnv, _jclass, _jmethodID*, std::__va_list)+444)F DEBUG : #38 pc 0006c99b /system/lib/libandroid_runtime.so (_JNIEnv::CallStaticVoidMethod(_jclass, _jmethodID, …)+30)F DEBUG : #39 pc 0006ebf3 /system/lib/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vector<android::String8> const&, bool)+458)F DEBUG : #40 pc 00001989 /system/bin/app_process32F DEBUG : #41 pc 0008b89d /system/lib/libc.so (__libc_init+48)F DEBUG : #42 pc 0000166f /system/bin/app_process32F DEBUG : #43 pc 00000306 <anonymous:f6b51000>W webview_zygote: type=1400 audit(0.0:32): avc: denied { read } for name=“app_process32” dev=“mmcblk0p25” ino=467 scontext=u:r:webview_zygote:s0 tcontext=u:object_r:zygote_exec:s0 tclass=file permissive=0E ZygoteProcess: Starting VM process through Zygote failedI Zygote : Process 2332 exited due to signal (6)E ActivityManager: Failure starting process com.android.webview:sandboxed_process0E ActivityManager: java.lang.RuntimeException: Starting VM process through Zygote failedE ActivityManager: at android.os.ZygoteProcess.start(ZygoteProcess.java:239)E ActivityManager: at android.os.Process.startWebView(Process.java:507)E ActivityManager: at com.android.server.am.ActivityManagerService.startProcess(ActivityManagerService.java:4478)E ActivityManager: at com.android.server.am.ActivityManagerService.lambda$startProcessLocked$0(ActivityManagerService.java:4432)E ActivityManager: at com.android.server.am.-$$Lambda$ActivityManagerService$UgpguyCBuObHjnmry_xkrJGkFi0.run(Unknown Source:20)E ActivityManager: at android.os.Handler.handleCallback(Handler.java:873)E ActivityManager: at android.os.Handler.dispatchMessage(Handler.java:99)E ActivityManager: at android.os.Looper.loop(Looper.java:193)E ActivityManager: at android.os.HandlerThread.run(HandlerThread.java:65)E ActivityManager: at com.android.server.ServiceThread.run(ServiceThread.java:44)E ActivityManager: Caused by: android.os.ZygoteStartFailedEx: java.io.EOFExceptionE ActivityManager: at android.os.ZygoteProcess.zygoteSendArgsAndGetResult(ZygoteProcess.java:332)E ActivityManager: at android.os.ZygoteProcess.startViaZygote(ZygoteProcess.java:438)E ActivityManager: at android.os.ZygoteProcess.start(ZygoteProcess.java:232)E ActivityManager: … 9 moreE ActivityManager: Caused by: java.io.EOFExceptionE ActivityManager: at java.io.DataInputStream.readFully(DataInputStream.java:200)E ActivityManager: at java.io.DataInputStream.readInt(DataInputStream.java:389)E ActivityManager: at android.os.ZygoteProcess.zygoteSendArgsAndGetResult(ZygoteProcess.java:323)E ActivityManager: … 11 moreI ActivityManager: Force stopping com.google.android.gm appid=99000 user=0: start failureI ActivityManager: Force finishing activity ActivityRecord{ad8615d u0 com.google.android.gm/.ConversationListActivityGmail t116}E ActivityManager: Found activity ActivityRecord{ad8615d u0 com.google.android.gm/.ConversationListActivityGmail t116 f} in proc activity list using null instead of expected ProcessRecord{f4179d8 4833:com.google.android.gm/u0a49} ...

February 22, 2019 · 10 min · jiezi