version:1.6.1

fix:休息日管控完善
add:
This commit is contained in:
2021-09-02 18:29:04 +08:00
parent 93b0e35af7
commit 0fa06f8f2a
135 changed files with 10134 additions and 4595 deletions

View File

@@ -0,0 +1,68 @@
package com.info.sn.base;
import android.app.Application;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import com.arialyy.aria.core.Aria;
import com.blankj.utilcode.util.ProcessUtils;
import com.info.sn.BuildConfig;
import com.info.sn.manager.AmapManager;
import com.info.sn.manager.NetInterfaceManager;
import com.info.sn.manager.ControlManager;
import com.info.sn.manager.DeviceManager;
import com.info.sn.utils.JGYUtils;
public class BaseApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
if (!getPackageName().equals(ProcessUtils.getCurrentProcessName())) {
return;
}
utilsInint();
}
private void utilsInint() {
if (!BuildConfig.DEBUG) {
catchException();
}
Aria.init(this);
Aria.download(this).resumeAllTask();
JGYUtils.init(this);
ControlManager.init(this);
DeviceManager.init(this);
AmapManager.init(this);
AmapManager.getInstance().initAmap();
NetInterfaceManager.init(this);
JGYUtils.hookWebView();
}
private void catchException() {
Thread.setDefaultUncaughtExceptionHandler(
new Thread.UncaughtExceptionHandler() {
@Override
public void uncaughtException(Thread t, Throwable e) {
Log.e("捕获异常子线程:", Thread.currentThread().getName() +
"在:" + e.getStackTrace()[0].getClassName());
}
}
);
//下面是新增方法!
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public void run() {
while (true) {
try {
Looper.loop(); //会先执行这个方法,然后在执行下面的异常捕获方法!
} catch (Exception e) {
Log.e("捕获异常主线程:", Thread.currentThread().getName() + "在:" + e.getStackTrace()[0].getClassName());
e.printStackTrace();
}
}
}
});
}
}