Use tbs webview

pull/137/head
FongMi 2 years ago
parent 42840e423d
commit 20f6ba962e
  1. 8
      app/build.gradle
  2. 4
      app/proguard-rules.pro
  3. 5
      app/src/main/java/com/fongmi/android/tv/impl/NewPipeImpl.java
  4. 17
      app/src/main/java/com/fongmi/android/tv/ui/custom/CustomWebView.java

@ -68,8 +68,9 @@ android {
targetCompatibility JavaVersion.VERSION_11
}
android.applicationVariants.all { variant ->
variant.outputs.all { output -> outputFileName = "${variant.productFlavors[0].name}-${variant.productFlavors[1].name}-${variant.productFlavors[2].name}.apk"
android.applicationVariants.all {
variant -> variant.outputs.all {
output -> outputFileName = "${variant.productFlavors[0].name}-${variant.productFlavors[1].name}-${variant.productFlavors[2].name}.apk"
}
}
@ -114,10 +115,9 @@ dependencies {
implementation 'com.github.bumptech.glide:okhttp3-integration:4.15.1'
implementation 'com.github.TeamNewPipe:NewPipeExtractor:340095515d45ecbee576872c7198992ebd8e4f08'
implementation 'com.google.android.material:material:1.9.0'
implementation 'com.google.net.cronet:cronet-okhttp:0.1.0'
implementation 'com.google.zxing:core:3.3.0'
implementation 'com.guolindev.permissionx:permissionx:1.7.1'
implementation 'org.chromium.net:cronet-embedded:101.4951.41'
implementation 'com.tencent.tbs:tbssdk:44286'
implementation 'org.greenrobot:eventbus:3.3.1'
implementation 'org.nanohttpd:nanohttpd:2.3.1'
implementation('org.simpleframework:simple-xml:2.7.1') { exclude group: 'stax', module: 'stax-api' exclude group: 'xpp3', module: 'xpp3' }

@ -34,10 +34,6 @@
# Cling
-keep class org.fourthline.cling.** { *; }
# Cronet
-keep class org.chromium.net.** { *; }
-keep class com.google.net.cronet.** { *; }
# EXO
-keep class org.xmlpull.v1.** { *; }

@ -1,5 +1,7 @@
package com.fongmi.android.tv.impl;
import androidx.annotation.NonNull;
import com.fongmi.android.tv.utils.Sniffer;
import com.github.catvod.net.OkHttp;
import com.google.common.net.HttpHeaders;
@ -13,7 +15,6 @@ import java.io.IOException;
import java.util.List;
import java.util.Map;
import javax.annotation.Nonnull;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
@ -21,7 +22,7 @@ import okhttp3.ResponseBody;
public class NewPipeImpl extends Downloader {
@Override
public Response execute(@Nonnull Request request) throws IOException, ReCaptchaException {
public Response execute(@NonNull Request request) throws IOException, ReCaptchaException {
String url = request.url();
RequestBody reqBody = null;
byte[] dataToSend = request.dataToSend();

@ -2,18 +2,10 @@ package com.fongmi.android.tv.ui.custom;
import android.annotation.SuppressLint;
import android.content.Context;
import android.net.http.SslError;
import android.text.TextUtils;
import android.webkit.CookieManager;
import android.webkit.SslErrorHandler;
import android.webkit.WebResourceRequest;
import android.webkit.WebResourceResponse;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.fongmi.android.tv.App;
import com.fongmi.android.tv.Constant;
@ -22,6 +14,13 @@ import com.fongmi.android.tv.bean.Site;
import com.fongmi.android.tv.impl.ParseCallback;
import com.fongmi.android.tv.utils.Sniffer;
import com.github.catvod.crawler.Spider;
import com.tencent.smtt.export.external.interfaces.SslError;
import com.tencent.smtt.export.external.interfaces.SslErrorHandler;
import com.tencent.smtt.export.external.interfaces.WebResourceRequest;
import com.tencent.smtt.export.external.interfaces.WebResourceResponse;
import com.tencent.smtt.sdk.CookieManager;
import com.tencent.smtt.sdk.WebView;
import com.tencent.smtt.sdk.WebViewClient;
import java.io.ByteArrayInputStream;
import java.util.Map;
@ -78,7 +77,6 @@ public class CustomWebView extends WebView {
private WebViewClient webViewClient() {
return new WebViewClient() {
@Nullable
@Override
public WebResourceResponse shouldInterceptRequest(WebView view, WebResourceRequest request) {
String url = request.getUrl().toString();
@ -91,7 +89,6 @@ public class CustomWebView extends WebView {
}
@Override
@SuppressLint("WebViewClientOnReceivedSslError")
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
handler.proceed();
}

Loading…
Cancel
Save