|
|
|
|
@ -91,7 +91,6 @@ public class CustomWebView extends WebView { |
|
|
|
|
getSettings().setMediaPlaybackRequiresUserGesture(false); |
|
|
|
|
getSettings().setJavaScriptCanOpenWindowsAutomatically(false); |
|
|
|
|
getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW); |
|
|
|
|
CookieManager.getInstance().setAcceptThirdPartyCookies(this, true); |
|
|
|
|
setWebViewClient(webViewClient()); |
|
|
|
|
setWebChromeClient(webChromeClient()); |
|
|
|
|
} |
|
|
|
|
@ -108,6 +107,7 @@ public class CustomWebView extends WebView { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void start(String url, Map<String, String> headers) { |
|
|
|
|
OkCookieJar.setAcceptThirdPartyCookies(this); |
|
|
|
|
checkHeader(url, headers); |
|
|
|
|
loadUrl(url, headers); |
|
|
|
|
} |
|
|
|
|
@ -129,7 +129,7 @@ public class CustomWebView extends WebView { |
|
|
|
|
if (TextUtils.isEmpty(host) || VodConfig.get().getAds().contains(host)) return empty; |
|
|
|
|
if (url.contains("challenges.cloudflare.com/cdn-cgi")) App.post(() -> showDialog()); |
|
|
|
|
if (detect && url.contains("player/?url=")) onParseAdd(headers, url); |
|
|
|
|
else if (isVideoFormat(url)) interrupt(headers, url); |
|
|
|
|
else if (isVideoFormat(url)) onParseSuccess(headers, url); |
|
|
|
|
return super.shouldInterceptRequest(view, request); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -211,12 +211,6 @@ public class CustomWebView extends WebView { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void interrupt(Map<String, String> headers, String url) { |
|
|
|
|
String cookie = CookieManager.getInstance().getCookie(url); |
|
|
|
|
if (cookie != null) headers.put(HttpHeaders.COOKIE, cookie); |
|
|
|
|
onParseSuccess(headers, url); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void onParseAdd(Map<String, String> headers, String url) { |
|
|
|
|
App.post(() -> CustomWebView.create(App.get()).start(key, from, headers, url, click, callback, false)); |
|
|
|
|
} |
|
|
|
|
|