解决crosswalk-23.53.589.4aar包加载https资源时出现Requst was denied for security异常提示
第一步
xwalkView.setResourceClient(new XWalkResourceClient(xwalkView){
@Override
public void onReceivedSslError(XWalkView view, ValueCallback callback, SslError error) {
callback.onReceiveValue(true);//系统WebView中的是handler.process()
}
});
第二步
源码中的 SsLUtil.java 会阻止加载,注释掉这两行
public static boolean shouldDenyRequest(int error) {
assert error >= -215 && error <= -200;
switch(error) {
case -213:
case -212:
case -211:
case -208:
case -207:
case -206:
case -203:
// case -202:
case -201:
// case -200:
case -150:
case -129:
return true;
default:
return false;
}
}
修改源码后的aar直接导入就可以用