android 高版本允许系统应用调用webview
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了android 高版本允许系统应用调用webview相关的知识,希望对你有一定的参考价值。
参考技术A 方式1:修改系统源码android\frameworks\base\core\java\android\webkit\WebViewFactory
@UnsupportedAppUsage
static WebViewFactoryProvider getProvider()
synchronized (sProviderLock)
// For now the main purpose of this function (and the factory abstraction) is to keep
// us honest and minimize usage of WebView internals when binding the proxy.
if (sProviderInstance != null) return sProviderInstance;
final int uid = android.os.Process.myUid();
if (uid == android.os.Process.ROOT_UID || uid == android.os.Process.SYSTEM_UID ||uid == android.os.Process.PHONE_UID || uid == android.os.Process.NFC_UID|| uid == android.os.Process.BLUETOOTH_UID)
throw new UnsupportedOperationException(
"For security reasons, WebView is not allowed in privileged processes");
........
去掉其中的 uid == android.os.Process.ROOT_UID || uid == android.os.Process.SYSTEM_UID
以上是关于android 高版本允许系统应用调用webview的主要内容,如果未能解决你的问题,请参考以下文章
Android方法调用耗时分析工具:开发者模式-System Tracing
Android Api(Okhttps)未在android 9(pie)及更高版本中调用[重复]