Forráskód Böngészése

1.修改渠道使用方式

FailedToRead 1 éve
szülő
commit
f05b32a129

+ 3 - 1
app-base/src/main/java/com/edufound/base/BaseApplication.java

@@ -16,6 +16,7 @@ import android.view.Gravity;
 import androidx.annotation.RequiresApi;
 
 import com.edufound.base.activity.CrashDialogActivity;
+import com.edufound.base.bean.ChannelCodeEnum;
 import com.edufound.base.crash.Cockroach;
 import com.edufound.base.crash.CrashLog;
 import com.edufound.base.crash.DebugSafeModeTipActivity;
@@ -51,7 +52,7 @@ public class BaseApplication implements ModuleMediator.ModuleInitial {
             if (!BaseConsts.isDebug()) {
                 Logger.e("Consts.isDebug:" + BaseConsts.isDebug());
                 //不在测试环境下,初始化异常
-//                initException(application);
+                initException(application);
             }
             //初始化mmkv
             MMKV.initialize(application);
@@ -85,6 +86,7 @@ public class BaseApplication implements ModuleMediator.ModuleInitial {
             e.printStackTrace();
         }
 
+
     }
 
 

+ 41 - 61
app-base/src/main/java/com/edufound/base/bean/ChannelCodeEnum.java

@@ -1,69 +1,49 @@
 package com.edufound.base.bean;
 
-public enum ChannelCodeEnum {
-    YIFANG {
-        public String getChannelCode() {//枚举对象实现抽象方法
-            return "3006";
-        }
-    },
-    BAIDU {
-        //百度
-        public String getChannelCode() {//枚举对象实现抽象方法
-            return "3003";
-        }
-    },
-    TMALL {
-        //天猫
-        public String getChannelCode() {//枚举对象实现抽象方法
-            return "3002";
-        }
-    },
-    MISOUND {
-        //小米
-        public String getChannelCode() {//枚举对象实现抽象方法
-            return "2016";
-        }
-    },
 
-    LENOVO_PAD {
-        //联想
-        public String getChannelCode() {//枚举对象实现抽象方法
-            return "3004";
-        }
-    },
-    JINGDONGFANG {
-        //京东方
-        public String getChannelCode() {//枚举对象实现抽象方法
-            return "3007";
-        }
-    },
-    HUAWEI_LIANYUN {
-        //华为联运
-        public String getChannelCode() {//枚举对象实现抽象方法
-            return "3008";
-        }
-    },
-    BUBUGAO {
-        //步步高
-        public String getChannelCode() {
-            return "3009";
-        }
-    },
+import androidx.annotation.StringDef;
 
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
 
-    XUNFEI {
-        //讯飞
-        public String getChannelCode() {
-            return "3010";
-        }
-    },
-    BAIDU_XUEXIJI {
-        //百度学习机
-        public String getChannelCode() {
-            return "3011";
-        }
-    };
+@Retention(RetentionPolicy.SOURCE)
+@StringDef(
+        {
+                ChannelCodeEnum.YIFANG,
+                ChannelCodeEnum.BAIDU,
+                ChannelCodeEnum.TMALL,
+                ChannelCodeEnum.MISOUND,
+                ChannelCodeEnum.LENOVO_PAD,
+                ChannelCodeEnum.JINGDONGFANG,
+                ChannelCodeEnum.HUAWEI_LIANYUN,
+                ChannelCodeEnum.BUBUGAO,
+                ChannelCodeEnum.XUNFEI,
+                ChannelCodeEnum.BAIDU_XUEXIJI,
+                ChannelCodeEnum.YYB_PAD,
+        }
+)
+public @interface ChannelCodeEnum {
+    String YIFANG = "3006";
+
+    String BAIDU = "3003";
+
+    String TMALL = "3002";
+
+    String MISOUND = "2016";
+
+    String LENOVO_PAD = "3004";
+
+    String JINGDONGFANG = "3007";
+
+    String HUAWEI_LIANYUN = "3008";
+
+    String BUBUGAO = "3009";
+
+    String XUNFEI = "3010";
+
+    String BAIDU_XUEXIJI = "3011";
+
+    String YYB_PAD = "3012";
 
 
-    public abstract String getChannelCode();//定义抽象方法
 }

+ 3 - 3
app-base/src/main/java/com/edufound/base/receiver/HomeKeyEventReceiver.java

@@ -24,9 +24,9 @@ public class HomeKeyEventReceiver extends BroadcastReceiver {
             String reason = intent.getStringExtra(SYSTEM_REASON);
 
             if (TextUtils.equals(reason, SYSTEM_HOME_KEY)) {
-                if (BaseConsts.getUMengChannel().equals(ChannelCodeEnum.TMALL.getChannelCode())
-                        || BaseConsts.getUMengChannel().equals(ChannelCodeEnum.BAIDU.getChannelCode())
-                        || BaseConsts.getUMengChannel().equals(ChannelCodeEnum.MISOUND.getChannelCode())) {
+                if (BaseConsts.getUMengChannel().equals(ChannelCodeEnum.TMALL)
+                        || BaseConsts.getUMengChannel().equals(ChannelCodeEnum.BAIDU)
+                        || BaseConsts.getUMengChannel().equals(ChannelCodeEnum.MISOUND)) {
                     //如果是天猫、小度、小米音响,则按home直接退出apk
                     BaseApplication.killAppProcess(context);
                 }

BIN
app-video/libs/arm64-v8a/libijkffmpeg.so


BIN
app-video/libs/arm64-v8a/libijkplayer.so


BIN
app-video/libs/arm64-v8a/libijksdl.so


BIN
app-video/libs/armeabi-v7a/libijkffmpeg.so


BIN
app-video/libs/armeabi-v7a/libijkplayer.so


BIN
app-video/libs/armeabi-v7a/libijksdl.so


BIN
app-video/libs/armeabi/libijkffmpeg.so


BIN
app-video/libs/armeabi/libijkplayer.so


BIN
app-video/libs/armeabi/libijksdl.so


BIN
app-video/libs/x86/libijkffmpeg.so


BIN
app-video/libs/x86/libijkplayer.so


BIN
app-video/libs/x86/libijksdl.so


BIN
app-video/libs/x86_64/libijkffmpeg.so


BIN
app-video/libs/x86_64/libijkplayer.so


BIN
app-video/libs/x86_64/libijksdl.so


+ 3 - 0
app/src/main/java/com/edufound/model/activity/MainActivity.java

@@ -6,6 +6,7 @@ import android.view.View;
 
 import com.edufound.base.BaseMvpActivity;
 import com.edufound.base.ModuleMediator;
+import com.edufound.base.bean.ChannelCodeEnum;
 import com.edufound.base.util.BaseConsts;
 import com.edufound.base.util.DeviceUuidFactory;
 import com.edufound.model.databinding.ActivityMainBinding;
@@ -15,6 +16,7 @@ import com.edufound.model.presenter.MainPresenter;
 import com.edufound.model.view.MainView;
 import com.edufound.video.bean.VideoData;
 import com.hjq.toast.Toaster;
+import com.orhanobut.logger.Logger;
 
 
 public class MainActivity extends BaseMvpActivity<MainModel, MainView, MainPresenter> implements MainView {
@@ -77,6 +79,7 @@ public class MainActivity extends BaseMvpActivity<MainModel, MainView, MainPrese
         addUiClickListener(mViewBind.toPay, new View.OnClickListener() {
             @Override
             public void onClick(View v) {
+                Logger.e(" BaseConsts.getUMengChannel().equals(ChannelCodeEnum.YIFANG);" + (BaseConsts.getUMengChannel().equals(ChannelCodeEnum.YIFANG)));
                 startActivity(ModuleMediator.ACTIVITY_PAY_CLASS);
 //                String uuid = DeviceUuidFactory.getUuid();
 //                CusToast.getInstance(mActivity).show("uuid:" + uuid, 10000);