| | |
| | | import com.alibaba.sdk.android.push.noonesdk.PushInitConfig; |
| | | import com.alibaba.sdk.android.push.noonesdk.PushServiceFactory; |
| | | import com.alibaba.sdk.android.push.register.MiPushRegister; |
| | | import com.alibaba.sdk.android.push.register.OppoRegister; |
| | | import com.google.android.gms.common.ConnectionResult; |
| | | import com.google.android.gms.common.GoogleApiAvailability; |
| | | import com.google.firebase.messaging.FirebaseMessaging; |
| | |
| | | |
| | | public class HDLApp extends Application { |
| | | |
| | | /** |
| | | * 添加标志位控制首次加载逻辑 |
| | | */ |
| | | public boolean isFirstLoad = true; |
| | | final String TAG = HDLApp.class.getName(); |
| | | //控制打印 Debug模式打印 |
| | | private Boolean isLogEnabled = true; |
| | |
| | | @Override |
| | | public void onCreate() { |
| | | super.onCreate(); |
| | | |
| | | // Log.d("Application==onCreate", "onCreate"); |
| | | // // 获取当前进程的PID |
| | | // String processMessage = "进程Uid:" + Process.myUid() + "进程ID:" + Process.myPid() + " 进程名:" + RuningAcitvityUtil.getAppName(getBaseContext()); |
| | | Log.d("Application==onCreate", "onCreate"); |
| | | // Log.d(TAG, processMessage); |
| | | // Log.d("Application==onCreate", processMessage); |
| | | // if (RuningAcitvityUtil.getAppName(getBaseContext()).contains(":")) { |
| | | // //非原生进程,用初始化后面的 |
| | | // return; |
| | | // } |
| | | mHDLApp = this; |
| | | SharedPreUtils.init(this); |
| | | getAppLanguage(); |
| | | //预创建脚本json文件夹 |
| | | HdlFileLogic.getInstance().createHdlDeviceModelLocalJsonDirectory(); |
| | | init(); |
| | | |
| | | |
| | |
| | | return; |
| | | } |
| | | isInitThirdSDK = true; |
| | | SharedPreUtils.init(this); |
| | | getAppLanguage(); |
| | | //预创建脚本json文件夹 |
| | | HdlFileLogic.getInstance().createHdlDeviceModelLocalJsonDirectory(); |
| | | UserConfigManage.getInstance().setTouristModeJumpLogic(UserConfigManage.getInstance().isTourist_mode()); |
| | | // //5.初始化Bugly |
| | | // CrashReport.initCrashReport(this, Constant.BUGLY_APP_ID, true); |
| | | //6.初始化DCUniMPSDK |
| | |
| | | pushService.setLogLevel(CloudPushService.LOG_DEBUG); |
| | | } |
| | | //小米 |
| | | //appKey/appSecret在小米开发者平台获取 |
| | | MiPushRegister.register(this, "2882303761520382032", "5612038223032"); |
| | | // OPPO通道注册 |
| | | //appKey/appSecret在OPPO开发者平台获取 |
| | | OppoRegister.register(this, "d80747c83e38442aaa2e5183c310bae0", "86afce21417b49a4984816024b15d4b9"); |
| | | |
| | | } |
| | | |
| | |
| | | HDLLinkPMUser.getInstance().setOnReloginListener(new IOnReloginListener() { |
| | | @Override |
| | | public void onReLogin(int type) { |
| | | // UserConfigManage.getInstance().setTourist_mode(false); |
| | | // UserConfigManage.getInstance().Save(); |
| | | if (type == LogoutType.ServerSwitchingLogout.getValue()) { |
| | | new Handler().postDelayed(new Runnable() { |
| | | @Override |