Android平台WebView控件存在跨域访问高危漏洞解决办法
2018-01-10 本文已影响0人
北海琅梆鱼
if (Build.VERSION.SDK_INT <= 16) {
Class<?> clazz = webView.getSettings().getClass();
Method method = clazz.getMethod("setAllowUniversalAccessFromFileURLs", boolean.class);
if (method != null) {
method.invoke(webView.getSettings(), false);
}
}