ソースを参照

1.修改包名
2.增加渠道等
3.增加RetryInterceptor网络重试
4.替换ijkplayer的so包

FailedToRead 1 年間 前
コミット
342976c990
100 ファイル変更52334 行追加709 行削除
  1. 6 0
      app-base/build.gradle
  2. 1 1
      app-base/src/androidTest/java/com/efunbox/base/ExampleInstrumentedTest.java
  3. 12 3
      app-base/src/main/AndroidManifest.xml
  4. 2 2
      app-base/src/main/AndroidManifestDebug.xml
  5. 50 0
      app-base/src/main/assets/fqc.dic
  6. 49666 0
      app-base/src/main/assets/wfc.dic
  7. 240 0
      app-base/src/main/java/com/edufound/base/BaseApplication.java
  8. 1 1
      app-base/src/main/java/com/efunbox/base/BaseMvp.java
  9. 119 13
      app-base/src/main/java/com/efunbox/base/BaseMvpActivity.java
  10. 93 0
      app-base/src/main/java/com/edufound/base/BaseMvpFragment.java
  11. 4 3
      app-base/src/main/java/com/efunbox/base/BasePresenter.java
  12. 1 1
      app-base/src/main/java/com/efunbox/base/Model.java
  13. 7 8
      app-base/src/main/java/com/efunbox/base/ModuleMediator.java
  14. 1 1
      app-base/src/main/java/com/efunbox/base/Presenter.java
  15. 1 1
      app-base/src/main/java/com/efunbox/base/View.java
  16. 11 14
      app-base/src/main/java/com/efunbox/base/activity/CrashDialogActivity.java
  17. 1 1
      app-base/src/main/java/com/efunbox/base/annotation/BindView.java
  18. 69 0
      app-base/src/main/java/com/edufound/base/bean/ChannelCodeEnum.java
  19. 1 1
      app-base/src/main/java/com/efunbox/base/bean/HttpResultBean.java
  20. 1 1
      app-base/src/main/java/com/efunbox/base/bean/HttpResultDataListBean.java
  21. 268 0
      app-base/src/main/java/com/edufound/base/bean/UserBean.java
  22. 1 1
      app-base/src/main/java/com/efunbox/base/bean/WeChatBean.java
  23. 1 1
      app-base/src/main/java/com/efunbox/base/callback/OkHttpCallback.java
  24. 1 1
      app-base/src/main/java/com/efunbox/base/crash/ActivityKillerV15_V20.java
  25. 1 1
      app-base/src/main/java/com/efunbox/base/crash/ActivityKillerV21_V23.java
  26. 1 1
      app-base/src/main/java/com/efunbox/base/crash/ActivityKillerV24_V25.java
  27. 1 1
      app-base/src/main/java/com/efunbox/base/crash/ActivityKillerV26.java
  28. 1 1
      app-base/src/main/java/com/efunbox/base/crash/ActivityKillerV28.java
  29. 1 1
      app-base/src/main/java/com/efunbox/base/crash/ActivityLifecycleCallbacksAdapter.java
  30. 1 1
      app-base/src/main/java/com/efunbox/base/crash/ClientTransaction.java
  31. 1 1
      app-base/src/main/java/com/efunbox/base/crash/Cockroach.java
  32. 1 1
      app-base/src/main/java/com/efunbox/base/crash/CrashLog.java
  33. 3 3
      app-base/src/main/java/com/efunbox/base/crash/DebugSafeModeTipActivity.java
  34. 1 1
      app-base/src/main/java/com/efunbox/base/crash/DebugSafeModeUI.java
  35. 1 1
      app-base/src/main/java/com/efunbox/base/crash/ExceptionHandler.java
  36. 1 1
      app-base/src/main/java/com/efunbox/base/crash/IActivityKiller.java
  37. 1 1
      app-base/src/main/java/com/efunbox/base/crash/LinearTopSmoothScroller.java
  38. 5 3
      app-pay/src/main/java/com/efunbox/pay/debug/MyApplication.java
  39. 3 3
      app-base/src/main/java/com/efunbox/base/fragment/CrashLogFragment.java
  40. 6 0
      app-base/src/main/java/com/edufound/base/model/CrashActivityModel.java
  41. 6 0
      app-base/src/main/java/com/edufound/base/model/impl/CrashActivityModelImpl.java
  42. 102 0
      app-base/src/main/java/com/edufound/base/popupwindow/PopWindowUtil.java
  43. 12 0
      app-base/src/main/java/com/edufound/base/presenter/CrashActivityPresenter.java
  44. 39 0
      app-base/src/main/java/com/edufound/base/receiver/HomeKeyEventReceiver.java
  45. 95 0
      app-base/src/main/java/com/edufound/base/receiver/NetworkChangeReceiver.java
  46. 78 0
      app-base/src/main/java/com/edufound/base/receiver/PageLoadingReceiver.java
  47. 184 0
      app-base/src/main/java/com/edufound/base/util/BaseConsts.java
  48. 18 0
      app-base/src/main/java/com/edufound/base/util/BaseParamsKey.java
  49. 1 1
      app-base/src/main/java/com/efunbox/base/util/DataCleanManager.java
  50. 1 1
      app-base/src/main/java/com/efunbox/base/util/DeviceUtil.java
  51. 1 1
      app-base/src/main/java/com/efunbox/base/util/DeviceUuidFactory.java
  52. 38 27
      app-base/src/main/java/com/efunbox/base/util/EfunboxUtil.java
  53. 2 2
      app-base/src/main/java/com/efunbox/base/util/GlideUtils.java
  54. 13 6
      app-base/src/main/java/com/efunbox/base/util/HttpInterceptor.java
  55. 617 0
      app-base/src/main/java/com/edufound/base/util/KeyWordFilter.java
  56. 1 1
      app-base/src/main/java/com/efunbox/base/util/Logger.java
  57. 1 1
      app-base/src/main/java/com/efunbox/base/util/MMKVUtil.java
  58. 27 0
      app-base/src/main/java/com/edufound/base/util/NetworkUtil.java
  59. 147 0
      app-base/src/main/java/com/edufound/base/util/OkHttpClient.java
  60. 1 1
      app-base/src/main/java/com/efunbox/base/util/QRCodeUtil.java
  61. 32 0
      app-base/src/main/java/com/edufound/base/util/RetryInterceptor.java
  62. 1 1
      app-base/src/main/java/com/efunbox/base/util/SizeUtils.java
  63. 1 1
      app-base/src/main/java/com/efunbox/base/util/TimeUtil.java
  64. 62 0
      app-base/src/main/java/com/edufound/base/util/WordFilter.java
  65. 6 0
      app-base/src/main/java/com/edufound/base/view/CrashActivityView.java
  66. 0 58
      app-base/src/main/java/com/efunbox/base/BaseMvpFragment.java
  67. 0 123
      app-base/src/main/java/com/efunbox/base/MyApplication.java
  68. 0 125
      app-base/src/main/java/com/efunbox/base/cusview/CusToast.java
  69. 0 6
      app-base/src/main/java/com/efunbox/base/model/CrashActivityModel.java
  70. 0 6
      app-base/src/main/java/com/efunbox/base/model/impl/CrashActivityModelImpl.java
  71. 0 12
      app-base/src/main/java/com/efunbox/base/presenter/CrashActivityPresenter.java
  72. 0 41
      app-base/src/main/java/com/efunbox/base/util/BaseConsts.java
  73. 0 108
      app-base/src/main/java/com/efunbox/base/util/OkHttpClient.java
  74. 0 6
      app-base/src/main/java/com/efunbox/base/view/CrashActivityView.java
  75. BIN
      app-base/src/main/res/drawable/background_white.png
  76. 22 27
      app-base/src/main/res/layout/toast.xml
  77. 33 0
      app-base/src/main/res/layout/window_deviceinfo.xml
  78. 1 1
      app-base/src/test/java/com/efunbox/base/ExampleUnitTest.java
  79. 1 1
      app-pay/build.gradle
  80. 3 3
      app-pay/src/main/AndroidManifest.xml
  81. 4 4
      app-pay/src/main/AndroidManifestDebug.xml
  82. 6 7
      app-pay/src/main/java/com/efunbox/pay/MyApplication.java
  83. 19 13
      app-pay/src/main/java/com/efunbox/pay/PayActivity.java
  84. 3 4
      app-base/src/main/java/com/efunbox/base/debug/MyApplication.java
  85. 18 0
      app-pay/src/main/java/com/edufound/pay/model/PayModel.java
  86. 13 0
      app-pay/src/main/java/com/edufound/pay/model/WXEntryModel.java
  87. 30 0
      app-pay/src/main/java/com/edufound/pay/model/impl/PayModelImpl.java
  88. 20 0
      app-pay/src/main/java/com/edufound/pay/model/impl/WXEntryModelImpl.java
  89. 36 0
      app-pay/src/main/java/com/edufound/pay/presenter/PayPresenter.java
  90. 11 14
      app-pay/src/main/java/com/efunbox/pay/presenter/WXEntryPresenter.java
  91. 5 7
      app-pay/src/main/java/com/efunbox/pay/util/LoginUtil.java
  92. 1 1
      app-pay/src/main/java/com/efunbox/pay/util/MD5Utils.java
  93. 7 0
      app-pay/src/main/java/com/edufound/pay/util/PayConsts.java
  94. 1 1
      app-pay/src/main/java/com/efunbox/pay/util/PayUtil.java
  95. 6 0
      app-pay/src/main/java/com/edufound/pay/view/PayView.java
  96. 6 0
      app-pay/src/main/java/com/edufound/pay/view/WXEntryView.java
  97. 12 14
      app-pay/src/main/java/com/efunbox/pay/wxapi/WXEntryActivity.java
  98. 3 3
      app-pay/src/main/java/com/efunbox/pay/wxapi/WXPayEntryActivity.java
  99. 0 6
      app-pay/src/main/java/com/efunbox/pay/model/PayModel.java
  100. 0 0
      app-pay/src/main/java/com/efunbox/pay/model/WXEntryModel.java

+ 6 - 0
app-base/build.gradle

@@ -37,11 +37,17 @@ dependencies {
     api userLibs.get('glide_transformations')
     api userLibs.get('freereflection')
     api userLibs.get('orhanbutlogger')
+    api userLibs.get('LongImage')
+    api userLibs.get('Toaster')
+
     //全局共用一个点击时间
     implementation 'cc.taylorzhang:single-click:1.1.0'
     //zxing
     implementation 'com.google.zxing:android-core:3.3.0'
     implementation 'com.google.zxing:core:3.3.2'
+    //友盟统计SDK
+    api 'com.umeng.umsdk:common:9.5.0'// 必选
+    api 'com.umeng.umsdk:asms:1.4.1'// 必选
 
     testImplementation testLibs.get('junit')
     androidTestImplementation testLibs.get('junitAndroid')

+ 1 - 1
app-base/src/androidTest/java/com/efunbox/base/ExampleInstrumentedTest.java

@@ -1,4 +1,4 @@
-package com.efunbox.base;
+package com.edufound.base;
 
 import android.content.Context;
 

+ 12 - 3
app-base/src/main/AndroidManifest.xml

@@ -1,19 +1,28 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.efunbox.base">
+    package="com.edufound.base">
 
     <application android:allowBackup="true">
 
         <activity
-            android:name=".activity.CrashDialogActivity"
+            android:name="com.edufound.base.activity.CrashDialogActivity"
             android:exported="true"
             android:theme="@style/FullScreen"></activity>
 
         <activity
-            android:name=".crash.DebugSafeModeTipActivity"
+            android:name="com.edufound.base.crash.DebugSafeModeTipActivity"
             android:exported="true"
             android:theme="@style/FullScreen"></activity>
 
+        <!-- 友盟start -->
+        <meta-data
+            android:name="UMENG_APPKEY"
+            android:value="" />
+        <meta-data
+            android:name="UMENG_CHANNEL"
+            android:value="${UMENG_CHANNEL_VALUE}" />
+        <!-- 友盟end -->
+
     </application>
 
 </manifest>

+ 2 - 2
app-base/src/main/AndroidManifestDebug.xml

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.efunbox.base">
+    package="com.edufound.base">
 
     <application
-        android:name="com.efunbox.base.debug.MyApplication"
+        android:name="com.edufound.base.debug.MyApplication"
         android:allowBackup="true"
        >
     </application>

+ 50 - 0
app-base/src/main/assets/fqc.dic

@@ -0,0 +1,50 @@
+南宁市永安@@南宁市永⊙安
+硫酸亚铁@@硫⊙酸亚铁
+硫酸铁@@硫⊙酸铁
+硫酸镁@@硫⊙酸镁
+成人学校@@成⊙人学校
+成人高考@@成⊙人高考
+蛋白粉@@蛋白⊙粉
+屏蔽电缆@@屏⊙蔽电缆
+钛白粉@@钛白⊙粉
+华莉达弹簧@@华莉达弹⊙簧
+沙发转盘@@沙发转⊙盘
+艺博彩鸿@@艺博⊙彩鸿
+屏蔽线@@屏⊙蔽线
+屏蔽网络线@@屏⊙蔽网络线
+隐形纱窗@@隐⊙形纱窗
+现代办公@@现代⊙办公
+钻枪支架@@钻枪⊙支架
+一次性用品@@一次性⊙用品
+广东王牌@@广东⊙王牌
+永康市@@永⊙康市
+门口交易@@门口⊙交易
+感情色彩@@感情⊙色彩
+港口交通@@港口⊙交通
+路口交通@@路口⊙交通
+口交换机@@口⊙交换机
+宝鸡巴士@@宝鸡⊙巴士
+江阴道路@@江阴⊙道路
+千百度@@千百⊙度
+解放军7@@解⊙放军7
+解放军七@@解⊙放军七
+茅台镇@@茅⊙台镇
+优阳科技@@优⊙阳科技
+打折机票预订@@打折机⊙票预订
+三螺@@三⊙螺
+3螺@@3⊙螺
+漂白粉@@漂白⊙粉
+电动车@@电动⊙车
+硫酸泵@@硫⊙酸泵
+硫酸离心泵@@硫⊙酸离心泵
+硫酸液下泵@@硫⊙酸液下泵
+硫酸钡@@硫⊙酸钡
+硫酸铵@@硫⊙酸铵
+ngcd@@ng⊙cd
+铅丝石笼@@铅⊙丝石笼
+ISO认证@@ISO认⊙证
+UC4@@UC⊙4
+厨房刀具@@厨房刀⊙具
+兽药@@兽⊙药
+电动门遥控器@@电动门遥控⊙器
+卷帘门遥控器@@卷帘门遥控⊙器

ファイルの差分が大きいため隠しています
+ 49666 - 0
app-base/src/main/assets/wfc.dic


+ 240 - 0
app-base/src/main/java/com/edufound/base/BaseApplication.java

@@ -0,0 +1,240 @@
+package com.edufound.base;
+
+import android.app.Activity;
+import android.app.ActivityManager;
+import android.app.Application;
+import android.content.Context;
+import android.content.Intent;
+import android.content.pm.ApplicationInfo;
+import android.content.pm.PackageManager;
+import android.os.Build;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Looper;
+import android.view.Gravity;
+
+import androidx.annotation.RequiresApi;
+
+import com.edufound.base.activity.CrashDialogActivity;
+import com.edufound.base.crash.Cockroach;
+import com.edufound.base.crash.CrashLog;
+import com.edufound.base.crash.DebugSafeModeTipActivity;
+import com.edufound.base.crash.DebugSafeModeUI;
+import com.edufound.base.crash.ExceptionHandler;
+import com.edufound.base.util.BaseConsts;
+import com.edufound.base.util.GlideUtils;
+import com.edufound.base.util.OkHttpClient;
+import com.edufound.base.util.WordFilter;
+import com.hjq.toast.ToastStrategy;
+import com.hjq.toast.Toaster;
+import com.orhanobut.logger.Logger;
+import com.tencent.mmkv.MMKV;
+import com.umeng.analytics.MobclickAgent;
+import com.umeng.commonsdk.UMConfigure;
+
+import org.xmlpull.v1.XmlPullParserException;
+import org.xmlpull.v1.XmlPullParserFactory;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class BaseApplication implements ModuleMediator.ModuleInitial {
+
+    public static List<Activity> mActivityList = new ArrayList<>();
+
+
+    @Override
+    public void initModule(Application application) {
+        try {
+            BaseConsts.setAppPackageName(application.getPackageName());
+            //初始化异常
+            if (!BaseConsts.isDebug()) {
+                Logger.e("Consts.isDebug:" + BaseConsts.isDebug());
+                //不在测试环境下,初始化异常
+//                initException(application);
+            }
+            //初始化mmkv
+            MMKV.initialize(application);
+            //初始化toaster
+            Toaster.init(application);
+            Toaster.setStrategy(new ToastStrategy());
+            Toaster.setGravity(Gravity.CENTER);
+            Toaster.setView(R.layout.toast);
+            //初始化OKhttp3
+            OkHttpClient.initOkHttpUtil(application);
+            //修改xml问题
+            XmlPullParserFactory.newInstance().setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
+            //初始化友盟
+            UMConfigure.setLogEnabled(true);
+            UMConfigure.preInit(application, getUmengAppKey(application), getUmengChannel(application));
+            BaseConsts.setUID("test");
+            MobclickAgent.setPageCollectionMode(MobclickAgent.PageMode.AUTO);
+            application.registerActivityLifecycleCallbacks(activityLifecycleCallbacks);
+            BaseConsts.mWordFilter = new WordFilter();
+            //清除图片缓存
+            new Thread() {
+                @Override
+                public void run() {
+                    super.run();
+                    GlideUtils.removeAll(application);
+                    BaseConsts.mWordFilter.filter_jk_info2("初始化");
+                }
+            }.start();
+
+        } catch (XmlPullParserException e) {
+            e.printStackTrace();
+        }
+
+    }
+
+
+    private void initException(Application application) {
+
+        final Thread.UncaughtExceptionHandler sysExcepHandler = Thread.getDefaultUncaughtExceptionHandler();
+        DebugSafeModeUI.init(application);
+        Cockroach.install(application, new ExceptionHandler() {
+            @Override
+            protected void onUncaughtExceptionHappened(Thread thread, Throwable throwable) {
+                CrashLog.saveCrashLog(application, throwable);
+                new Handler(Looper.getMainLooper()).post(new Runnable() {
+                    @Override
+                    public void run() {
+                        Logger.e("Cockroach.install:onUncaughtExceptionHappened");
+                    }
+                });
+            }
+
+            @Override
+            protected void onBandageExceptionHappened(Throwable throwable) {
+                throwable.printStackTrace();//打印警告级别log,该throwable可能是最开始的bug导致的,无需关心
+            }
+
+            @Override
+            protected void onEnterSafeMode() {
+//                int tips = R.string.safe_mode_tips;
+//                Toast.makeText(Consts.getmApplicAtion(), getResources().getString(tips), Toast.LENGTH_LONG).show();
+//                DebugSafeModeUI.showSafeModeUI();
+
+                if (BaseConsts.isDebug()) {
+                    Intent intent = new Intent(application, DebugSafeModeTipActivity.class);
+                    intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
+                    application.startActivity(intent);
+                } else {
+                    Intent intent = new Intent(application, CrashDialogActivity.class);
+                    intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
+                    application.startActivity(intent);
+                }
+            }
+
+            @RequiresApi(api = Build.VERSION_CODES.N)
+            @Override
+            protected void onMayBeBlackScreen(Throwable e) {
+                Thread thread = Looper.getMainLooper().getThread();
+                e.printStackTrace();
+                //黑屏时建议直接杀死app
+                sysExcepHandler.uncaughtException(thread, new RuntimeException("black screen"));
+                killAppProcess(application);
+            }
+
+        });
+
+    }
+
+
+    public static void killAppProcess(Context context) {
+
+        for (int i = 0; i < mActivityList.size(); i++) {
+            mActivityList.get(i).finish();
+        }
+        //注意:不能先杀掉主进程,否则逻辑代码无法继续执行,需先杀掉相关进程最后杀掉主进程
+        //杀掉umeng得进程
+        MobclickAgent.onKillProcess(context.getApplicationContext());
+        ActivityManager mActivityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
+        List<ActivityManager.RunningAppProcessInfo> mList = mActivityManager.getRunningAppProcesses();
+        if (mList != null) {
+            for (ActivityManager.RunningAppProcessInfo runningAppProcessInfo : mList) {
+                if (runningAppProcessInfo.pid != android.os.Process.myPid()) {
+                    android.os.Process.killProcess(runningAppProcessInfo.pid);
+                }
+            }
+            android.os.Process.killProcess(android.os.Process.myPid());
+        }
+    }
+
+    public String getUmengChannel(Application application) {
+        String channelName = null;
+        try {
+            PackageManager packageManager = application.getPackageManager();
+            if (packageManager != null) {
+                //注意此处为ApplicationInfo 而不是 ActivityInfo,因为友盟设置的meta-data是在application标签中,而不是某activity标签中,所以用ApplicationInfo
+                ApplicationInfo applicationInfo = packageManager.
+                        getApplicationInfo(application.getPackageName(), PackageManager.GET_META_DATA);
+                if (applicationInfo != null) {
+                    if (applicationInfo.metaData != null) {
+                        channelName = String.valueOf(applicationInfo.metaData.get("UMENG_CHANNEL"));
+                        BaseConsts.setUMengChannel(channelName);
+                    }
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return channelName;
+    }
+
+
+    public String getUmengAppKey(Application application) {
+        String appkey = null;
+        try {
+            PackageManager packageManager = application.getPackageManager();
+            if (packageManager != null) {
+                //注意此处为ApplicationInfo 而不是 ActivityInfo,因为友盟设置的meta-data是在application标签中,而不是某activity标签中,所以用ApplicationInfo
+                ApplicationInfo applicationInfo = packageManager.
+                        getApplicationInfo(application.getPackageName(), PackageManager.GET_META_DATA);
+                if (applicationInfo != null) {
+                    if (applicationInfo.metaData != null) {
+                        appkey = String.valueOf(applicationInfo.metaData.get("UMENG_APPKEY"));
+                        BaseConsts.setUMengAppkey(appkey);
+                    }
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return appkey;
+    }
+
+
+    Application.ActivityLifecycleCallbacks activityLifecycleCallbacks = new Application.ActivityLifecycleCallbacks() {
+        @Override
+        public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
+            mActivityList.add(activity);
+        }
+
+        @Override
+        public void onActivityStarted(Activity activity) {
+        }
+
+        @Override
+        public void onActivityResumed(Activity activity) {
+        }
+
+        @Override
+        public void onActivityPaused(Activity activity) {
+        }
+
+        @Override
+        public void onActivityStopped(Activity activity) {
+
+        }
+
+        @Override
+        public void onActivitySaveInstanceState(Activity activity, Bundle outState) {
+        }
+
+        @Override
+        public void onActivityDestroyed(Activity activity) {
+            mActivityList.remove(activity);
+        }
+    };
+}

+ 1 - 1
app-base/src/main/java/com/efunbox/base/BaseMvp.java

@@ -1,4 +1,4 @@
-package com.efunbox.base;
+package com.edufound.base;
 
 public interface BaseMvp<M extends Model, V extends View, P extends BasePresenter> {
     M createModel();

+ 119 - 13
app-base/src/main/java/com/efunbox/base/BaseMvpActivity.java

@@ -1,19 +1,28 @@
-package com.efunbox.base;
+package com.edufound.base;
 
 import android.app.Activity;
 import android.content.Context;
 import android.content.Intent;
 import android.content.pm.PackageManager;
+import android.os.Build;
 import android.os.Bundle;
+import android.os.IBinder;
+import android.view.MotionEvent;
 import android.view.ViewGroup;
 import android.view.WindowManager;
+import android.view.inputmethod.InputMethodManager;
+import android.widget.AdapterView;
+import android.widget.EditText;
 import android.widget.Toast;
 
 import androidx.appcompat.app.AppCompatActivity;
 
-import com.efunbox.base.annotation.BindView;
-import com.efunbox.base.util.BaseConsts;
-import com.efunbox.base.util.EfunboxUtil;
+import com.edufound.base.annotation.BindView;
+import com.edufound.base.util.BaseConsts;
+import com.edufound.base.util.EfunboxUtil;
+import com.edufound.base.util.OkHttpClient;
+import com.google.gson.Gson;
+import com.okhttplib.OkHttpUtil;
 
 import java.lang.reflect.Field;
 import java.lang.reflect.InvocationTargetException;
@@ -26,13 +35,14 @@ public abstract class BaseMvpActivity<M extends Model, V extends View, P extends
 
     protected P mPresenter;
     protected BaseMvpActivity mActivity;
-
+    Gson mGson;
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         getWindow().setFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON, WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
         getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
+        hideBottomUIMenu();
         EfunboxUtil.initDesignSize(this);
         if (this.getLayoutId() != 0) {
             setContentView(this.getLayoutId());
@@ -42,7 +52,7 @@ public abstract class BaseMvpActivity<M extends Model, V extends View, P extends
         }
 
         mActivity = this;
-        MyApplication.mActivityList.add(mActivity);
+        mGson = new Gson();
         bindViews(mActivity);
         //创建Presenter
         mPresenter = createPresenter();
@@ -58,12 +68,6 @@ public abstract class BaseMvpActivity<M extends Model, V extends View, P extends
     }
 
 
-    @Override
-    protected void onDestroy() {
-        super.onDestroy();
-        MyApplication.mActivityList.remove(mActivity);
-    }
-
     /**
      * 设置布局
      *
@@ -109,7 +113,6 @@ public abstract class BaseMvpActivity<M extends Model, V extends View, P extends
 
 
     public ViewGroup getRootView() {
-
         return findViewById(android.R.id.content);
     }
 
@@ -167,6 +170,15 @@ public abstract class BaseMvpActivity<M extends Model, V extends View, P extends
     }
 
 
+    public void startActivityByNewTask(Class clazz, Bundle bundle) {
+        Intent intent = new Intent(mActivity, clazz);
+        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+        if (bundle != null) {
+            intent.putExtra("params_bundle", bundle);
+        }
+        startActivity(intent);
+    }
+
     public static void bindViews(Activity activity) {
         Class<? extends Activity> activityClass = activity.getClass();//获取activity的class
         Field[] fields = activityClass.getDeclaredFields();//获取activity的字段
@@ -212,5 +224,99 @@ public abstract class BaseMvpActivity<M extends Model, V extends View, P extends
 
     }
 
+    @Override
+    public void onBackPressed() {
+        super.onBackPressed();
+    }
+
 
+    /**
+     * 获取点击事件
+     */
+    @Override
+    public boolean dispatchTouchEvent(MotionEvent ev) {
+        if (ev.getAction() == MotionEvent.ACTION_DOWN) {
+            android.view.View view = getCurrentFocus();
+            if (isHideInput(view, ev)) {
+                HideSoftInput(view.getWindowToken());
+                view.clearFocus();
+            }
+        }
+        return super.dispatchTouchEvent(ev);
+    }
+
+    /**
+     * 判定是否需要隐藏
+     */
+    private boolean isHideInput(android.view.View v, MotionEvent ev) {
+        if (v != null && (v instanceof EditText)) {
+            int[] l = {0, 0};
+            v.getLocationInWindow(l);
+            int left = l[0], top = l[1], bottom = top + v.getHeight(), right = left + v.getWidth();
+            if (ev.getX() > left && ev.getX() < right && ev.getY() > top && ev.getY() < bottom) {
+                return false;
+            } else {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /**
+     * 隐藏软键盘
+     */
+    private void HideSoftInput(IBinder token) {
+        if (token != null) {
+            InputMethodManager manager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
+            manager.hideSoftInputFromWindow(token, InputMethodManager.HIDE_NOT_ALWAYS);
+        }
+    }
+
+    public void hideBottomUIMenu() {
+        //隐藏虚拟按键,并且全屏
+        if (Build.VERSION.SDK_INT > 11 && Build.VERSION.SDK_INT < 19) { // lower api
+            this.getWindow().getDecorView().setSystemUiVisibility(android.view.View.GONE);
+        } else if (Build.VERSION.SDK_INT >= 19) {
+            //for new api versions.
+            int uiOptions = android.view.View.SYSTEM_UI_FLAG_LAYOUT_STABLE |
+                    android.view.View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |
+                    android.view.View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |
+                    android.view.View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY |
+                    android.view.View.SYSTEM_UI_FLAG_FULLSCREEN;
+            getWindow().getDecorView().setSystemUiVisibility(uiOptions);
+
+        }
+    }
+
+    private void unbindDrawables(android.view.View view) {
+        if (view.getBackground() != null) {
+            view.getBackground().setCallback(null);
+        }
+        if (view instanceof ViewGroup && !(view instanceof AdapterView)) {
+            for (int i = 0; i < ((ViewGroup) view).getChildCount(); i++) {
+                unbindDrawables(((ViewGroup) view).getChildAt(i));
+            }
+            ((ViewGroup) view).removeAllViews();
+        }
+    }
+
+    public Gson getGson() {
+        if (mGson == null) {
+            mGson = new Gson();
+        }
+        return mGson;
+    }
+
+
+    @Override
+    protected void onDestroy() {
+        mGson = null;
+        OkHttpClient.cancelRequest(mPresenter.mModel.getClass());
+        unbindDrawables(getRootView());
+        mPresenter.destroy();
+        mPresenter = null;
+        mActivity = null;
+        super.onDestroy();
+
+    }
 }

+ 93 - 0
app-base/src/main/java/com/edufound/base/BaseMvpFragment.java

@@ -0,0 +1,93 @@
+package com.edufound.base;
+
+import android.content.Context;
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.ViewGroup;
+import android.widget.AdapterView;
+
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+
+import com.edufound.base.util.EfunboxUtil;
+import com.edufound.base.util.OkHttpClient;
+
+
+public abstract class BaseMvpFragment<M extends Model, V extends View, P extends BasePresenter> extends Fragment implements BaseMvp<M, V, P> {
+    protected P mPresenter;
+    protected android.view.View mRootView;
+
+    @Override
+    public void onAttach(Context context) {
+        super.onAttach(context);
+        mPresenter = createPresenter();
+        if (mPresenter != null) {
+            mPresenter.registerModel(createModel());
+            mPresenter.registerView(createView());
+        }
+    }
+
+
+    @Override
+    public android.view.View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
+        EfunboxUtil.initDesignSize(getActivity());
+        android.view.View view = null;
+        if (getLayoutId() != 0) {
+            view = inflater.inflate(this.getLayoutId(), container, false);
+        } else {
+            view = getLayoutView();
+        }
+        mRootView = view;
+        initView(view);
+        return view;
+
+    }
+
+
+    protected abstract int getLayoutId();
+
+    /**
+     * 初始化视图
+     *
+     * @param view
+     */
+    protected abstract void initView(android.view.View view);
+
+
+    /**
+     * 设置布局view
+     */
+    public abstract android.view.View getLayoutView();
+
+    @Override
+    public void onDetach() {
+        super.onDetach();
+        if (mPresenter != null) {
+            mPresenter.destroy();
+        }
+    }
+
+    private void unbindDrawables(android.view.View view) {
+        if (view.getBackground() != null) {
+            view.getBackground().setCallback(null);
+
+        }
+        if (view instanceof ViewGroup && !(view instanceof AdapterView)) {
+            for (int i = 0; i < ((ViewGroup) view).getChildCount(); i++) {
+                unbindDrawables(((ViewGroup) view).getChildAt(i));
+            }
+            ((ViewGroup) view).removeAllViews();
+        }
+    }
+
+    @Override
+    public void onDestroyView() {
+        OkHttpClient.cancelRequest(mPresenter.mModel.getClass());
+        unbindDrawables(mRootView);
+        mPresenter.destroy();
+        mPresenter = null;
+        super.onDestroyView();
+    }
+
+
+}

+ 4 - 3
app-base/src/main/java/com/efunbox/base/BasePresenter.java

@@ -1,6 +1,6 @@
-package com.efunbox.base;
+package com.edufound.base;
 
-import com.efunbox.base.util.BaseConsts;
+import com.edufound.base.util.BaseConsts;
 
 import java.lang.ref.WeakReference;
 
@@ -33,11 +33,12 @@ public abstract class BasePresenter<M extends Model, V extends View> implements
      */
     @Override
     public void destroy() {
+        onViewDestroy();
         if (wrf != null) {
             wrf.clear();
             wrf = null;
         }
-        onViewDestroy();
+
     }
 
     protected abstract void onViewDestroy();

+ 1 - 1
app-base/src/main/java/com/efunbox/base/Model.java

@@ -1,4 +1,4 @@
-package com.efunbox.base;
+package com.edufound.base;
 
 public interface Model {
 }

+ 7 - 8
app-base/src/main/java/com/efunbox/base/ModuleMediator.java

@@ -1,7 +1,6 @@
-package com.efunbox.base;
+package com.edufound.base;
 
 import android.app.Application;
-import android.util.Log;
 
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
@@ -15,20 +14,20 @@ public class ModuleMediator {
     /**
      * 播放页面类
      **/
-    public static final String ACTIVITY_VIDEO_CLASS = "com.efunbox.video.VideoActivity";
+    public static final String ACTIVITY_VIDEO_CLASS = "com.edufound.video.VideoActivity";
     /**
      * TV播放页面类
      **/
-    public static final String ACTIVITY_VIDEO_TV_CLASS = "com.efunbox.video.VideoTVActivity";
+    public static final String ACTIVITY_VIDEO_TV_CLASS = "com.edufound.video.VideoTVActivity";
     /**
      * 支付页面类
      **/
-    public static final String ACTIVITY_PAY_CLASS = "com.efunbox.pay.PayActivity";
+    public static final String ACTIVITY_PAY_CLASS = "com.edufound.pay.PayActivity";
 
 
-    private static final String APP_BASE_CLASS = "com.efunbox.base.MyApplication";
-    private static final String APP_VIDEO_CLASS = "com.efunbox.video.MyApplication";
-    private static final String APP_PAY_CLASS = "com.efunbox.pay.MyApplication";
+    private static final String APP_BASE_CLASS = "com.edufound.base.BaseApplication";
+    private static final String APP_VIDEO_CLASS = "com.edufound.video.MyApplication";
+    private static final String APP_PAY_CLASS = "com.edufound.pay.MyApplication";
     private static String[] modelApplications = {APP_BASE_CLASS, APP_VIDEO_CLASS, APP_PAY_CLASS};
 
     public static void initModule(Application application) {

+ 1 - 1
app-base/src/main/java/com/efunbox/base/Presenter.java

@@ -1,4 +1,4 @@
-package com.efunbox.base;
+package com.edufound.base;
 
 public interface Presenter<M extends Model, V extends View> {
     /**

+ 1 - 1
app-base/src/main/java/com/efunbox/base/View.java

@@ -1,4 +1,4 @@
-package com.efunbox.base;
+package com.edufound.base;
 
 import android.os.Bundle;
 import android.view.ViewGroup;

+ 11 - 14
app-base/src/main/java/com/efunbox/base/activity/CrashDialogActivity.java

@@ -1,23 +1,20 @@
-package com.efunbox.base.activity;
+package com.edufound.base.activity;
 
-import android.annotation.SuppressLint;
 import android.content.Intent;
 import android.view.KeyEvent;
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.FrameLayout;
 
-import com.efunbox.base.BaseMvpActivity;
-import com.efunbox.base.MyApplication;
-import com.efunbox.base.R;
-import com.efunbox.base.annotation.BindView;
-import com.efunbox.base.model.CrashActivityModel;
-import com.efunbox.base.model.impl.CrashActivityModelImpl;
-import com.efunbox.base.presenter.CrashActivityPresenter;
-import com.efunbox.base.util.BaseConsts;
-import com.efunbox.base.util.EfunboxUtil;
-import com.efunbox.base.view.CrashActivityView;
-import com.orhanobut.logger.Logger;
+import com.edufound.base.BaseMvpActivity;
+import com.edufound.base.BaseApplication;
+import com.edufound.base.R;
+import com.edufound.base.model.CrashActivityModel;
+import com.edufound.base.model.impl.CrashActivityModelImpl;
+import com.edufound.base.presenter.CrashActivityPresenter;
+import com.edufound.base.util.BaseConsts;
+import com.edufound.base.util.EfunboxUtil;
+import com.edufound.base.view.CrashActivityView;
 
 public class CrashDialogActivity extends BaseMvpActivity<CrashActivityModel, CrashActivityView, CrashActivityPresenter> implements CrashActivityView {
 
@@ -54,7 +51,7 @@ public class CrashDialogActivity extends BaseMvpActivity<CrashActivityModel, Cra
             startActivity(intent);
         });
         addUiClickListener(mExitApp, o -> {
-            EfunboxUtil.killAppProcess(mActivity, MyApplication.mActivityList);
+            BaseApplication.killAppProcess(mActivity);
         });
     }
 

+ 1 - 1
app-base/src/main/java/com/efunbox/base/annotation/BindView.java

@@ -1,4 +1,4 @@
-package com.efunbox.base.annotation;
+package com.edufound.base.annotation;
 
 
 import java.lang.annotation.ElementType;

+ 69 - 0
app-base/src/main/java/com/edufound/base/bean/ChannelCodeEnum.java

@@ -0,0 +1,69 @@
+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";
+        }
+    },
+
+
+    XUNFEI {
+        //讯飞
+        public String getChannelCode() {
+            return "3010";
+        }
+    },
+    BAIDU_XUEXIJI {
+        //百度学习机
+        public String getChannelCode() {
+            return "3011";
+        }
+    };
+
+
+    public abstract String getChannelCode();//定义抽象方法
+}

+ 1 - 1
app-base/src/main/java/com/efunbox/base/bean/HttpResultBean.java

@@ -1,4 +1,4 @@
-package com.efunbox.base.bean;
+package com.edufound.base.bean;
 
 public class HttpResultBean<T> {
     private String code;

+ 1 - 1
app-base/src/main/java/com/efunbox/base/bean/HttpResultDataListBean.java

@@ -1,4 +1,4 @@
-package com.efunbox.base.bean;
+package com.edufound.base.bean;
 
 import java.util.List;
 

+ 268 - 0
app-base/src/main/java/com/edufound/base/bean/UserBean.java

@@ -0,0 +1,268 @@
+package com.edufound.base.bean;
+
+import android.text.TextUtils;
+
+import com.edufound.base.util.BaseParamsKey;
+import com.edufound.base.util.MMKVUtil;
+
+public class UserBean {
+
+    private String avatar;
+    private String birthday;
+    private String channel;
+    private String eid;
+    private String gender;
+    private String grade;
+    private String loginDay;
+    private String mCount;
+    private String messageCount;
+    private String mobile;
+    private String myCount;//最外层--我的
+    private String nickName;
+    private String openId;
+    private String profession;
+    private String recOsType;
+    private String recStatus;
+    private String recUid;
+    private String schoolCity;
+    private String schoolName;
+    private String schoolProvince;
+    private String shareUid;
+    private String sourceType;
+    private String statusEnum;
+    private String uid;
+    private String unionId;
+    private String wechatName;
+    private String vipType; //1是终身会员
+
+    //自定义参数
+    private boolean isVip;
+
+    public String getAvatar() {
+        return avatar;
+    }
+
+    public void setAvatar(String avatar) {
+        this.avatar = avatar;
+    }
+
+    public String getBirthday() {
+        return birthday;
+    }
+
+    public void setBirthday(String birthday) {
+        this.birthday = birthday;
+    }
+
+    public String getChannel() {
+        return channel;
+    }
+
+    public void setChannel(String channel) {
+        this.channel = channel;
+    }
+
+    public String getEid() {
+        return eid;
+    }
+
+    public void setEid(String eid) {
+        this.eid = eid;
+    }
+
+    public String getGender() {
+        return gender;
+    }
+
+    public void setGender(String gender) {
+        this.gender = gender;
+    }
+
+    public String getGrade() {
+        if (TextUtils.isEmpty(grade)) {
+            //如果这个年级是空的,返回默认的
+            return MMKVUtil.getInstance().decodeString(BaseParamsKey.DEFAULT_GRADE);
+        }
+        return grade;
+    }
+
+    public void setGrade(String grade) {
+        this.grade = grade;
+    }
+
+    public String getLoginDay() {
+        return loginDay;
+    }
+
+    public void setLoginDay(String loginDay) {
+        this.loginDay = loginDay;
+    }
+
+    public String getMCount() {
+        return mCount;
+    }
+
+    public void setMCount(String mcount) {
+        this.mCount = mcount;
+    }
+
+    public String getMessageCount() {
+        return messageCount;
+    }
+
+    public void setMessageCount(String messageCount) {
+        this.messageCount = messageCount;
+    }
+
+    public String getMobile() {
+        return mobile;
+    }
+
+    public void setMobile(String mobile) {
+        this.mobile = mobile;
+    }
+
+    public String getMyCount() {
+        return myCount;
+    }
+
+    public void setMyCount(String myCount) {
+        this.myCount = myCount;
+    }
+
+    public String getNickName() {
+        return nickName;
+    }
+
+    public void setNickName(String nickName) {
+        this.nickName = nickName;
+    }
+
+    public String getOpenId() {
+        return openId;
+    }
+
+    public void setOpenId(String openId) {
+        this.openId = openId;
+    }
+
+    public String getProfession() {
+        return profession;
+    }
+
+    public void setProfession(String profession) {
+        this.profession = profession;
+    }
+
+    public String getRecOsType() {
+        return recOsType;
+    }
+
+    public void setRecOsType(String recOsType) {
+        this.recOsType = recOsType;
+    }
+
+    public String getRecStatus() {
+        return recStatus;
+    }
+
+    public void setRecStatus(String recStatus) {
+        this.recStatus = recStatus;
+    }
+
+    public String getRecUid() {
+        return recUid;
+    }
+
+    public void setRecUid(String recUid) {
+        this.recUid = recUid;
+    }
+
+    public String getSchoolCity() {
+        return schoolCity;
+    }
+
+    public void setSchoolCity(String schoolCity) {
+        this.schoolCity = schoolCity;
+    }
+
+    public String getSchoolName() {
+        return schoolName;
+    }
+
+    public void setSchoolName(String schoolName) {
+        this.schoolName = schoolName;
+    }
+
+    public String getSchoolProvince() {
+        return schoolProvince;
+    }
+
+    public void setSchoolProvince(String schoolProvince) {
+        this.schoolProvince = schoolProvince;
+    }
+
+    public String getShareUid() {
+        return shareUid;
+    }
+
+    public void setShareUid(String shareUid) {
+        this.shareUid = shareUid;
+    }
+
+    public String getSourceType() {
+        return sourceType;
+    }
+
+    public void setSourceType(String sourceType) {
+        this.sourceType = sourceType;
+    }
+
+    public String getStatusEnum() {
+        return statusEnum;
+    }
+
+    public void setStatusEnum(String statusEnum) {
+        this.statusEnum = statusEnum;
+    }
+
+    public String getUid() {
+        return uid;
+    }
+
+    public void setUid(String uid) {
+        this.uid = uid;
+    }
+
+    public String getUnionId() {
+        return unionId;
+    }
+
+    public void setUnionId(String unionId) {
+        this.unionId = unionId;
+    }
+
+    public String getWechatName() {
+        return wechatName;
+    }
+
+    public void setWechatName(String wechatName) {
+        this.wechatName = wechatName;
+    }
+
+    public String getVipType() {
+        return vipType;
+    }
+
+    public void setVipType(String vipType) {
+        this.vipType = vipType;
+    }
+
+    public boolean isVip() {
+        return isVip;
+    }
+
+    public void setVip(boolean vip) {
+        isVip = vip;
+    }
+}

+ 1 - 1
app-base/src/main/java/com/efunbox/base/bean/WeChatBean.java

@@ -1,4 +1,4 @@
-package com.efunbox.base.bean;
+package com.edufound.base.bean;
 
 public class WeChatBean {
     public String WX_APPID = "";

+ 1 - 1
app-base/src/main/java/com/efunbox/base/callback/OkHttpCallback.java

@@ -1,4 +1,4 @@
-package com.efunbox.base.callback;
+package com.edufound.base.callback;
 
 import com.okhttplib.HttpInfo;
 import com.okhttplib.callback.BaseCallback;

+ 1 - 1
app-base/src/main/java/com/efunbox/base/crash/ActivityKillerV15_V20.java

@@ -1,4 +1,4 @@
-package com.efunbox.base.crash;
+package com.edufound.base.crash;
 
 
 import android.app.Activity;

+ 1 - 1
app-base/src/main/java/com/efunbox/base/crash/ActivityKillerV21_V23.java

@@ -1,4 +1,4 @@
-package com.efunbox.base.crash;
+package com.edufound.base.crash;
 
 
 import android.app.Activity;

+ 1 - 1
app-base/src/main/java/com/efunbox/base/crash/ActivityKillerV24_V25.java

@@ -1,4 +1,4 @@
-package com.efunbox.base.crash;
+package com.edufound.base.crash;
 
 
 import android.app.Activity;

+ 1 - 1
app-base/src/main/java/com/efunbox/base/crash/ActivityKillerV26.java

@@ -1,4 +1,4 @@
-package com.efunbox.base.crash;
+package com.edufound.base.crash;
 
 
 import android.app.Activity;

+ 1 - 1
app-base/src/main/java/com/efunbox/base/crash/ActivityKillerV28.java

@@ -1,4 +1,4 @@
-package com.efunbox.base.crash;
+package com.edufound.base.crash;
 
 
 import android.app.Activity;

+ 1 - 1
app-base/src/main/java/com/efunbox/base/crash/ActivityLifecycleCallbacksAdapter.java

@@ -1,4 +1,4 @@
-package com.efunbox.base.crash;
+package com.edufound.base.crash;
 
 import android.app.Activity;
 import android.app.Application;

+ 1 - 1
app-base/src/main/java/com/efunbox/base/crash/ClientTransaction.java

@@ -1,4 +1,4 @@
-package com.efunbox.base.crash;
+package com.edufound.base.crash;
 
 import android.os.IBinder;
 

+ 1 - 1
app-base/src/main/java/com/efunbox/base/crash/Cockroach.java

@@ -1,4 +1,4 @@
-package com.efunbox.base.crash;
+package com.edufound.base.crash;
 
 
 import android.content.Context;

+ 1 - 1
app-base/src/main/java/com/efunbox/base/crash/CrashLog.java

@@ -1,4 +1,4 @@
-package com.efunbox.base.crash;
+package com.edufound.base.crash;
 
 import android.content.Context;
 import android.content.pm.PackageInfo;

+ 3 - 3
app-base/src/main/java/com/efunbox/base/crash/DebugSafeModeTipActivity.java

@@ -1,4 +1,4 @@
-package com.efunbox.base.crash;
+package com.edufound.base.crash;
 
 import android.os.Bundle;
 import android.view.KeyEvent;
@@ -8,8 +8,8 @@ import androidx.annotation.Nullable;
 import androidx.appcompat.app.AppCompatActivity;
 import androidx.fragment.app.Fragment;
 
-import com.efunbox.base.R;
-import com.efunbox.base.fragment.CrashLogFragment;
+import com.edufound.base.R;
+import com.edufound.base.fragment.CrashLogFragment;
 
 
 /**

+ 1 - 1
app-base/src/main/java/com/efunbox/base/crash/DebugSafeModeUI.java

@@ -1,4 +1,4 @@
-package com.efunbox.base.crash;
+package com.edufound.base.crash;
 
 import android.app.Activity;
 import android.app.Application;

+ 1 - 1
app-base/src/main/java/com/efunbox/base/crash/ExceptionHandler.java

@@ -1,4 +1,4 @@
-package com.efunbox.base.crash;
+package com.edufound.base.crash;
 
 
 public abstract class ExceptionHandler {

+ 1 - 1
app-base/src/main/java/com/efunbox/base/crash/IActivityKiller.java

@@ -1,4 +1,4 @@
-package com.efunbox.base.crash;
+package com.edufound.base.crash;
 
 
 import android.os.Message;

+ 1 - 1
app-base/src/main/java/com/efunbox/base/crash/LinearTopSmoothScroller.java

@@ -1,4 +1,4 @@
-package com.efunbox.base.crash;
+package com.edufound.base.crash;
 
 import android.content.Context;
 import android.util.DisplayMetrics;

+ 5 - 3
app-pay/src/main/java/com/efunbox/pay/debug/MyApplication.java

@@ -1,15 +1,17 @@
-package com.efunbox.pay.debug;
+package com.edufound.base.debug;
 
 import android.app.Application;
 
-import com.efunbox.base.util.Logger;
+import com.edufound.base.BaseApplication;
+import com.edufound.base.util.Logger;
 
 
 public class MyApplication extends Application {
+
     @Override
     public void onCreate() {
         super.onCreate();
         Logger.init(this);
-        new com.efunbox.pay.MyApplication().initModule(this);
+        new BaseApplication().initModule(this);
     }
 }

+ 3 - 3
app-base/src/main/java/com/efunbox/base/fragment/CrashLogFragment.java

@@ -1,4 +1,4 @@
-package com.efunbox.base.fragment;
+package com.edufound.base.fragment;
 
 import android.content.ClipboardManager;
 import android.content.Context;
@@ -17,8 +17,8 @@ import androidx.recyclerview.widget.DividerItemDecoration;
 import androidx.recyclerview.widget.LinearLayoutManager;
 import androidx.recyclerview.widget.RecyclerView;
 
-import com.efunbox.base.R;
-import com.efunbox.base.crash.CrashLog;
+import com.edufound.base.R;
+import com.edufound.base.crash.CrashLog;
 
 import java.io.BufferedReader;
 import java.io.File;

+ 6 - 0
app-base/src/main/java/com/edufound/base/model/CrashActivityModel.java

@@ -0,0 +1,6 @@
+package com.edufound.base.model;
+
+import com.edufound.base.Model;
+
+public interface CrashActivityModel extends Model {
+}

+ 6 - 0
app-base/src/main/java/com/edufound/base/model/impl/CrashActivityModelImpl.java

@@ -0,0 +1,6 @@
+package com.edufound.base.model.impl;
+
+import com.edufound.base.model.CrashActivityModel;
+
+public class CrashActivityModelImpl implements CrashActivityModel {
+}

+ 102 - 0
app-base/src/main/java/com/edufound/base/popupwindow/PopWindowUtil.java

@@ -0,0 +1,102 @@
+package com.edufound.base.popupwindow;
+
+import android.app.Activity;
+import android.app.Dialog;
+import android.graphics.Color;
+import android.view.Display;
+import android.view.Gravity;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.Window;
+import android.view.WindowManager;
+import android.widget.FrameLayout;
+import android.widget.PopupWindow;
+import android.widget.TextView;
+
+import com.edufound.base.R;
+import com.edufound.base.util.BaseConsts;
+import com.edufound.base.util.DeviceUtil;
+import com.edufound.base.util.DeviceUuidFactory;
+import com.edufound.base.util.EfunboxUtil;
+import com.edufound.base.util.SizeUtils;
+
+public class PopWindowUtil {
+
+
+    protected static PopupWindow mPopupWindow;
+    protected static FrameLayout dialog_view;
+    protected static PopupWindow mMessageTopWindow;
+
+    public static String showTopActivityName;
+
+    public static boolean checkWindowShoing() {
+        if (mPopupWindow == null) {
+            return false;
+        }
+        return mPopupWindow.isShowing();
+    }
+
+    public static void hidePopupWindow() {
+        if (mPopupWindow != null && mPopupWindow.isShowing()) {
+            mPopupWindow.dismiss();
+        }
+    }
+
+    public static boolean checkMessageTopWindow() {
+        if (mMessageTopWindow == null) {
+            return false;
+        }
+        return mMessageTopWindow.isShowing();
+    }
+
+    public static void hideMessageTopWindow() {
+        if (mMessageTopWindow != null && mMessageTopWindow.isShowing()) {
+            mMessageTopWindow.dismiss();
+        }
+    }
+
+    public static void initNewWindow(Activity activity) {
+        if (checkWindowShoing()) {
+            hidePopupWindow();
+        }
+        EfunboxUtil.initDesignSize(activity);
+        showTopActivityName = activity.getLocalClassName();
+    }
+
+
+    public static void showDeviceInfo(Activity context) {
+        initNewWindow(context);
+        StringBuffer buffer = new StringBuffer();
+        buffer.append("\tpackageName:\t\t" + context.getPackageName() + "\n");
+        buffer.append("\tapk渠道:\t" + "\t" + BaseConsts.getUMengChannel() + "\n");
+        buffer.append("\tUUID:\t" + "\t" + DeviceUuidFactory.getUuid() + "\n");
+//        buffer.append("\t设备SN号:\t\t" + DeviceUtil.getSerialNumber() + "\n");
+        buffer.append("\t厂商:\t" + "\t" + DeviceUtil.getDeviceBrand() + "\n");
+        buffer.append("\t型号:\t" + "\t" + DeviceUtil.getSystemModel() + "\n");
+        buffer.append("\t系统版本号:\t" + "\t" + DeviceUtil.getSystemVersion() + "\n");
+        buffer.append("\t应用版本号:\t" + "\t" + DeviceUtil.getVersionCode(context) + "\n");
+        buffer.append("\t应用版本号名称:\t" + "\t" + DeviceUtil.getVersionName(context) + "\n");
+        buffer.append("\t屏幕宽度:\t\t" + DeviceUtil.getWidth(context) + "\n");
+        buffer.append("\t屏幕高度:\t\t" + DeviceUtil.getHeight(context) + "\n");
+        buffer.append("\t屏幕密度:\t\t" + DeviceUtil.getDensity(context) + "\n");
+        buffer.append("\t屏幕DPI:\t\t" + DeviceUtil.getDensityDpi(context) + "\n");
+
+        View infoView = LayoutInflater.from(context).inflate(R.layout.window_deviceinfo, null);
+        TextView text = (TextView) infoView.findViewById(R.id.deviceinfo);
+        text.setText(buffer.toString());
+        text.setTextSize(SizeUtils.dp2px(context, 20));
+        text.setTextColor(Color.WHITE);
+        Dialog dialog = new Dialog(context);
+        dialog.setContentView(infoView);
+        Window dialogWindow = dialog.getWindow();
+        dialogWindow.setGravity(Gravity.CENTER);
+        WindowManager m = context.getWindowManager();
+        Display d = m.getDefaultDisplay(); // 获取屏幕宽、高用
+        WindowManager.LayoutParams p = dialogWindow.getAttributes(); // 获取对话框当前的参数值
+        p.height = (int) (d.getHeight() * 0.8);
+        p.width = (int) (d.getWidth() * 0.7);
+        dialogWindow.setAttributes(p);
+        dialog.setTitle("Device信息");
+        dialog.show();
+    }
+}

+ 12 - 0
app-base/src/main/java/com/edufound/base/presenter/CrashActivityPresenter.java

@@ -0,0 +1,12 @@
+package com.edufound.base.presenter;
+
+import com.edufound.base.BasePresenter;
+import com.edufound.base.model.CrashActivityModel;
+import com.edufound.base.view.CrashActivityView;
+
+public class CrashActivityPresenter extends BasePresenter<CrashActivityModel, CrashActivityView> {
+    @Override
+    protected void onViewDestroy() {
+
+    }
+}

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

@@ -0,0 +1,39 @@
+package com.edufound.base.receiver;
+
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.text.TextUtils;
+
+import com.edufound.base.BaseApplication;
+import com.edufound.base.bean.ChannelCodeEnum;
+import com.edufound.base.util.BaseConsts;
+
+
+public class HomeKeyEventReceiver extends BroadcastReceiver {
+
+    String SYSTEM_REASON = "reason";
+    String SYSTEM_HOME_KEY = "homekey";
+    String SYSTEM_HOME_KEY_LONG = "recentapps";
+
+    @Override
+    public void onReceive(Context context, Intent intent) {
+        // TODO Auto-generated method stub
+        String action = intent.getAction();
+        if (action.equals(Intent.ACTION_CLOSE_SYSTEM_DIALOGS)) {
+            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())) {
+                    //如果是天猫、小度、小米音响,则按home直接退出apk
+                    BaseApplication.killAppProcess(context);
+                }
+            } else if (TextUtils.equals(reason, SYSTEM_HOME_KEY_LONG)) {
+
+            }
+        }
+    }
+
+}

+ 95 - 0
app-base/src/main/java/com/edufound/base/receiver/NetworkChangeReceiver.java

@@ -0,0 +1,95 @@
+package com.edufound.base.receiver;
+
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.net.ConnectivityManager;
+
+
+import com.edufound.base.util.BaseConsts;
+import com.edufound.base.util.NetworkUtil;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class NetworkChangeReceiver extends BroadcastReceiver {
+
+    private List<NetStateChangeObserver> mObservers = new ArrayList<>();
+    private int mType = -1;
+    private static boolean isRegister = false;
+
+
+    @Override
+    public void onReceive(Context context, Intent intent) {
+        if (ConnectivityManager.CONNECTIVITY_ACTION.equals(intent.getAction())) {
+            int connectivityStatus = NetworkUtil.getConnectivityStatus(context);
+            notifyObservers(connectivityStatus);
+        }
+
+    }
+
+    public static void registerReceiver(Context context) {
+        if (!isRegister) {
+            IntentFilter intentFilter = new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION);
+            context.getApplicationContext().registerReceiver(BaseConsts.getInstanceNetwork(), intentFilter);
+            isRegister = true;
+        }
+    }
+
+    public static void unRegisterReceiver(Context context) {
+        if (isRegister) {
+            context.getApplicationContext().unregisterReceiver(BaseConsts.getInstanceNetwork());
+            isRegister = false;
+        }
+    }
+
+    public static void registerObserver(NetStateChangeObserver observer) {
+        if (observer == null) {
+            return;
+        }
+        if (!BaseConsts.getInstanceNetwork().mObservers.contains(observer)) {
+            BaseConsts.getInstanceNetwork().mObservers.add(observer);
+        }
+    }
+
+    public static void unRegisterObserver(NetStateChangeObserver observer) {
+        if (observer == null) {
+            return;
+        }
+        if (BaseConsts.getInstanceNetwork().mObservers == null) {
+            return;
+        }
+        BaseConsts.getInstanceNetwork().mObservers.remove(observer);
+    }
+
+    private void notifyObservers(int networkType) {
+        if (mType == networkType) {
+            return;
+        }
+        mType = networkType;
+        if (networkType == NetworkUtil.TYPE_MOBILE) {
+            for (NetStateChangeObserver observer : mObservers) {
+                observer.onMobileConnect();
+            }
+        } else if (networkType == NetworkUtil.TYPE_WIFI) {
+            for (NetStateChangeObserver observer : mObservers) {
+                observer.onWifiConnect();
+            }
+        } else {
+            for (NetStateChangeObserver observer : mObservers) {
+                observer.onDisconnect();
+            }
+        }
+        ;
+    }
+
+    public interface NetStateChangeObserver {
+
+        void onDisconnect();
+
+        void onMobileConnect();
+
+        void onWifiConnect();
+    }
+}

+ 78 - 0
app-base/src/main/java/com/edufound/base/receiver/PageLoadingReceiver.java

@@ -0,0 +1,78 @@
+package com.edufound.base.receiver;
+
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+
+import com.edufound.base.util.BaseConsts;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+public class PageLoadingReceiver extends BroadcastReceiver {
+
+    private List<PageLoading> mObservers = new ArrayList<>();
+    private static boolean isRegister = false;
+    public static final String PAGE_LOADING_SHOW = "com.edufound.reader.show.page.loading";
+    public static final String PAGE_LOADING_HIDE = "com.edufound.reader.show.page.hide";
+
+
+    @Override
+    public void onReceive(Context context, Intent intent) {
+        if (PAGE_LOADING_SHOW.equals(intent.getAction())) {
+            for (PageLoading observer : mObservers) {
+                observer.show(intent);
+            }
+        } else if (PAGE_LOADING_HIDE.equals(intent.getAction())) {
+            for (PageLoading observer : mObservers) {
+                observer.hide(intent);
+            }
+        }
+
+    }
+
+    public static void registerReceiver(Context context) {
+        if (!isRegister) {
+            IntentFilter intentFilter = new IntentFilter();
+            intentFilter.addAction(PAGE_LOADING_SHOW);
+            intentFilter.addAction(PAGE_LOADING_HIDE);
+            context.getApplicationContext().registerReceiver(BaseConsts.getInstancePageLoading(), intentFilter);
+            isRegister = true;
+        }
+    }
+
+    public static void unRegisterReceiver(Context context) {
+        if (isRegister) {
+            context.getApplicationContext().unregisterReceiver(BaseConsts.getInstancePageLoading());
+            isRegister = false;
+        }
+    }
+
+    public static void registerObserver(PageLoading observer) {
+        if (observer == null) {
+            return;
+        }
+        if (!BaseConsts.getInstancePageLoading().mObservers.contains(observer)) {
+            BaseConsts.getInstancePageLoading().mObservers.add(observer);
+        }
+    }
+
+    public static void unRegisterObserver(PageLoading observer) {
+        if (observer == null) {
+            return;
+        }
+        if (BaseConsts.getInstancePageLoading().mObservers == null) {
+            return;
+        }
+        BaseConsts.getInstancePageLoading().mObservers.remove(observer);
+    }
+
+
+    public interface PageLoading {
+        void show(Intent intent);
+
+        void hide(Intent intent);
+    }
+}

+ 184 - 0
app-base/src/main/java/com/edufound/base/util/BaseConsts.java

@@ -0,0 +1,184 @@
+package com.edufound.base.util;
+
+import android.app.Application;
+
+import com.edufound.base.bean.UserBean;
+import com.edufound.base.bean.WeChatBean;
+import com.edufound.base.receiver.NetworkChangeReceiver;
+import com.edufound.base.receiver.PageLoadingReceiver;
+
+import java.io.File;
+
+public class BaseConsts {
+
+
+    private static Application mApplication;
+
+    private static UserBean mUserBean;
+
+
+    public static String DEFAULT_GRADE;
+
+
+    //默认请求地址
+    private static String FinalApiUrl = "http://reader-api.efunbox.cn";
+
+
+    //是否是debug环境
+    private static boolean isDebug = false;
+
+    //view点击间隔时间
+    public static final int VIEW_CLICK_TIME = 500;
+
+    //view共用间隔时间
+    public static final boolean VIEW_CLICK_ALL = true;
+
+    //APP的包名
+    private static String APP_PACKAGE_NAME = "";
+
+
+    //微信支付实体类
+    public static WeChatBean WECHAT_INFO;
+
+
+    //umeng需要用到得
+    private static String UMENG_CHANNEL = null;
+
+    private static String UMENG_APPKEY = null;
+
+    //默认UID
+    private static String UID;
+
+    //窗口大小
+    private static int[] screenSize;
+
+
+    public static WordFilter mWordFilter;
+
+
+    private static File mRecordSaveFile;
+
+
+    private static String mRecordUpLoadFileUrl;
+
+    public static void setRecordSaveFile(File saveFile) {
+        mRecordSaveFile = saveFile;
+    }
+
+    public static File getRecordSaveFile() {
+        return mRecordSaveFile;
+    }
+
+
+    public static String getRecordUpLoadFileUrl() {
+        return mRecordUpLoadFileUrl;
+    }
+
+    public static void setRecordUpLoadFileUrl(String fileUrl) {
+        mRecordUpLoadFileUrl = fileUrl;
+    }
+
+
+    public static Application getApplication() {
+        return mApplication;
+    }
+
+    public static void setApplication(Application application) {
+        mApplication = application;
+    }
+
+
+    public static int[] getScreenSize() {
+        return screenSize;
+    }
+
+    public static void setScreenSize(int[] size) {
+        screenSize = size;
+    }
+
+    public static boolean isDebug() {
+        return isDebug;
+    }
+
+    public static void setDebug(boolean debug) {
+        isDebug = debug;
+        if (isDebug) {
+            //测试环境
+            FinalApiUrl = "https://reader-api.efunbox.cn";
+        } else {
+            FinalApiUrl = "https://reader-api.ai160.com";
+        }
+    }
+
+    public static UserBean getUserBean() {
+        return mUserBean;
+    }
+
+    public static void setUserBean(UserBean bean) {
+        mUserBean = bean;
+        if (bean != null) {
+            BaseConsts.setUID(bean.getUid());
+        } else {
+            BaseConsts.setUID("");
+        }
+        if (BaseConsts.getUserBean() != null) {
+            DEFAULT_GRADE = BaseConsts.getUserBean().getGrade();
+        } else {
+            DEFAULT_GRADE = MMKVUtil.getInstance().decodeString(BaseParamsKey.DEFAULT_GRADE);
+        }
+    }
+
+    public static String getAppPackageName() {
+        return APP_PACKAGE_NAME;
+    }
+
+    public static void setAppPackageName(String appPackageName) {
+        APP_PACKAGE_NAME = appPackageName;
+    }
+
+    public static String getUMengChannel() {
+        return UMENG_CHANNEL;
+    }
+
+    public static void setUMengChannel(String umengChannel) {
+        UMENG_CHANNEL = umengChannel;
+    }
+
+    public static String getUMengAppkey() {
+        return UMENG_APPKEY;
+    }
+
+    public static void setUMengAppkey(String umengAppkey) {
+        UMENG_APPKEY = umengAppkey;
+    }
+
+    public static String getUID() {
+        if (UID == null) {
+            UID = "test";
+        }
+        return UID;
+    }
+
+
+    private static final PageLoadingReceiver INSTANCE_PAGE_LOADING = new PageLoadingReceiver();
+
+    private static final NetworkChangeReceiver INSTANCE_NETWORK = new NetworkChangeReceiver();
+
+    public static PageLoadingReceiver getInstancePageLoading() {
+        return INSTANCE_PAGE_LOADING;
+    }
+
+    public static NetworkChangeReceiver getInstanceNetwork() {
+        return INSTANCE_NETWORK;
+    }
+
+    public static void setUID(String UID) {
+        BaseConsts.UID = UID;
+    }
+
+    public static String getFinalApiUrl() {
+        return FinalApiUrl;
+    }
+
+
+}

+ 18 - 0
app-base/src/main/java/com/edufound/base/util/BaseParamsKey.java

@@ -0,0 +1,18 @@
+package com.edufound.base.util;
+
+public class BaseParamsKey {
+    //存储key
+    public static final String DEFAULT_PAGE_INDEX = "defaultIndex";
+    public static final String DEFAULT_FRAGMENT_INDEX = "fragmentIndex";
+    public static final String QUERY_PARAMETER_TO_PAGE = "toPage";
+    public static final String QUERY_PARAMETER_TO_PAGE_ACTIVITY_ID = "activityId";
+    public static final String AGREEMENT = "agreement";
+    public static final String SEARCH_HISTORY_WORK = "historyJsonWork";
+    public static final String SEARCH_HISTORY_PEOPLE = "historyJsonPeople";
+    public static final String DEFAULT_GRADE = "default_grade";
+    public static final String OTHER_UID = "otherUID";
+
+
+    //广播
+
+}

+ 1 - 1
app-base/src/main/java/com/efunbox/base/util/DataCleanManager.java

@@ -1,4 +1,4 @@
-package com.efunbox.base.util;
+package com.edufound.base.util;
 
 
 import android.content.Context;

+ 1 - 1
app-base/src/main/java/com/efunbox/base/util/DeviceUtil.java

@@ -1,4 +1,4 @@
-package com.efunbox.base.util;
+package com.edufound.base.util;
 
 import android.app.Activity;
 import android.content.Context;

+ 1 - 1
app-base/src/main/java/com/efunbox/base/util/DeviceUuidFactory.java

@@ -1,4 +1,4 @@
-package com.efunbox.base.util;
+package com.edufound.base.util;
 
 import android.annotation.SuppressLint;
 import android.content.Context;

+ 38 - 27
app-base/src/main/java/com/efunbox/base/util/EfunboxUtil.java

@@ -1,4 +1,4 @@
-package com.efunbox.base.util;
+package com.edufound.base.util;
 
 import android.app.Activity;
 import android.app.ActivityManager;
@@ -6,10 +6,11 @@ import android.content.Context;
 import android.text.TextUtils;
 import android.util.DisplayMetrics;
 
-import com.efunbox.base.MyApplication;
-
 import java.text.DecimalFormat;
+import java.util.ArrayList;
 import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 public class EfunboxUtil {
 
@@ -56,7 +57,7 @@ public class EfunboxUtil {
      * @return 待检测的字符串
      */
     public static boolean isMobileNO(String mobileNums) {
-        String telRegex = "^((13[0-9])|(15[^4])|(18[0-9])|(17[0-8])|(147,145))\\d{8}$";
+        String telRegex = "^((13[0-9])|(15[^4])|(18[0-9])|(19[0-9])|(17[0-8])|(147,145))\\d{8}$";
         if (TextUtils.isEmpty(mobileNums)) {
             return false;
         } else {
@@ -137,7 +138,7 @@ public class EfunboxUtil {
         }
         if (Float.valueOf(num) > 10000f) {
             float a = Float.parseFloat(num) / 10000;
-            DecimalFormat decimalFormat = new DecimalFormat("#.#");
+            DecimalFormat decimalFormat = new DecimalFormat("#.##");
             return String.valueOf(decimalFormat.format(a)) + "万";
         }
         return num;
@@ -167,28 +168,6 @@ public class EfunboxUtil {
 
 
     /**
-     * 关闭应用
-     */
-    public static void killAppProcess(Context context, List<Activity> list) {
-        for (int i = 0; i < list.size(); i++) {
-            list.get(i).finish();
-        }
-        //注意:不能先杀掉主进程,否则逻辑代码无法继续执行,需先杀掉相关进程最后杀掉主进程
-        ActivityManager mActivityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
-        List<ActivityManager.RunningAppProcessInfo> mList = mActivityManager.getRunningAppProcesses();
-        if (mList != null) {
-            for (ActivityManager.RunningAppProcessInfo runningAppProcessInfo : mList) {
-                if (runningAppProcessInfo.pid != android.os.Process.myPid()) {
-                    android.os.Process.killProcess(runningAppProcessInfo.pid);
-                }
-            }
-            android.os.Process.killProcess(android.os.Process.myPid());
-        }
-//        System.exit(0);
-    }
-
-
-    /**
      * long转换成时间
      * */
     /**
@@ -203,4 +182,36 @@ public class EfunboxUtil {
     }
 
 
+    public static <T> List<List<T>> splitList(List<T> list, int len) {
+        if (list == null || list.size() == 0 || len < 1) {
+            return null;
+        }
+        List<List<T>> result = new ArrayList<List<T>>();
+        int size = list.size();
+        int count = (size + len - 1) / len;
+        for (int i = 0; i < count; i++) {
+            List<T> subList = list.subList(i * len, ((i + 1) * len > size ? size : len * (i + 1)));
+            result.add(subList);
+        }
+        return result;
+    }
+
+
+    /**
+     * 判断是否包含英文字母
+     *
+     * @param str
+     * @return
+     */
+    public static boolean containEnglishLetters(String str) {
+        String regex = ".*[a-zA-Z]+.*";
+        Matcher m = Pattern.compile(regex).matcher(str);
+//        if (m.matches()){
+//            Toast.makeText(this, "输入的值包含英文字母", Toast.LENGTH_SHORT).show();
+//        }else {
+//            Toast.makeText(this, "输入的值中不包含英文字母", Toast.LENGTH_SHORT).show();
+//        }
+        return m.matches();
+    }
+
 }

+ 2 - 2
app-base/src/main/java/com/efunbox/base/util/GlideUtils.java

@@ -1,4 +1,4 @@
-package com.efunbox.base.util;
+package com.edufound.base.util;
 
 import static com.bumptech.glide.load.DecodeFormat.PREFER_RGB_565;
 
@@ -19,7 +19,7 @@ import com.bumptech.glide.load.resource.bitmap.CenterCrop;
 import com.bumptech.glide.request.RequestListener;
 import com.bumptech.glide.request.RequestOptions;
 import com.bumptech.glide.request.target.Target;
-import com.efunbox.base.R;
+import com.edufound.base.R;
 
 import java.io.File;
 

+ 13 - 6
app-base/src/main/java/com/efunbox/base/util/HttpInterceptor.java

@@ -1,9 +1,17 @@
-package com.efunbox.base.util;
+package com.edufound.base.util;
 
+import com.edufound.base.bean.HttpResultBean;
+import com.google.gson.reflect.TypeToken;
 import com.okhttplib.HttpInfo;
 import com.okhttplib.interceptor.ExceptionInterceptor;
 import com.okhttplib.interceptor.ResultInterceptor;
 
+import java.io.IOException;
+
+import okhttp3.Interceptor;
+import okhttp3.Request;
+import okhttp3.Response;
+
 /**
  * Http拦截器
  * 1、请求结果统一预处理拦截器
@@ -19,7 +27,9 @@ public class HttpInterceptor {
         @Override
         public HttpInfo intercept(HttpInfo info) throws Exception {
             //请求结果预处理:可以进行GSon过滤与解析
+
             return info;
+
         }
     };
 
@@ -30,11 +40,8 @@ public class HttpInterceptor {
     public static com.okhttplib.interceptor.ExceptionInterceptor ExceptionInterceptor = new ExceptionInterceptor() {
         @Override
         public HttpInfo intercept(HttpInfo info) throws Exception {
-            //弹不出toast
-//            Toast.makeText(Consts.getmApplicAtion(), "Code:" + info.getRetCode() + "--Detail:" + info.getRetDetail(), Toast.LENGTH_LONG).show();
             switch (info.getRetCode()) {
                 case HttpInfo.NonNetwork:
-//                    Toast.makeText(Consts.getmApplicAtion(), "网络中断", Toast.LENGTH_SHORT).show();
                     info.setRetDetail("网络中断");
                     break;
                 case HttpInfo.CheckURL:
@@ -44,11 +51,9 @@ public class HttpInterceptor {
                     info.setRetDetail("协议类型错误[" + info.getNetCode() + "]");
                     break;
                 case HttpInfo.CheckNet:
-//                    Toast.makeText(Consts.getmApplicAtion(), "请检查网络连接是否正常", Toast.LENGTH_SHORT).show();
                     info.setRetDetail(info.getUrl() + "请检查网络连接是否正常[" + info.getNetCode() + "]");
                     break;
                 case HttpInfo.ConnectionTimeOut:
-//                    CusToast.getInstance(Consts.getmApplicAtion()).show("手机号不正确", 2000);
                     info.setRetDetail("连接超时");
                     break;
                 case HttpInfo.WriteAndReadTimeOut:
@@ -58,8 +63,10 @@ public class HttpInterceptor {
                     info.setRetDetail("连接中断");
                     break;
             }
+
             return info;
         }
     };
+
 }
 

+ 617 - 0
app-base/src/main/java/com/edufound/base/util/KeyWordFilter.java

@@ -0,0 +1,617 @@
+package com.edufound.base.util;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.HashMap;
+
+
+public class KeyWordFilter {
+    public static final String PATH_DIC_WFC = "wfc.dic";
+    public static final String PATH_DIC_FQC = "fqc.dic";
+    private HashMap<String, String> wfc_map = null;
+    private HashMap<String, String> fqc_map = null;
+    private HashMap<String, Integer> firstword_map = new HashMap<String, Integer>();
+    private HashMap<String, Integer> firstword_fqc_map = new HashMap<String, Integer>();
+    private static KeyWordFilter singleton;
+
+    private KeyWordFilter() {
+    }
+
+    public synchronized static KeyWordFilter getInstance() {
+        if (singleton == null) {
+            singleton = new KeyWordFilter();
+        }
+        return singleton;
+    }
+
+    public synchronized HashMap<String, String> getWfcMap() {
+        if (wfc_map == null) {
+            wfc_map = getWordMap(PATH_DIC_WFC, "");
+        }
+        return wfc_map;
+    }
+
+    public synchronized HashMap<String, String> getFqcMap() {
+        if (fqc_map == null) {
+            fqc_map = getWordMap(PATH_DIC_FQC, "");
+        }
+        return fqc_map;
+    }
+
+    public synchronized HashMap<String, Integer> getFirstwordMap() {
+        if (firstword_map == null) {
+            firstword_map = new HashMap<String, Integer>();
+        }
+        return firstword_map;
+    }
+
+    public synchronized HashMap<String, Integer> getFirstwordFqcMap() {
+        if (firstword_fqc_map == null) {
+            firstword_fqc_map = new HashMap<String, Integer>();
+        }
+        return firstword_fqc_map;
+    }
+
+    public boolean reload() {
+        try {
+            wfc_map = null;
+            fqc_map = null;
+            KeyWordFilter.getInstance().getWfcMap();
+            KeyWordFilter.getInstance().getFqcMap();
+            return true;
+        } catch (Exception e) {
+            return false;
+        }
+    }
+
+    public boolean restart() {
+        try {
+            singleton = null;
+            getInstance();
+            return true;
+        } catch (Exception e) {
+            return false;
+        }
+    }
+
+    private HashMap<String, String> getWordMap(String dicPath, String replace) {
+        InputStream is = null;
+        HashMap<String, String> wordMap = new HashMap<String, String>();
+        try {
+            // is = new FileInputStream(dicPath);
+            is = BaseConsts.getApplication().getResources().getAssets().open(dicPath);
+            if (is == null) {
+                System.out.println(dicPath + " not found!!!");
+            }
+            BufferedReader br = new BufferedReader(new InputStreamReader(is,
+                    "UTF-8"), 512);
+            String theWord = null;
+            HashMap<String, Integer> firstword = getFirstwordMap();
+            HashMap<String, Integer> firstword_fqc = getFirstwordFqcMap();
+
+            String ss = null;
+            if (dicPath.equals(PATH_DIC_FQC)) {
+                do {
+                    theWord = br.readLine();
+                    if (theWord != null && !"".equals(theWord.trim())) {
+                        String[] sss = theWord.trim().toLowerCase().split("@@");
+                        if (sss[0] != null && !sss[0].equals("")) {
+                            if (firstword_fqc
+                                    .containsKey(sss[0].toCharArray()[0] + "")
+                                    && firstword_fqc
+                                    .get(sss[0].toCharArray()[0] + "") > sss[0]
+                                    .length()) {
+                                // do nothing
+                            } else {
+                                firstword_fqc.put(sss[0].toCharArray()[0] + "",
+                                        sss[0].length());
+                            }
+                            wordMap.put(sss[0], sss.length == 1 ? "" : sss[1]);
+                        }
+                    }
+                } while (theWord != null);
+            } else {
+                do {
+                    theWord = br.readLine();
+                    if (theWord != null && !"".equals(theWord.trim())) {
+                        ss = theWord.trim().toLowerCase();
+                        if (firstword.containsKey(ss.toCharArray()[0] + "")
+                                && firstword.get(ss.toCharArray()[0] + "") > ss
+                                .length()) {
+                            // do nothing
+                        } else {
+                            firstword.put(theWord.trim().toLowerCase()
+                                    .toCharArray()[0]
+                                    + "", ss.length());
+                        }
+                        wordMap.put(theWord.trim().toLowerCase(), replace);
+                    }
+                } while (theWord != null);
+
+            }
+
+        } catch (IOException ioe) {
+            if (is == null) {
+                System.err.println(dicPath + " not found!!!");
+            } else {
+                System.err.println(dicPath + " loading exception.");
+            }
+            ioe.printStackTrace();
+
+        } finally {
+            try {
+                if (is != null) {
+                    is.close();
+                    is = null;
+                }
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+        return wordMap;
+    }
+
+    public String filter_in(String content, String sta, String usid) {
+        if (content == null || content.length() <= 0) {
+            return "0";
+        }
+        if (usid == null) {
+            usid = "0";
+        }
+        HashMap<String, String> wfc_map = KeyWordFilter.getInstance()
+                .getWfcMap();
+        HashMap<String, String> fqc_map = KeyWordFilter.getInstance()
+                .getFqcMap();
+        HashMap<String, Integer> firstword_map = KeyWordFilter.getInstance()
+                .getFirstwordMap();
+        HashMap<String, Integer> firstword_fqc_map = KeyWordFilter
+                .getInstance().getFirstwordFqcMap();
+
+        int result_type = 0;
+        char[] ch = content.toCharArray();
+        StringBuffer ret = new StringBuffer();
+        StringBuffer word = new StringBuffer();
+        int start = 0;
+        int step = 0;
+        int max_length = 1;
+        for (int i = 0; i < ch.length; i++) {
+            if (step == 0) {
+                start = i;
+                step = 1;
+            }
+            char c = ch[i];
+            word.append(c);
+            String tmp = word.toString();
+            if (i == start) {
+                if (!firstword_fqc_map.containsKey(tmp.toLowerCase())) {
+                    step = 0;
+                    ret.append(ch[start]);
+                    word.delete(0, word.length());
+                    i = start;
+                    continue;
+                } else {
+                    max_length = firstword_fqc_map.get(tmp.toLowerCase());
+                }
+            }
+            if (fqc_map.containsKey(tmp.toLowerCase())) {
+                ret.append(fqc_map.get(tmp.toLowerCase()));
+                step = 0;
+            } else if (word.length() >= max_length || i >= ch.length - 1) {
+                step = 0;
+                ret.append(ch[start]);
+                word.delete(0, word.length());
+                i = start;
+            }
+        }
+        ch = ret.toString().toCharArray();
+        word = new StringBuffer();
+        start = 0;
+        step = 0;
+        if (sta.equals("1")) {
+            for (int i = 0; i < ch.length; i++) {
+                if (step == 0) {
+                    start = i;
+                    step = 1;
+                }
+                char c = ch[i];
+                word.append(c);
+                String tmp = word.toString();
+                if (i == start) {
+
+                    if (!firstword_map.containsKey(tmp.toLowerCase())) {
+                        step = 0;
+                        word.delete(0, word.length());
+                        i = start;
+                        continue;
+                    } else {
+                        max_length = firstword_map.get(tmp.toLowerCase());
+                    }
+                }
+                if (wfc_map.containsKey(tmp.toLowerCase())) {
+                    result_type = 2;
+                    break;
+                } else if (word.length() >= max_length || i >= ch.length - 1) {
+                    step = 0;
+                    word.delete(0, word.length());
+                    i = start;
+                }
+            }
+        } else if (sta.equals("0")) {
+            for (int i = 0; i < ch.length; i++) {
+                if (step == 0) {
+                    start = i;
+                    step = 1;
+                }
+                char c = ch[i];
+                word.append(c);
+                String tmp = word.toString();
+                if (i == start) {
+                    if (!firstword_map.containsKey(tmp.toLowerCase())) {
+                        step = 0;
+                        word.delete(0, word.length());
+                        i = start;
+                        continue;
+                    } else {
+                        max_length = firstword_map.get(tmp.toLowerCase());
+                    }
+                }
+                if (wfc_map.containsKey(tmp.toLowerCase())) {
+                    result_type = 2;
+                    break;
+                } else if (word.length() >= max_length || i >= ch.length - 1) {
+                    step = 0;
+                    word.delete(0, word.length());
+                    i = start;
+                }
+            }
+        }
+        return Integer.toString(result_type);
+
+    }
+
+    public String filter_out(String content, String sta, String usid) {
+        if (content == null || content.length() <= 0) {
+            return "";
+        }
+        if (usid == null) {
+            usid = "0";
+        }
+        HashMap<String, String> wfc_map = KeyWordFilter.getInstance()
+                .getWfcMap();
+        HashMap<String, String> fqc_map = KeyWordFilter.getInstance()
+                .getFqcMap();
+        HashMap<String, Integer> firstword_map = KeyWordFilter.getInstance()
+                .getFirstwordMap();
+        HashMap<String, Integer> firstword_fqc_map = KeyWordFilter
+                .getInstance().getFirstwordFqcMap();
+
+        char[] ch = content.toCharArray();
+        StringBuffer ret = new StringBuffer();
+        StringBuffer word = new StringBuffer();
+        int start = 0;
+        int step = 0;
+        int max_length = 1;
+        for (int i = 0; i < ch.length; i++) {
+            if (step == 0) {
+                start = i;
+                step = 1;
+            }
+            char c = ch[i];
+            word.append(c);
+            String tmp = word.toString();
+            if (i == start) {
+                if (!firstword_fqc_map.containsKey(tmp.toLowerCase())) {
+                    step = 0;
+                    ret.append(ch[start]);
+                    word.delete(0, word.length());
+                    i = start;
+                    continue;
+                } else {
+                    max_length = firstword_fqc_map.get(tmp.toLowerCase());
+                }
+            }
+            if (fqc_map.containsKey(tmp.toLowerCase())) {
+                ret.append(fqc_map.get(tmp.toLowerCase()));
+                step = 0;
+            } else if (word.length() >= max_length || i >= ch.length - 1) {
+                step = 0;
+                ret.append(ch[start]);
+                word.delete(0, word.length());
+                i = start;
+            }
+        }
+        ch = ret.toString().toCharArray();
+        ret = new StringBuffer();
+        word = new StringBuffer();
+        start = 0;
+        step = 0;
+
+        if (sta.equals("1")) {
+            for (int i = 0; i < ch.length; i++) {
+                // System.out.println("i="+i+"\tstart="+start+"\tstep="+step+"\tret="+ret.toString());
+                if (step == 0) {
+                    start = i;
+                    step = 1;
+                }
+                char c = ch[i];
+                word.append(c);
+                String tmp = word.toString();
+                if (i == start) {
+
+                    if (!firstword_map.containsKey(tmp.toLowerCase())) {
+                        step = 0;
+                        ret.append(ch[start]);
+                        word.delete(0, word.length());
+                        i = start;
+                        continue;
+                    } else {
+                        max_length = firstword_map.get(tmp.toLowerCase());
+                    }
+                }
+                if (wfc_map.containsKey(tmp.toLowerCase())) {
+                    ret.append("");
+                    step = 0;
+                } else if (word.length() >= max_length || i >= ch.length - 1) {
+                    step = 0;
+                    ret.append(ch[start]);
+                    word.delete(0, word.length());
+                    i = start;
+                }
+
+            }
+        } else if (sta.equals("0")) {
+            for (int i = 0; i < ch.length; i++) {
+                if (step == 0) {
+                    start = i;
+                    step = 1;
+                }
+                char c = ch[i];
+                word.append(c);
+                String tmp = word.toString();
+                if (i == start) {
+                    if (!firstword_map.containsKey(tmp.toLowerCase())) {
+                        step = 0;
+                        ret.append(ch[start]);
+                        word.delete(0, word.length());
+                        i = start;
+                        continue;
+                    } else {
+                        max_length = firstword_map.get(tmp.toLowerCase());
+                    }
+                }
+                if (wfc_map.containsKey(tmp.toLowerCase())) {
+                    ret.append("");
+                    step = 0;
+                } else if (word.length() >= max_length || i >= ch.length - 1) {
+                    step = 0;
+                    ret.append(ch[start]);
+                    word.delete(0, word.length());
+                    i = start;
+                }
+            }
+        }
+
+        String rs = ret.toString().replace("⊙", "");
+        return rs;
+    }
+
+    public String filter_search(String content) {
+        if (content == null || content.length() <= 0) {
+            return "";
+        }
+        HashMap<String, String> fqc_map = KeyWordFilter.getInstance()
+                .getFqcMap();
+        HashMap<String, String> wfc_map = KeyWordFilter.getInstance()
+                .getWfcMap();
+        HashMap<String, Integer> firstword_map = KeyWordFilter.getInstance()
+                .getFirstwordMap();
+        HashMap<String, Integer> firstword_fqc_map = KeyWordFilter
+                .getInstance().getFirstwordFqcMap();
+
+        char[] ch = content.toCharArray();
+        StringBuffer ret = new StringBuffer();
+        StringBuffer word = new StringBuffer();
+        int start = 0;
+        int step = 0;
+        int max_length = 1;
+        for (int i = 0; i < ch.length; i++) {
+            if (step == 0) {
+                start = i;
+                step = 1;
+            }
+            char c = ch[i];
+            word.append(c);
+            String tmp = word.toString();
+            if (i == start) {
+                if (!firstword_fqc_map.containsKey(tmp.toLowerCase())) {
+                    step = 0;
+                    ret.append(ch[start]);
+                    word.delete(0, word.length());
+                    i = start;
+                    continue;
+                } else {
+                    max_length = firstword_fqc_map.get(tmp.toLowerCase());
+                }
+            }
+            if (fqc_map.containsKey(tmp.toLowerCase())) {
+                ret.append(fqc_map.get(tmp.toLowerCase()));
+                step = 0;
+            } else if (word.length() >= max_length || i >= ch.length - 1) {
+                step = 0;
+                ret.append(ch[start]);
+                word.delete(0, word.length());
+                i = start;
+            }
+        }
+        ch = ret.toString().toCharArray();
+        ret = new StringBuffer();
+        word = new StringBuffer();
+        start = 0;
+        step = 0;
+
+        for (int i = 0; i < ch.length; i++) {
+            if (step == 0) {
+                start = i;
+                step = 1;
+            }
+            char c = ch[i];
+            word.append(c);
+            String tmp = word.toString();
+            if (i == start) {
+                if (!firstword_map.containsKey(tmp.toLowerCase())) {
+                    step = 0;
+                    ret.append(ch[start]);
+                    word.delete(0, word.length());
+                    i = start;
+                    continue;
+                } else {
+                    max_length = firstword_map.get(tmp.toLowerCase());
+                }
+            }
+            if (wfc_map.containsKey(tmp.toLowerCase())) {
+                ret.append("");
+                step = 0;
+            } else if (word.length() >= max_length || i >= ch.length - 1) {
+                step = 0;
+                ret.append(ch[start]);
+                word.delete(0, word.length());
+                i = start;
+            }
+        }
+
+        String rs = ret.toString().replace("⊙", "");
+        return rs;
+    }
+
+    public String filter_jk(String content, String sta, String usid,
+                            String mgcstyle1, String mgcstyle2, String wfcstyle1,
+                            String wfcstyle2) {
+        if (content == null || content.length() <= 0) {
+            return "";
+        }
+        if (usid == null) {
+            usid = "0";
+        }
+        HashMap<String, String> wfc_map = KeyWordFilter.getInstance()
+                .getWfcMap();
+        HashMap<String, String> fqc_map = KeyWordFilter.getInstance()
+                .getFqcMap();
+        HashMap<String, Integer> firstword_map = KeyWordFilter.getInstance()
+                .getFirstwordMap();
+        HashMap<String, Integer> firstword_fqc_map = KeyWordFilter
+                .getInstance().getFirstwordFqcMap();
+
+        char[] ch = content.toCharArray();
+        StringBuffer ret = new StringBuffer();
+        StringBuffer word = new StringBuffer();
+        int start = 0;
+        int step = 0;
+        int max_length = 1;
+        for (int i = 0; i < ch.length; i++) {
+            if (step == 0) {
+                start = i;
+                step = 1;
+            }
+            char c = ch[i];
+            word.append(c);
+            String tmp = word.toString();
+            if (i == start) {
+                if (!firstword_fqc_map.containsKey(tmp.toLowerCase())) {
+                    step = 0;
+                    ret.append(ch[start]);
+                    word.delete(0, word.length());
+                    i = start;
+                    continue;
+                } else {
+                    max_length = firstword_fqc_map.get(tmp.toLowerCase());
+                }
+            }
+            if (fqc_map.containsKey(tmp.toLowerCase())) {
+                ret.append(fqc_map.get(tmp.toLowerCase()));
+                step = 0;
+            } else if (word.length() >= max_length || i >= ch.length - 1) {
+                step = 0;
+                ret.append(ch[start]);
+                word.delete(0, word.length());
+                i = start;
+            }
+        }
+        ch = ret.toString().toCharArray();
+        ret = new StringBuffer();
+        word = new StringBuffer();
+        start = 0;
+        step = 0;
+
+        if (sta.equals("1")) {
+            for (int i = 0; i < ch.length; i++) {
+                if (step == 0) {
+                    start = i;
+                    step = 1;
+                }
+                char c = ch[i];
+                word.append(c);
+                String tmp = word.toString();
+                if (i == start) {
+                    if (!firstword_map.containsKey(tmp.toLowerCase())) {
+                        step = 0;
+                        ret.append(ch[start]);
+                        word.delete(0, word.length());
+                        i = start;
+                        continue;
+                    } else {
+                        max_length = firstword_map.get(tmp.toLowerCase());
+                    }
+                }
+                if (wfc_map.containsKey(tmp.toLowerCase())) {
+                    ret.append(wfcstyle1);
+                    ret.append(tmp.toLowerCase());
+                    ret.append(wfcstyle2);
+                    step = 0;
+                } else if (word.length() >= max_length || i >= ch.length - 1) {
+                    step = 0;
+                    ret.append(ch[start]);
+                    word.delete(0, word.length());
+                    i = start;
+                }
+            }
+        } else if (sta.equals("0")) {
+            for (int i = 0; i < ch.length; i++) {
+                if (step == 0) {
+                    start = i;
+                    step = 1;
+                }
+                char c = ch[i];
+                word.append(c);
+                String tmp = word.toString();
+                if (i == start) {
+                    if (!firstword_map.containsKey(tmp.toLowerCase())) {
+                        step = 0;
+                        ret.append(ch[start]);
+                        word.delete(0, word.length());
+                        i = start;
+                        continue;
+                    } else {
+                        max_length = firstword_map.get(tmp.toLowerCase());
+                    }
+                }
+                if (wfc_map.containsKey(tmp.toLowerCase())) {
+                    ret.append(wfcstyle1);
+                    ret.append(tmp.toLowerCase());
+                    ret.append(wfcstyle2);
+                    step = 0;
+                } else if (word.length() >= max_length || i >= ch.length - 1) {
+                    step = 0;
+                    ret.append(ch[start]);
+                    word.delete(0, word.length());
+                    i = start;
+                }
+            }
+        }
+
+        String rs = ret.toString().replace("⊙", "");
+        return rs;
+    }
+
+}

+ 1 - 1
app-base/src/main/java/com/efunbox/base/util/Logger.java

@@ -1,4 +1,4 @@
-package com.efunbox.base.util;
+package com.edufound.base.util;
 
 import android.app.Application;
 

+ 1 - 1
app-base/src/main/java/com/efunbox/base/util/MMKVUtil.java

@@ -1,4 +1,4 @@
-package com.efunbox.base.util;
+package com.edufound.base.util;
 
 
 import android.os.Parcelable;

+ 27 - 0
app-base/src/main/java/com/edufound/base/util/NetworkUtil.java

@@ -0,0 +1,27 @@
+package com.edufound.base.util;
+
+import android.content.Context;
+import android.net.ConnectivityManager;
+import android.net.NetworkInfo;
+
+public class NetworkUtil {
+    public static final int TYPE_WIFI = 1;
+    public static final int TYPE_MOBILE = 2;
+    public static final int TYPE_NOT_CONNECTED = 0;
+
+
+    public static int getConnectivityStatus(Context context) {
+        ConnectivityManager cm = (ConnectivityManager) context.getApplicationContext()
+                .getSystemService(Context.CONNECTIVITY_SERVICE);
+
+        NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
+        if (null != activeNetwork) {
+            if (activeNetwork.getType() == ConnectivityManager.TYPE_WIFI)
+                return TYPE_WIFI;
+
+            if (activeNetwork.getType() == ConnectivityManager.TYPE_MOBILE)
+                return TYPE_MOBILE;
+        }
+        return TYPE_NOT_CONNECTED;
+    }
+}

+ 147 - 0
app-base/src/main/java/com/edufound/base/util/OkHttpClient.java

@@ -0,0 +1,147 @@
+package com.edufound.base.util;
+
+import android.app.Activity;
+import android.content.Context;
+import android.os.Environment;
+
+import androidx.annotation.Nullable;
+
+import com.edufound.base.callback.OkHttpCallback;
+import com.okhttplib.HttpInfo;
+import com.okhttplib.OkHttpUtil;
+import com.okhttplib.annotation.CacheType;
+import com.okhttplib.annotation.Encoding;
+import com.okhttplib.callback.Callback;
+import com.okhttplib.callback.Callback;
+import com.okhttplib.cookie.PersistentCookieJar;
+import com.okhttplib.cookie.cache.SetCookieCache;
+import com.okhttplib.cookie.persistence.SharedPrefsCookiePersistor;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.net.Socket;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import okhttp3.Interceptor;
+
+public class OkHttpClient {
+    //初始化OKHTTP
+    private static String downloadFileDir = Environment.getExternalStorageDirectory().getPath() + "/okHttp_download/";
+    private static String cacheDir = Environment.getExternalStorageDirectory().getPath() + "/okHttp_cache";
+    private static Map<String, String> mHeaders;
+
+    public static void initOkHttpUtil(Context context) {
+
+        //添加自定义拦截器
+        List<Interceptor> cusInterceptors = new ArrayList<>();
+        cusInterceptors.add(new RetryInterceptor(2));
+
+
+        OkHttpUtil.init(context)
+                .setConnectTimeout(10)//连接超时时间
+                .setWriteTimeout(300)//写超时时间
+                .setReadTimeout(300)//读超时时间
+                .setMaxCacheSize(10 * 1024 * 1024)//缓存空间大小
+                .setCacheType(CacheType.FORCE_NETWORK)//缓存类型
+                .setHttpLogTAG(context.getPackageName() + "--HttpLog")//设置请求日志标识
+                .setIsGzip(false)//Gzip压缩,需要服务端支持
+                .setShowHttpLog(true)//显示请求日志
+                .setShowLifecycleLog(false)//显示Activity销毁日志
+                .setRetryOnConnectionFailure(false)//失败后不自动重连
+                .setCachedDir(new File(cacheDir))//设置缓存目录
+                .setDownloadFileDir(downloadFileDir)//文件下载保存目录
+                .setResponseEncoding(Encoding.UTF_8)//设置全局的服务器响应编码
+                .setRequestEncoding(Encoding.UTF_8)//设置全局的请求参数编码
+//                    .setHttpsCertificate("12306.cer")//设置全局Https证书
+                .setInterceptors(cusInterceptors)
+                .addResultInterceptor(HttpInterceptor.ResultInterceptor)//请求结果拦截器
+                .addExceptionInterceptor(HttpInterceptor.ExceptionInterceptor)//请求链路异常拦截器
+                .setCookieJar(new PersistentCookieJar(new SetCookieCache(), new SharedPrefsCookiePersistor(context)))//持久化cookie
+                .build();
+        refHeader();
+    }
+
+    private static void refHeader() {
+        if (mHeaders == null) {
+            mHeaders = new HashMap<>();
+        }
+        mHeaders.clear();
+        mHeaders.put("uid", BaseConsts.getUID());
+        mHeaders.put("channelCode", BaseConsts.getUMengChannel());
+    }
+
+
+    public static void doGetAsync(Class clazz, HttpInfo.Builder info, Callback callback) {
+        refHeader();
+        OkHttpUtil.getDefault(clazz.getName()).doGetAsync(info.addHeads(mHeaders).build(), callback);
+    }
+
+
+    public static void doPostAsync(Class clazz, HttpInfo.Builder info, Callback callback) {
+        refHeader();
+        OkHttpUtil.getDefault(clazz.getName()).doPostAsync(info.addHeads(mHeaders).build(), callback);
+
+    }
+
+
+    public static void doPutAsync(Class clazz, HttpInfo.Builder info, Callback callback) {
+        refHeader();
+        OkHttpUtil.getDefault(clazz.getName()).doPutAsync(info.addHeads(mHeaders).build(), callback);
+    }
+
+    public static void doDeleteAsync(Class clazz, HttpInfo.Builder info, Callback callback) {
+        refHeader();
+        OkHttpUtil.getDefault(clazz.getName()).doDeleteAsync(info.addHeads(mHeaders).build(), callback);
+    }
+
+    public static void doUploadFile(Class clazz, HttpInfo.Builder info) {
+        refHeader();
+        OkHttpUtil.getDefault(clazz.getName()).doUploadFileAsync(info.addHeads(mHeaders).build());
+    }
+
+
+    public static void cancelRequest(Class clazz) {
+        OkHttpUtil.getDefault().cancelRequest(clazz.getName());
+    }
+
+
+    public static boolean CheckUrlAddress(String address) {
+        Socket socket = null;
+        boolean isSuccess = false;
+        try {
+            URL url = new URL(address);
+            String host = url.getHost();
+            int port = url.getPort();
+            if (port == -1) {
+                port = 80;
+            }
+            socket = new Socket();
+            InetSocketAddress isa = new InetSocketAddress(InetAddress.getByName(host), port);
+
+            socket.connect(isa, 500);
+            if (socket.isConnected()) {
+                isSuccess = true;
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            if (socket != null) {
+                try {
+                    socket.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        return isSuccess;
+    }
+
+}
+
+

+ 1 - 1
app-base/src/main/java/com/efunbox/base/util/QRCodeUtil.java

@@ -1,4 +1,4 @@
-package com.efunbox.base.util;
+package com.edufound.base.util;
 
 import android.graphics.Bitmap;
 import android.graphics.Matrix;

+ 32 - 0
app-base/src/main/java/com/edufound/base/util/RetryInterceptor.java

@@ -0,0 +1,32 @@
+package com.edufound.base.util;
+
+import java.io.IOException;
+
+import okhttp3.Interceptor;
+import okhttp3.Request;
+import okhttp3.Response;
+
+/**
+ * 自定义拦截器
+ * 1.请求失败之后重试请求
+ */
+public class RetryInterceptor implements Interceptor {
+
+    public int maxRetry;//最大重试次数
+    private int retryNum = 0;//假如设置为3次重试的话,则最大可能请求4次(默认1次+3次重试)
+
+    public RetryInterceptor(int maxRetry) {
+        this.maxRetry = maxRetry;
+    }
+
+    @Override
+    public Response intercept(Chain chain) throws IOException {
+        Request request = chain.request();
+        Response response = chain.proceed(request);
+        while (!response.isSuccessful() && retryNum < maxRetry) {
+            retryNum++;
+            response = chain.proceed(request);
+        }
+        return response;
+    }
+}

+ 1 - 1
app-base/src/main/java/com/efunbox/base/util/SizeUtils.java

@@ -1,4 +1,4 @@
-package com.efunbox.base.util;
+package com.edufound.base.util;
 
 import android.content.Context;
 import android.util.DisplayMetrics;

+ 1 - 1
app-base/src/main/java/com/efunbox/base/util/TimeUtil.java

@@ -1,4 +1,4 @@
-package com.efunbox.base.util;
+package com.edufound.base.util;
 
 import android.text.format.Time;
 

+ 62 - 0
app-base/src/main/java/com/edufound/base/util/WordFilter.java

@@ -0,0 +1,62 @@
+/*
+
+
+  审核状态标识:正常:1;不正常:0
+
+
+*/
+package com.edufound.base.util;
+
+
+import com.hjq.toast.Toaster;
+
+public class WordFilter {
+    public KeyWordFilter kwf = KeyWordFilter.getInstance();
+
+    //	public String filter_in_com(String content){
+//		return kwf.filter_in(content, "1","0");
+//	}
+//	public String filter_in_info(String content){
+//		return kwf.filter_in(content, "0","0");
+//	}
+//	public String filter_jk_com(String content){
+//		return kwf.filter_jk(content,"1","0","<font color=#ff0000>","</font>","<font color=#00ff00>","</font>");
+//	}
+//    public String filter_jk_info(String content) {
+//        return kwf.filter_jk(content, "0", "0", "<font color=#ff0000>", "</font>", "<font color=#00ff00>", "</font>");
+//    }
+
+    public boolean filter_jk_info2(String content) {
+        String message = kwf.filter_jk(content, "0", "0", "<mgc>", "</mgc>", "<mgc>", "</mgc>");
+        if (message.contains("<mgc>")) {
+            //有敏感词汇
+            Logger.e(message);
+            Toaster.showShort("有敏感词汇");
+            return false;
+        }
+        return true;
+    }
+
+//	public String filter_out_com(String content){
+//		return kwf.filter_out(content, "1","0");
+//	}
+//	public String filter_out_info(String content){
+//		return kwf.filter_out(content, "0","0");
+//	}
+
+    public String filter_jk(String content, String sta, String mgcstyle1, String mgcstyle2, String wfcstyle1, String wfcstyle2) {
+        return kwf.filter_jk(content, sta, "0", mgcstyle1, mgcstyle2, wfcstyle1, wfcstyle2);
+    }
+
+    public String filter_search(String content) {
+        return kwf.filter_search(content);
+    }
+
+    /*
+     * 重新读取词库文件
+     */
+    public boolean reload() {
+        return kwf.reload();
+    }
+
+}

+ 6 - 0
app-base/src/main/java/com/edufound/base/view/CrashActivityView.java

@@ -0,0 +1,6 @@
+package com.edufound.base.view;
+
+import com.edufound.base.View;
+
+public interface CrashActivityView extends View {
+}

+ 0 - 58
app-base/src/main/java/com/efunbox/base/BaseMvpFragment.java

@@ -1,58 +0,0 @@
-package com.efunbox.base;
-
-import android.content.Context;
-import android.os.Bundle;
-import android.view.LayoutInflater;
-import android.view.ViewGroup;
-
-import androidx.annotation.Nullable;
-import androidx.fragment.app.Fragment;
-
-import com.efunbox.base.util.EfunboxUtil;
-
-
-public abstract class BaseMvpFragment<M extends Model, V extends View, P extends BasePresenter> extends Fragment implements BaseMvp<M, V, P> {
-    protected P mPresenter;
-    protected android.view.View mRootView;
-
-    @Override
-    public void onAttach(Context context) {
-        super.onAttach(context);
-
-        mPresenter = createPresenter();
-        if (mPresenter != null) {
-            mPresenter.registerModel(createModel());
-            mPresenter.registerView(createView());
-        }
-    }
-
-
-    @Override
-    public android.view.View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
-        EfunboxUtil.initDesignSize(getActivity());
-        android.view.View view = inflater.inflate(this.getLayoutId(), container, false);
-        mRootView = view;
-        initView(view);
-        return view;
-    }
-
-
-    protected abstract int getLayoutId();
-
-    /**
-     * 初始化视图
-     *
-     * @param view
-     */
-    protected abstract void initView(android.view.View view);
-
-
-    @Override
-    public void onDetach() {
-        super.onDetach();
-        if (mPresenter != null) {
-            mPresenter.destroy();
-        }
-    }
-
-}

+ 0 - 123
app-base/src/main/java/com/efunbox/base/MyApplication.java

@@ -1,123 +0,0 @@
-package com.efunbox.base;
-
-import android.app.Activity;
-import android.app.Application;
-import android.content.Intent;
-import android.os.Build;
-import android.os.Handler;
-import android.os.Looper;
-
-import androidx.annotation.RequiresApi;
-
-import com.efunbox.base.activity.CrashDialogActivity;
-import com.efunbox.base.crash.Cockroach;
-import com.efunbox.base.crash.CrashLog;
-import com.efunbox.base.crash.DebugSafeModeTipActivity;
-import com.efunbox.base.crash.DebugSafeModeUI;
-import com.efunbox.base.crash.ExceptionHandler;
-import com.efunbox.base.util.BaseConsts;
-import com.efunbox.base.util.DeviceUuidFactory;
-import com.efunbox.base.util.EfunboxUtil;
-import com.efunbox.base.util.GlideUtils;
-import com.efunbox.base.util.OkHttpClient;
-import com.orhanobut.logger.Logger;
-import com.tencent.mmkv.MMKV;
-
-import org.xmlpull.v1.XmlPullParserException;
-import org.xmlpull.v1.XmlPullParserFactory;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class MyApplication implements ModuleMediator.ModuleInitial {
-
-    public static List<Activity> mActivityList = new ArrayList<>();
-
-
-    @Override
-    public void initModule(Application application) {
-        try {
-            Logger.e("com.efunbox.base.MyApplication");
-            BaseConsts.setAppPackageName(application.getPackageName());
-            //初始化异常
-            if (!BaseConsts.isDebug()) {
-                Logger.e("Consts.isDebug:" + BaseConsts.isDebug());
-                //不在测试环境下,初始化异常
-                initException(application);
-            }
-            //初始化mmkv
-            MMKV.initialize(application);
-            //初始化OKhttp3
-            OkHttpClient.initOkHttpUtil(application);
-            //修改xml问题
-            XmlPullParserFactory.newInstance().setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
-
-            //清除图片缓存
-            new Thread() {
-                @Override
-                public void run() {
-                    super.run();
-                    GlideUtils.removeAll(application);
-                }
-            }.start();
-        } catch (XmlPullParserException e) {
-            e.printStackTrace();
-        }
-
-    }
-
-
-    private void initException(Application application) {
-
-
-        final Thread.UncaughtExceptionHandler sysExcepHandler = Thread.getDefaultUncaughtExceptionHandler();
-        DebugSafeModeUI.init(application);
-        Cockroach.install(application, new ExceptionHandler() {
-            @Override
-            protected void onUncaughtExceptionHappened(Thread thread, Throwable throwable) {
-                CrashLog.saveCrashLog(application, throwable);
-                new Handler(Looper.getMainLooper()).post(new Runnable() {
-                    @Override
-                    public void run() {
-                        Logger.e("Cockroach.install:onUncaughtExceptionHappened");
-                    }
-                });
-            }
-
-            @Override
-            protected void onBandageExceptionHappened(Throwable throwable) {
-                throwable.printStackTrace();//打印警告级别log,该throwable可能是最开始的bug导致的,无需关心
-            }
-
-            @Override
-            protected void onEnterSafeMode() {
-//                int tips = R.string.safe_mode_tips;
-//                Toast.makeText(Consts.getmApplicAtion(), getResources().getString(tips), Toast.LENGTH_LONG).show();
-//                DebugSafeModeUI.showSafeModeUI();
-
-                if (BaseConsts.isDebug()) {
-                    Intent intent = new Intent(application, DebugSafeModeTipActivity.class);
-                    intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
-                    application.startActivity(intent);
-                } else {
-                    Intent intent = new Intent(application, CrashDialogActivity.class);
-                    intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
-                    application.startActivity(intent);
-                }
-            }
-
-            @RequiresApi(api = Build.VERSION_CODES.N)
-            @Override
-            protected void onMayBeBlackScreen(Throwable e) {
-                Thread thread = Looper.getMainLooper().getThread();
-                e.printStackTrace();
-                //黑屏时建议直接杀死app
-                sysExcepHandler.uncaughtException(thread, new RuntimeException("black screen"));
-                EfunboxUtil.killAppProcess(application, mActivityList);
-            }
-
-        });
-
-    }
-
-}

+ 0 - 125
app-base/src/main/java/com/efunbox/base/cusview/CusToast.java

@@ -1,125 +0,0 @@
-package com.efunbox.base.cusview;
-
-
-import android.content.Context;
-import android.os.Build;
-import android.os.CountDownTimer;
-import android.os.Handler;
-import android.os.Message;
-import android.view.Gravity;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.widget.TextView;
-import android.widget.Toast;
-
-import androidx.annotation.NonNull;
-import androidx.annotation.RequiresApi;
-
-import com.efunbox.base.R;
-import com.efunbox.base.util.EfunboxUtil;
-import com.efunbox.base.util.Logger;
-
-public class CusToast extends Toast {
-    private boolean canceled = true;
-    private Toast toast;
-    private TimeCount time;
-    private TextView toast_content;
-    private static CusToast instance;
-
-
-    public static CusToast getInstance(Context context) {
-        if (instance == null) {
-            instance = new CusToast(context);
-        }
-
-        return instance;
-    }
-
-
-    public CusToast(Context context) {
-        super(context);
-        EfunboxUtil.initDesignSize(context);
-        View layout = LayoutInflater.from(context).inflate(R.layout.toast, null, false);
-        toast_content = (TextView) layout.findViewById(R.id.tvToast);
-        if (toast == null) {
-            toast = new Toast(context);
-        }
-        toast.setGravity(Gravity.CENTER, 0, 0);
-        toast.setDuration(Toast.LENGTH_LONG);
-        toast.setView(layout);
-    }
-
-
-    /**
-     * @param text     要显示的内容
-     * @param duration 显示的时间长
-     *                 根据LENGTH_MAX进行判断
-     *                 如果不匹配,进行系统显示
-     *                 如果匹配,永久显示,直到调用hide()
-     */
-    public void show(String text, int duration) {
-        if (time != null) {
-            time.cancel();
-            time = null;
-        }
-        time = new TimeCount(duration, 1000);//1000是消失渐变时间
-        toast_content.setText(text);
-        time.start();
-        canceled = false;
-        showUntilCancel();
-    }
-
-    /**
-     * 隐藏Toast
-     */
-    public void hide() {
-        if (toast != null) {
-            toast.cancel();
-        }
-        canceled = true;
-    }
-
-    private void showUntilCancel() {
-        if (handler != null) {
-            handler.removeMessages(1);
-        }
-        if (canceled) {
-            return;
-        }
-        toast.show();
-        handler.sendEmptyMessageDelayed(1, 3000);
-    }
-
-    Handler handler = new Handler(new Handler.Callback() {
-        @Override
-        public boolean handleMessage(@NonNull Message message) {
-            switch (message.what) {
-                case 1:
-                    showUntilCancel();
-                    break;
-                default:
-                    throw new IllegalStateException("Unexpected value: " + message.what);
-            }
-            return false;
-        }
-    });
-
-    /**
-     * 计时器
-     */
-    class TimeCount extends CountDownTimer {
-        public TimeCount(long millisInFuture, long countDownInterval) {
-            super(millisInFuture, countDownInterval); // 总时长,计时的时间间隔
-        }
-
-        @Override
-        public void onFinish() { // 计时完毕时触发
-            hide();
-        }
-
-        @Override
-        public void onTick(long millisUntilFinished) { // 计时过程显示
-        }
-
-    }
-}

+ 0 - 6
app-base/src/main/java/com/efunbox/base/model/CrashActivityModel.java

@@ -1,6 +0,0 @@
-package com.efunbox.base.model;
-
-import com.efunbox.base.Model;
-
-public interface CrashActivityModel extends Model {
-}

+ 0 - 6
app-base/src/main/java/com/efunbox/base/model/impl/CrashActivityModelImpl.java

@@ -1,6 +0,0 @@
-package com.efunbox.base.model.impl;
-
-import com.efunbox.base.model.CrashActivityModel;
-
-public class CrashActivityModelImpl implements CrashActivityModel {
-}

+ 0 - 12
app-base/src/main/java/com/efunbox/base/presenter/CrashActivityPresenter.java

@@ -1,12 +0,0 @@
-package com.efunbox.base.presenter;
-
-import com.efunbox.base.BasePresenter;
-import com.efunbox.base.model.CrashActivityModel;
-import com.efunbox.base.view.CrashActivityView;
-
-public class CrashActivityPresenter extends BasePresenter<CrashActivityModel, CrashActivityView> {
-    @Override
-    protected void onViewDestroy() {
-
-    }
-}

+ 0 - 41
app-base/src/main/java/com/efunbox/base/util/BaseConsts.java

@@ -1,41 +0,0 @@
-package com.efunbox.base.util;
-
-import com.efunbox.base.bean.WeChatBean;
-
-public class BaseConsts {
-
-    //是否是debug环境
-    private static boolean isDebug = false;
-
-    //view点击间隔时间
-    public static final int VIEW_CLICK_TIME = 1000;
-
-    //view共用间隔时间
-    public static final boolean VIEW_CLICK_ALL = true;
-
-    //APP的包名
-    private static String APP_PACKAGE_NAME = "";
-
-
-    //微信支付实体类
-    public static WeChatBean WECHAT_INFO;
-
-
-    public static boolean isDebug() {
-        return isDebug;
-    }
-
-    public static void setDebug(boolean debug) {
-        isDebug = debug;
-    }
-
-
-    public static String getAppPackageName() {
-        return APP_PACKAGE_NAME;
-    }
-
-    public static void setAppPackageName(String appPackageName) {
-        APP_PACKAGE_NAME = appPackageName;
-    }
-
-}

+ 0 - 108
app-base/src/main/java/com/efunbox/base/util/OkHttpClient.java

@@ -1,108 +0,0 @@
-package com.efunbox.base.util;
-
-import android.app.Activity;
-import android.content.Context;
-import android.os.Environment;
-
-import androidx.annotation.Nullable;
-
-import com.efunbox.base.callback.OkHttpCallback;
-import com.okhttplib.HttpInfo;
-import com.okhttplib.OkHttpUtil;
-import com.okhttplib.annotation.CacheType;
-import com.okhttplib.annotation.Encoding;
-import com.okhttplib.callback.BaseCallback;
-import com.okhttplib.cookie.PersistentCookieJar;
-import com.okhttplib.cookie.cache.SetCookieCache;
-import com.okhttplib.cookie.persistence.SharedPrefsCookiePersistor;
-
-import java.io.File;
-import java.util.HashMap;
-import java.util.Map;
-
-public class OkHttpClient {
-    //初始化OKHTTP
-    private static String downloadFileDir = Environment.getExternalStorageDirectory().getPath() + "/okHttp_download/";
-    private static String cacheDir = Environment.getExternalStorageDirectory().getPath() + "/okHttp_cache";
-    private static Map<String, String> mHeaders;
-
-    public static void initOkHttpUtil(Context context) {
-        OkHttpUtil.init(context)
-                .setConnectTimeout(10)//连接超时时间
-                .setWriteTimeout(300)//写超时时间
-                .setReadTimeout(300)//读超时时间
-                .setMaxCacheSize(10 * 1024 * 1024)//缓存空间大小
-                .setCacheType(CacheType.FORCE_NETWORK)//缓存类型
-                .setHttpLogTAG("HttpLog")//设置请求日志标识
-                .setIsGzip(false)//Gzip压缩,需要服务端支持
-                .setShowHttpLog(true)//显示请求日志
-                .setShowLifecycleLog(false)//显示Activity销毁日志
-                .setRetryOnConnectionFailure(false)//失败后不自动重连
-                .setCachedDir(new File(cacheDir))//设置缓存目录
-                .setDownloadFileDir(downloadFileDir)//文件下载保存目录
-                .setResponseEncoding(Encoding.UTF_8)//设置全局的服务器响应编码
-                .setRequestEncoding(Encoding.UTF_8)//设置全局的请求参数编码
-//                    .setHttpsCertificate("12306.cer")//设置全局Https证书
-                .addResultInterceptor(HttpInterceptor.ResultInterceptor)//请求结果拦截器
-                .addExceptionInterceptor(HttpInterceptor.ExceptionInterceptor)//请求链路异常拦截器
-                .setCookieJar(new PersistentCookieJar(new SetCookieCache(), new SharedPrefsCookiePersistor(context)))//持久化cookie
-                .build();
-        refHeader();
-    }
-
-    private static void refHeader() {
-        if (mHeaders == null) {
-            mHeaders = new HashMap<>();
-        }
-        mHeaders.clear();
-//        mHeaders.put("uid", Consts.getUID());
-//        mHeaders.put("channelCode", Consts.getUmengChannel());
-    }
-
-
-    public static void doGetAsync(Activity activity, HttpInfo.Builder info, BaseCallback callback) {
-        if (!info.build().getUrl().contains("posts/list")
-                && !info.build().getUrl().contains("/userRead/check")
-                && !info.build().getUrl().contains("/order/info/")) {
-        }
-        refHeader();
-        OkHttpUtil.getDefault(activity).doGetAsync(info.addHeads(mHeaders).build(), new OkHttpCallback(callback));
-    }
-
-    public static void doGetAsync(HttpInfo.Builder info, BaseCallback callback) {
-        if (!info.build().getUrl().contains("posts/list")
-                && !info.build().getUrl().contains("/userRead/check")
-                && !info.build().getUrl().contains("/order/info/")) {
-        }
-        refHeader();
-        OkHttpUtil.getDefault().doGetAsync(info.addHeads(mHeaders).build(), new OkHttpCallback(callback));
-    }
-
-
-    public static void doPostAsync(@Nullable Activity activity, HttpInfo.Builder info, BaseCallback callback) {
-        refHeader();
-        OkHttpUtil.getDefault(activity).doPostAsync(info.addHeads(mHeaders).build(), new OkHttpCallback(callback));
-
-    }
-
-    public static void doPostAsync(HttpInfo.Builder info, BaseCallback callback) {
-        refHeader();
-        OkHttpUtil.getDefault().doPostAsync(info.addHeads(mHeaders).build(), new OkHttpCallback(callback));
-    }
-
-    public static void doPutAsync(Activity activity, HttpInfo.Builder info, BaseCallback callback) {
-        OkHttpUtil.getDefault(activity).doPutAsync(info.addHeads(mHeaders).build(), new OkHttpCallback(callback));
-    }
-
-    public static void doDeleteAsync(Activity activity, HttpInfo.Builder info, BaseCallback callback) {
-        OkHttpUtil.getDefault(activity).doDeleteAsync(info.addHeads(mHeaders).build(), new OkHttpCallback(callback));
-    }
-
-    public static void doUploadFile(Activity activity, HttpInfo.Builder info) {
-        refHeader();
-        OkHttpUtil.getDefault(activity).doUploadFileAsync(info.addHeads(mHeaders).build());
-    }
-
-}
-
-

+ 0 - 6
app-base/src/main/java/com/efunbox/base/view/CrashActivityView.java

@@ -1,6 +0,0 @@
-package com.efunbox.base.view;
-
-import com.efunbox.base.View;
-
-public interface CrashActivityView extends View {
-}

BIN
app-base/src/main/res/drawable/background_white.png


+ 22 - 27
app-base/src/main/res/layout/toast.xml

@@ -1,37 +1,32 @@
 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
     android:layout_gravity="center"
-    android:background="@color/transparent"
-    android:gravity="center">
+    android:background="@drawable/toast_bg"
+    android:gravity="center"
+    android:maxWidth="600dp"
+    android:minWidth="320dp"
+    android:orientation="horizontal">
 
-    <FrameLayout
+
+    <ImageView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_gravity="center" />
+
+    <TextView
+        android:id="@android:id/message"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_gravity="center"
         android:background="@color/transparent"
-        android:gravity="center"
-        android:orientation="horizontal">
-
-        <ImageView
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:layout_gravity="center"
-            android:background="@drawable/toast_bg" />
+        android:gravity="center|left"
+        android:lineSpacingMultiplier="1.5"
+        android:maxWidth="600dp"
+        android:padding="30dp"
+        android:text=""
+        android:textColor="#AB722D"
+        android:textSize="27dp" />
 
-        <TextView
-            android:id="@+id/tvToast"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:layout_gravity="center"
-            android:background="@color/transparent"
-            android:gravity="center"
-            android:lineSpacingMultiplier="1.5"
-            android:maxWidth="600dp"
-            android:padding="30dp"
-            android:text="2222222222222222222222222222222222222\n2\n2\n2\n22"
-            android:textColor="#AB722D"
-            android:textSize="27dp" />
-    </FrameLayout>
 </LinearLayout>

+ 33 - 0
app-base/src/main/res/layout/window_deviceinfo.xml

@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:background="#70C1FF">
+
+    <ScrollView
+            android:layout_width="match_parent"
+            android:layout_height="match_parent">
+
+        <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:orientation="vertical">
+
+            <TextView
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:text="\tDeviceInfo信息:"
+                    android:textColor="@color/white"
+                    android:textSize="40dp"></TextView>
+
+            <TextView
+                    android:id="@+id/deviceinfo"
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent"
+                    android:textColorHighlight="#CCCCCC"
+                    android:textIsSelectable="true"
+                    android:textSize="30dp" />
+        </LinearLayout>
+    </ScrollView>
+
+</FrameLayout>

+ 1 - 1
app-base/src/test/java/com/efunbox/base/ExampleUnitTest.java

@@ -1,4 +1,4 @@
-package com.efunbox.base;
+package com.edufound.base;
 
 import org.junit.Test;
 

+ 1 - 1
app-pay/build.gradle

@@ -6,7 +6,7 @@ android {
         resourcePrefix 'pay_'
 
         if (!isRelease) {
-            applicationId "com.efunbox.pay"
+            applicationId "com.edufound.pay"
             versionCode 1
             versionName "1.0"
         }

+ 3 - 3
app-pay/src/main/AndroidManifest.xml

@@ -1,10 +1,10 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.efunbox.pay">
+    package="com.edufound.pay">
 
     <application android:allowBackup="true">
         <activity
-            android:name="com.efunbox.pay.PayActivity"
+            android:name="com.edufound.pay.PayActivity"
             android:exported="true"
             android:launchMode="singleTask"
             android:maxAspectRatio="2.1"
@@ -13,7 +13,7 @@
             android:splitMotionEvents="false"
             android:theme="@style/FullScreen"></activity>
         <activity
-            android:name="com.efunbox.pay.wxapi.WXPayEntryActivity"
+            android:name="com.edufound.pay.wxapi.WXPayEntryActivity"
             android:exported="true"
             android:launchMode="singleTask"
             android:maxAspectRatio="2.1"

+ 4 - 4
app-pay/src/main/AndroidManifestDebug.xml

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.efunbox.pay">
+    package="com.edufound.pay">
 
     <application
-        android:name="com.efunbox.pay.debug.MyApplication"
+        android:name="com.edufound.pay.debug.MyApplication"
         android:allowBackup="true"
         android:icon="@mipmap/ic_launcher"
         android:label="@string/app_name"
@@ -13,7 +13,7 @@
 
 
         <activity
-            android:name="com.efunbox.pay.PayActivity"
+            android:name="com.edufound.pay.PayActivity"
             android:configChanges="screenLayout|screenSize|keyboardHidden|keyboard|orientation"
             android:exported="true"
             android:launchMode="singleTask"
@@ -32,7 +32,7 @@
 
         </activity>
         <activity
-            android:name="com.efunbox.pay.wxapi.WXPayEntryActivity"
+            android:name="com.edufound.pay.wxapi.WXPayEntryActivity"
             android:configChanges="screenLayout|screenSize|keyboardHidden|keyboard|orientation"
             android:exported="true"
             android:launchMode="singleTask"

+ 6 - 7
app-pay/src/main/java/com/efunbox/pay/MyApplication.java

@@ -1,12 +1,11 @@
-package com.efunbox.pay;
+package com.edufound.pay;
 
 import android.app.Application;
 
-import com.efunbox.base.ModuleMediator;
-import com.efunbox.base.cusview.CusToast;
-import com.efunbox.base.util.BaseConsts;
-import com.efunbox.base.util.Logger;
-import com.efunbox.pay.util.PayConsts;
+import com.edufound.base.ModuleMediator;
+import com.edufound.base.util.BaseConsts;
+import com.edufound.pay.util.PayConsts;
+import com.hjq.toast.Toaster;
 import com.tencent.mm.opensdk.openapi.WXAPIFactory;
 
 public class MyApplication implements ModuleMediator.ModuleInitial {
@@ -14,7 +13,7 @@ public class MyApplication implements ModuleMediator.ModuleInitial {
     @Override
     public void initModule(Application application) {
         if (BaseConsts.WECHAT_INFO == null) {
-            CusToast.getInstance(application).show("未设置BaseConsts.WECHAT_INFO", 1000);
+            Toaster.showShort("未设置BaseConsts.WECHAT_INFO");
         } else {
             PayConsts.mWeChatAPI = WXAPIFactory.createWXAPI(application, BaseConsts.WECHAT_INFO.getAPP_ID());
         }

+ 19 - 13
app-pay/src/main/java/com/efunbox/pay/PayActivity.java

@@ -1,24 +1,27 @@
-package com.efunbox.pay;
+package com.edufound.pay;
 
 import android.view.View;
 import android.widget.Button;
 
 import com.alipay.sdk.app.PayTask;
-import com.efunbox.base.BaseMvpActivity;
-import com.efunbox.base.cusview.CusToast;
-import com.efunbox.base.util.BaseConsts;
-import com.efunbox.pay.model.PayModel;
-import com.efunbox.pay.model.impl.PayModelImpl;
-import com.efunbox.pay.presenter.PayPresenter;
-import com.efunbox.pay.util.PayUtil;
-import com.efunbox.pay.view.PayView;
+import com.edufound.base.BaseMvpActivity;
+import com.edufound.base.util.BaseConsts;
+import com.edufound.base.util.Logger;
+import com.edufound.base.util.OkHttpClient;
+import com.edufound.pay.model.PayModel;
+import com.edufound.pay.model.impl.PayModelImpl;
+import com.edufound.pay.presenter.PayPresenter;
+import com.edufound.pay.view.PayView;
+import com.hjq.toast.Toaster;
+import com.okhttplib.HttpInfo;
+import com.okhttplib.OkHttpUtil;
+import com.okhttplib.callback.Callback;
 import com.tencent.mm.opensdk.modelpay.PayReq;
 import com.tencent.mm.opensdk.openapi.IWXAPI;
 import com.tencent.mm.opensdk.openapi.WXAPIFactory;
 
-import java.util.Map;
-import java.util.SortedMap;
-import java.util.TreeMap;
+import java.io.IOException;
+import java.util.concurrent.TimeUnit;
 
 public class PayActivity extends BaseMvpActivity<PayModel, PayView, PayPresenter> implements PayView {
 
@@ -40,6 +43,7 @@ public class PayActivity extends BaseMvpActivity<PayModel, PayView, PayPresenter
     @Override
     public void initView() {
 
+
         btnWeChatPay = findViewById(R.id.pay_wechat);
         btnAliPay = findViewById(R.id.pay_ali);
 
@@ -50,7 +54,7 @@ public class PayActivity extends BaseMvpActivity<PayModel, PayView, PayPresenter
             @Override
             public void onClick(View view) {
                 if (!WeChatApi.isWXAppInstalled()) {
-                    CusToast.getInstance(mActivity).show("请安装微信", 1000);
+                    Toaster.showShort("请安装微信");
                     return;
                 }
                 //参数详情 https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_2_4.shtml
@@ -88,6 +92,8 @@ public class PayActivity extends BaseMvpActivity<PayModel, PayView, PayPresenter
                 payThread.start();
             }
         });
+
+        mPresenter.a();
     }
 
     @Override

+ 3 - 4
app-base/src/main/java/com/efunbox/base/debug/MyApplication.java

@@ -1,16 +1,15 @@
-package com.efunbox.base.debug;
+package com.edufound.pay.debug;
 
 import android.app.Application;
 
-import com.efunbox.base.util.Logger;
+import com.edufound.base.util.Logger;
 
 
 public class MyApplication extends Application {
-
     @Override
     public void onCreate() {
         super.onCreate();
         Logger.init(this);
-        new com.efunbox.base.MyApplication().initModule(this);
+        new com.edufound.pay.MyApplication().initModule(this);
     }
 }

+ 18 - 0
app-pay/src/main/java/com/edufound/pay/model/PayModel.java

@@ -0,0 +1,18 @@
+package com.edufound.pay.model;
+
+
+import android.app.Activity;
+
+import com.edufound.base.Model;
+import com.edufound.base.callback.OkHttpCallback;
+
+import org.repackage.com.zui.opendeviceidlibrary.OpenDeviceId;
+
+
+import com.okhttplib.callback.Callback;
+
+public interface PayModel extends Model {
+    void isLogin(Callback callback);
+
+    void recommendGet(String grade, Callback callback);
+}

+ 13 - 0
app-pay/src/main/java/com/edufound/pay/model/WXEntryModel.java

@@ -0,0 +1,13 @@
+package com.edufound.pay.model;
+
+import android.app.Activity;
+
+import com.edufound.base.Model;
+import com.edufound.base.callback.OkHttpCallback;
+import com.okhttplib.HttpInfo;
+
+public interface WXEntryModel extends Model {
+    void getAccessToken(HttpInfo.Builder info, OkHttpCallback callback);
+
+    void getUserInfo(HttpInfo.Builder info, OkHttpCallback callback);
+}

+ 30 - 0
app-pay/src/main/java/com/edufound/pay/model/impl/PayModelImpl.java

@@ -0,0 +1,30 @@
+package com.edufound.pay.model.impl;
+
+import android.app.Activity;
+
+import com.edufound.base.callback.OkHttpCallback;
+import com.edufound.base.util.BaseConsts;
+import com.edufound.base.util.DeviceUuidFactory;
+import com.edufound.base.util.OkHttpClient;
+import com.edufound.pay.model.PayModel;
+import com.okhttplib.HttpInfo;
+import com.okhttplib.callback.Callback;
+
+import java.util.concurrent.TimeUnit;
+
+public class PayModelImpl implements PayModel {
+
+
+    @Override
+    public void isLogin(Callback callback) {
+        OkHttpClient.doGetAsync(PayModelImpl.class, new HttpInfo.Builder().setUrl(BaseConsts.getFinalApiUrl() + "/wx/v3/user/isLogin")
+                .addParam("deviceCode", DeviceUuidFactory.getUuid()), callback);
+    }
+
+    @Override
+    public void recommendGet(String grade, Callback callback) {
+        OkHttpClient.doGetAsync(PayModelImpl.class,
+                new HttpInfo.Builder().setUrl(BaseConsts.getFinalApiUrl() + "/wx/userRead/recommend").addParam("grade", grade).addParam("pageNo", "1").addParam("pageSize", "100000")
+                , callback);
+    }
+}

+ 20 - 0
app-pay/src/main/java/com/edufound/pay/model/impl/WXEntryModelImpl.java

@@ -0,0 +1,20 @@
+package com.edufound.pay.model.impl;
+
+import android.app.Activity;
+
+import com.edufound.base.callback.OkHttpCallback;
+import com.edufound.base.util.OkHttpClient;
+import com.edufound.pay.model.WXEntryModel;
+import com.okhttplib.HttpInfo;
+
+public class WXEntryModelImpl implements WXEntryModel {
+    @Override
+    public void getAccessToken(HttpInfo.Builder info, OkHttpCallback callback) {
+        OkHttpClient.doGetAsync(WXEntryModelImpl.class, info, callback);
+    }
+
+    @Override
+    public void getUserInfo(HttpInfo.Builder info, OkHttpCallback callback) {
+        OkHttpClient.doGetAsync(WXEntryModelImpl.class, info, callback);
+    }
+}

+ 36 - 0
app-pay/src/main/java/com/edufound/pay/presenter/PayPresenter.java

@@ -0,0 +1,36 @@
+package com.edufound.pay.presenter;
+
+import com.edufound.base.BasePresenter;
+import com.edufound.base.callback.OkHttpCallback;
+import com.edufound.base.util.Logger;
+import com.edufound.pay.model.PayModel;
+import com.edufound.pay.view.PayView;
+import com.okhttplib.HttpInfo;
+import com.okhttplib.callback.BaseCallback;
+import com.okhttplib.callback.Callback;
+
+import java.io.IOException;
+
+public class PayPresenter extends BasePresenter<PayModel, PayView> {
+
+
+    public void a() {
+        mModel.recommendGet("PRIMARY_FIRST_GRADE", new Callback() {
+            @Override
+            public void onSuccess(HttpInfo info) throws IOException {
+                Logger.e("请求成功");
+            }
+
+            @Override
+            public void onFailure(HttpInfo info) throws IOException {
+                Logger.e("请求失败");
+            }
+        });
+    }
+
+
+    @Override
+    protected void onViewDestroy() {
+
+    }
+}

+ 11 - 14
app-pay/src/main/java/com/efunbox/pay/presenter/WXEntryPresenter.java

@@ -1,18 +1,15 @@
-package com.efunbox.pay.presenter;
+package com.edufound.pay.presenter;
 
-import com.efunbox.base.BasePresenter;
-import com.efunbox.base.callback.OkHttpCallback;
-import com.efunbox.base.cusview.CusToast;
-import com.efunbox.base.util.BaseConsts;
-import com.efunbox.base.util.Logger;
-import com.efunbox.pay.model.WXEntryModel;
-import com.efunbox.pay.view.WXEntryView;
-import com.google.gson.JsonObject;
+import com.edufound.base.BasePresenter;
+import com.edufound.base.callback.OkHttpCallback;
+import com.edufound.base.util.BaseConsts;
+import com.edufound.base.util.Logger;
+import com.edufound.pay.model.WXEntryModel;
+import com.edufound.pay.view.WXEntryView;
+import com.hjq.toast.Toaster;
 import com.okhttplib.HttpInfo;
 import com.okhttplib.callback.Callback;
 
-import org.json.JSONException;
-
 import java.io.IOException;
 
 public class WXEntryPresenter extends BasePresenter<WXEntryModel, WXEntryView> {
@@ -33,7 +30,7 @@ public class WXEntryPresenter extends BasePresenter<WXEntryModel, WXEntryView> {
                 .append("&grant_type=authorization_code");
         HttpInfo.Builder builder = new HttpInfo.Builder();
         builder.setUrl(loginUrl.toString());
-        mModel.getAccessToken(getView().getBaseActivity(), builder, new OkHttpCallback(new Callback() {
+        mModel.getAccessToken(builder, new OkHttpCallback(new Callback() {
             @Override
             public void onSuccess(HttpInfo info) throws IOException {
                 //登录成功之后获取token
@@ -53,14 +50,14 @@ public class WXEntryPresenter extends BasePresenter<WXEntryModel, WXEntryView> {
 
             @Override
             public void onFailure(HttpInfo info) throws IOException {
-                CusToast.getInstance(getView().getBaseActivity()).show("错误:" + info.getRetDetail(), 2000);
+                Toaster.show("错误:" + info.getRetDetail());
             }
         }));
     }
 
 
     public void getUserInfo(String url) {
-        mModel.getUserInfo(getView().getBaseActivity(), new HttpInfo.Builder().setUrl(url), new OkHttpCallback(new Callback() {
+        mModel.getUserInfo(new HttpInfo.Builder().setUrl(url), new OkHttpCallback(new Callback() {
             @Override
             public void onSuccess(HttpInfo info) throws IOException {
                 Logger.e("获取成功:" + info.getRetDetail());

+ 5 - 7
app-pay/src/main/java/com/efunbox/pay/util/LoginUtil.java

@@ -1,19 +1,17 @@
-package com.efunbox.pay.util;
+package com.edufound.pay.util;
 
 import android.content.Context;
 
-import com.efunbox.base.cusview.CusToast;
-import com.efunbox.base.util.BaseConsts;
+import com.edufound.base.util.BaseConsts;
+import com.hjq.toast.Toaster;
 import com.tencent.mm.opensdk.modelmsg.SendAuth;
-import com.tencent.mm.opensdk.openapi.IWXAPI;
-import com.tencent.mm.opensdk.openapi.WXAPIFactory;
 
 public class LoginUtil {
 
-    public static void WeChatLogin(Context context) {
+    public static void WeChatLogin() {
         if (BaseConsts.WECHAT_INFO != null) {
             if (!PayConsts.mWeChatAPI.isWXAppInstalled()) {
-                CusToast.getInstance(context).show("请安装微信", 1000);
+                Toaster.showShort("请安装微信");
             } else {
                 final SendAuth.Req req = new SendAuth.Req();
                 req.scope = "snsapi_userinfo";

+ 1 - 1
app-pay/src/main/java/com/efunbox/pay/util/MD5Utils.java

@@ -1,4 +1,4 @@
-package com.efunbox.pay.util;
+package com.edufound.pay.util;
 
 import java.math.BigInteger;
 import java.security.MessageDigest;

+ 7 - 0
app-pay/src/main/java/com/edufound/pay/util/PayConsts.java

@@ -0,0 +1,7 @@
+package com.edufound.pay.util;
+
+import com.tencent.mm.opensdk.openapi.IWXAPI;
+
+public class PayConsts {
+    public static IWXAPI mWeChatAPI;
+}

+ 1 - 1
app-pay/src/main/java/com/efunbox/pay/util/PayUtil.java

@@ -1,4 +1,4 @@
-package com.efunbox.pay.util;
+package com.edufound.pay.util;
 
 import java.util.Iterator;
 import java.util.Map;

+ 6 - 0
app-pay/src/main/java/com/edufound/pay/view/PayView.java

@@ -0,0 +1,6 @@
+package com.edufound.pay.view;
+
+import com.edufound.base.View;
+
+public interface PayView  extends View {
+}

+ 6 - 0
app-pay/src/main/java/com/edufound/pay/view/WXEntryView.java

@@ -0,0 +1,6 @@
+package com.edufound.pay.view;
+
+import com.edufound.base.View;
+
+public interface WXEntryView extends View {
+}

+ 12 - 14
app-pay/src/main/java/com/efunbox/pay/wxapi/WXEntryActivity.java

@@ -1,18 +1,16 @@
-package com.efunbox.pay.wxapi;
+package com.edufound.pay.wxapi;
 
 
 import android.view.View;
 
-import com.efunbox.base.BaseMvpActivity;
-import com.efunbox.base.cusview.CusToast;
-import com.efunbox.base.util.BaseConsts;
-import com.efunbox.base.util.Logger;
-import com.efunbox.base.util.OkHttpClient;
-import com.efunbox.pay.model.WXEntryModel;
-import com.efunbox.pay.model.impl.WXEntryModelImpl;
-import com.efunbox.pay.presenter.WXEntryPresenter;
-import com.efunbox.pay.view.WXEntryView;
-import com.okhttplib.HttpInfo;
+import com.edufound.base.BaseMvpActivity;
+import com.edufound.base.util.BaseConsts;
+import com.edufound.base.util.Logger;
+import com.edufound.pay.model.WXEntryModel;
+import com.edufound.pay.model.impl.WXEntryModelImpl;
+import com.edufound.pay.presenter.WXEntryPresenter;
+import com.edufound.pay.view.WXEntryView;
+import com.hjq.toast.Toaster;
 import com.tencent.mm.opensdk.constants.ConstantsAPI;
 import com.tencent.mm.opensdk.modelbase.BaseReq;
 import com.tencent.mm.opensdk.modelbase.BaseResp;
@@ -72,16 +70,16 @@ public class WXEntryActivity extends BaseMvpActivity<WXEntryModel, WXEntryView,
                     mPresenter.getAccessToken(code);
                     break;
                 case BaseResp.ErrCode.ERR_AUTH_DENIED://用户拒绝授权
-                    CusToast.getInstance(mActivity).show("用户拒绝授权", 1000);
+                    Toaster.showShort("用户拒绝授权");
                     finish();
                     break;
                 case BaseResp.ErrCode.ERR_USER_CANCEL://用户取消
-                    CusToast.getInstance(mActivity).show("用户取消授权", 1000);
+                    Toaster.showShort("用户取消授权");
                     finish();
                     break;
                 default:
                     Logger.e("baseResp.errCode:" + baseResp.errCode);
-                    CusToast.getInstance(mActivity).show("errCode:" + baseResp, 1000);
+                    Toaster.showShort("errCode:" + baseResp);
                     finish();
                     break;
             }

+ 3 - 3
app-pay/src/main/java/com/efunbox/pay/wxapi/WXPayEntryActivity.java

@@ -1,11 +1,11 @@
-package com.efunbox.pay.wxapi;
+package com.edufound.pay.wxapi;
 
 import android.app.Activity;
 import android.content.Intent;
 import android.os.Bundle;
 
-import com.efunbox.base.util.BaseConsts;
-import com.efunbox.pay.R;
+import com.edufound.base.util.BaseConsts;
+import com.edufound.pay.R;
 import com.tencent.mm.opensdk.constants.ConstantsAPI;
 import com.tencent.mm.opensdk.modelbase.BaseReq;
 import com.tencent.mm.opensdk.modelbase.BaseResp;

+ 0 - 6
app-pay/src/main/java/com/efunbox/pay/model/PayModel.java

@@ -1,6 +0,0 @@
-package com.efunbox.pay.model;
-
-import com.efunbox.base.Model;
-
-public interface PayModel extends Model {
-}

+ 0 - 0
app-pay/src/main/java/com/efunbox/pay/model/WXEntryModel.java


この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません