Просмотр исходного кода

[修改]腾讯X5更新为最新版本

zeki лет назад: 5
Родитель
Сommit
33c97455ec

+ 21 - 0
app/build.gradle

@@ -53,6 +53,27 @@ android {
     packagingOptions {
         exclude 'META-INF/services/com.fasterxml.jackson.core.JsonFactory'
         exclude "**/module-info.class"
+        exclude 'META-INF/androidx.localbroadcastmanager_localbroadcastmanager.version'
+        exclude 'META-INF/androidx.customview_customview.version'
+        exclude 'META-INF/androidx.legacy_legacy-support-core-ui.version'
+        exclude 'META-INF/androidx.drawerlayout_drawerlayout.version'
+        exclude 'META-INF/androidx.interpolator_interpolator.version'
+        exclude 'META-INF/androidx.legacy_legacy-support-core-utils.version'
+        exclude 'META-INF/androidx.slidingpanelayout_slidingpanelayout.version'
+        exclude 'META-INF/androidx.appcompat_appcompat.version'
+        exclude 'META-INF/androidx.swiperefreshlayout_swiperefreshlayout.version'
+        exclude 'META-INF/androidx.print_print.version'
+        exclude 'META-INF/androidx.documentfile_documentfile.version'
+        exclude 'META-INF/androidx.loader_loader.version'
+        exclude 'META-INF/androidx.viewpager_viewpager.version'
+        exclude 'META-INF/androidx.coordinatorlayout_coordinatorlayout.version'
+        exclude 'META-INF/androidx.versionedparcelable_versionedparcelable.version'
+        exclude 'META-INF/androidx.cursoradapter_cursoradapter.version'
+        exclude 'META-INF/androidx.fragment_fragment.version'
+        exclude 'META-INF/androidx.vectordrawable_vectordrawable.version'
+        exclude 'META-INF/androidx.asynclayoutinflater_asynclayoutinflater.version'
+        exclude 'META-INF/androidx.core_core.version'
+        exclude 'META-INF/androidx.vectordrawable_vectordrawable-animated.version'
     }
 
     buildTypes {

+ 11 - 0
app/proguard-rules.pro

@@ -70,6 +70,17 @@
     public static **[] values();
     public static ** valueOf(java.lang.String);
 }
+-dontwarn dalvik.**
+-dontwarn com.tencent.smtt.**
+
+-keep class com.tencent.smtt.** {
+    *;
+}
+
+-keep class com.tencent.tbs.** {
+    *;
+}
+
 -keep class com.tencent.open.TDialog$*
 -keep class com.tencent.open.TDialog$* {*;}
 -keep class com.tencent.open.PKDialog

+ 9 - 1
app/src/main/AndroidManifest.xml

@@ -65,7 +65,15 @@
             android:persistent="true"
             android:supportsRtl="true"
             android:theme="@style/AppTheme"
-            android:usesCleartextTraffic="true">
+            android:usesCleartextTraffic="true"
+            tools:replace="android:appComponentFactory"
+            android:appComponentFactory="sheep">
+
+        <service
+                android:name="com.tencent.smtt.export.external.DexClassLoaderProviderService"
+                android:label="dexopt"
+                android:process=":dexopt" >
+        </service>
 
         <activity
                 android:name="com.sheep.gamegroup.module.task.VideoTaskActivity"

+ 11 - 8
app/src/main/java/com/sheep/jiuyan/samllsheep/SheepApp.java

@@ -54,6 +54,7 @@ import com.tencent.klevin.KleinManager;
 import com.tencent.klevin.base.callback.KleinResponseCallback;
 import com.tencent.mm.opensdk.openapi.IWXAPI;
 import com.tencent.mm.opensdk.openapi.WXAPIFactory;
+import com.tencent.smtt.export.external.TbsCoreSettings;
 import com.tencent.smtt.sdk.QbSdk;
 import com.stmsdk.AbsTMSConfig;
 import com.stmsdk.TMSDKContext;
@@ -61,16 +62,11 @@ import com.tencent.smtt.sdk.WebView;
 import com.umeng.commonsdk.UMConfigure;
 import com.umeng.socialize.PlatformConfig;
 import com.youmi.android.offer.YmConfig;
-import io.reactivex.Observable;
-import io.reactivex.ObservableSource;
-import io.reactivex.Observer;
 import io.reactivex.android.schedulers.AndroidSchedulers;
-import io.reactivex.functions.Function;
 import io.reactivex.schedulers.Schedulers;
 import org.xutils.x;
-
 import java.lang.ref.WeakReference;
-
+import java.util.HashMap;
 import cn.jpush.android.api.JPushInterface;
 import io.reactivex.plugins.RxJavaPlugins;
 import ren.yale.android.cachewebviewlib.WebViewCacheInterceptor;
@@ -439,7 +435,7 @@ public class SheepApp extends MultiDexApplication {
         } else {
             G.BAR_HEIGHT = (int) (25 * metric.density);//不准确的方法
         }
-        QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() {
+        /*QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() {
             @Override
             public void onCoreInitFinished() {
                 LogUtil.println("SheepApp", "QbSdk", "initX5Environment", "onCoreInitFinished");
@@ -450,7 +446,14 @@ public class SheepApp extends MultiDexApplication {
                 LogUtil.println("SheepApp", "QbSdk", "initX5Environment", "onViewInitFinished", b);
 
             }
-        });
+        });*/
+
+        // 在调用TBS初始化、创建WebView之前进行如下配置
+        HashMap map = new HashMap();
+        map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true);
+        map.put(TbsCoreSettings.TBS_SETTINGS_USE_DEXLOADER_SERVICE, true);
+        QbSdk.initTbsSettings(map);
+
         x.Ext.init(this);
         x.Ext.setDebug(org.xutils.BuildConfig.DEBUG); // 是否输出debug日志, 开启debug会影响性能.
 

+ 2 - 1
view/build.gradle

@@ -32,7 +32,8 @@ android {
 dependencies {
     implementation "com.android.support:appcompat-v7:$supportLibVersion"
     implementation "com.android.support:support-v4:$supportLibVersion"
-    api files('libs/tbs_sdk_thirdapp_v4.3.0.1072_43646.jar')
+    //api 'com.tencent.tbs.tbssdk:sdk:43939'
+    api files('libs/tbs_sdk_thirdapp_v4.3.0.93_43993_sharewithdownloadwithfile_withoutGame_obfs_20210220_114728.jar')
 //    api files('libs/tbs_sdk_thirdapp_v3.6.0.1325.jar')
     //    implementation 'com.github.bumptech.glide:glide:3.7.0'
     //    implementation ('jp.wasabeef:glide-transformations:2.0.2'){

BIN
view/libs/tbs_sdk_thirdapp_v4.3.0.1072_43646.jar


BIN
view/libs/tbs_sdk_thirdapp_v4.3.0.93_43993_sharewithdownloadwithfile_withoutGame_obfs_20210220_114728.jar


+ 11 - 0
view/proguard-rules.pro

@@ -15,3 +15,14 @@
 #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
 #   public *;
 #}
+
+-dontwarn dalvik.**
+-dontwarn com.tencent.smtt.**
+
+-keep class com.tencent.smtt.** {
+    *;
+}
+
+-keep class com.tencent.tbs.** {
+    *;
+}