|
|
@@ -3,11 +3,11 @@ package com.datarecovery.master;
|
|
|
import android.content.Context;
|
|
|
|
|
|
import com.atmob.app.lib.base.BaseApplication;
|
|
|
-import com.atmob.channelreader.ChannelReader;
|
|
|
-import com.atmob.common.runtime.ProcessUtil;
|
|
|
+import com.atmob.central.AtmobCentralConfig;
|
|
|
+import com.atmob.common.thread.ThreadPoolUtil;
|
|
|
+import com.atmob.compliance.AtmobCompliance;
|
|
|
import com.atmob.sdk.appconvert.AppConvert;
|
|
|
import com.atmob.sdk.gravity_engine.GravityEngine;
|
|
|
-import com.atmob.user.AtmobUser;
|
|
|
import com.datarecovery.master.data.consts.Constants;
|
|
|
import com.datarecovery.master.sdk.bugly.BuglyHelper;
|
|
|
import com.datarecovery.master.sdk.central.AtmobCentralHelper;
|
|
|
@@ -25,15 +25,12 @@ import dagger.hilt.android.HiltAndroidApp;
|
|
|
@HiltAndroidApp
|
|
|
public class App extends BaseApplication {
|
|
|
|
|
|
-
|
|
|
private static App INSTANCE;
|
|
|
|
|
|
-
|
|
|
public static App getInstance() {
|
|
|
return INSTANCE;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
@Override
|
|
|
protected void attachBaseContext(Context base) {
|
|
|
super.attachBaseContext(base);
|
|
|
@@ -86,8 +83,17 @@ public class App extends BaseApplication {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- protected int complianceStrategy() {
|
|
|
- return AtmobUser.CHINA;
|
|
|
+ protected AtmobCentralConfig atmobCentralConfig(String channel, int appId, int tgPlatformId) {
|
|
|
+ return new AtmobCentralConfig.Builder()
|
|
|
+ .appKey(BuildConfig.ATMOB_CENTRAL_KEY)
|
|
|
+ .debug(BuildConfig.DEBUG)
|
|
|
+ .centralServer(Constants.Atmob_Server_Base_URL)
|
|
|
+ .channel(channel)
|
|
|
+ .appId(appId)
|
|
|
+ .tgPlatform(tgPlatformId)
|
|
|
+ .complianceStrategy(AtmobCompliance.Strategy.CHINA)
|
|
|
+ .executorService(ThreadPoolUtil.getInstance())
|
|
|
+ .build();
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -95,7 +101,6 @@ public class App extends BaseApplication {
|
|
|
if (isMainProcess) {
|
|
|
initBugly();
|
|
|
initUmeng();
|
|
|
- initCentral();
|
|
|
initAppConvert();
|
|
|
initGravityEngine();
|
|
|
}
|
|
|
@@ -104,23 +109,13 @@ public class App extends BaseApplication {
|
|
|
@Override
|
|
|
public void initAfterGrant(boolean isMainProcess) {
|
|
|
if (isMainProcess) {
|
|
|
+ UmengHelper.initAfterGrantedAgreement(getApplicationContext());
|
|
|
+ BuglyHelper.initAfterGrantedAgreement();
|
|
|
QiYuHelper.init(this);
|
|
|
QuickLoginHelper.init(this);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void initCentral() {
|
|
|
- ChannelReader.default4Test(
|
|
|
- Constants.App_DefaultChannel,
|
|
|
- Constants.App_DefaultAppId,
|
|
|
- Constants.App_DefaultTgPlatformId
|
|
|
- );
|
|
|
- String channel = ChannelReader.getChannel(this);
|
|
|
- int appId = ChannelReader.getAppId(this);
|
|
|
- int tgPlatformId = ChannelReader.getTgPlatformId(this);
|
|
|
- AtmobCentralHelper.init(this, channel, appId, tgPlatformId);
|
|
|
- }
|
|
|
-
|
|
|
private void initUmeng() {
|
|
|
UmengHelper.init(this);
|
|
|
}
|
|
|
@@ -138,11 +133,7 @@ public class App extends BaseApplication {
|
|
|
}
|
|
|
|
|
|
public void firstPrivacyRelated() {
|
|
|
- AtmobUser.recordPolicyGrant(true);
|
|
|
AtmobCentralHelper.onPolicyGranted(true);
|
|
|
- UmengHelper.initAfterGrantedAgreement(getApplicationContext());
|
|
|
UmengHelper.submitPolicyGrantResult(getApplicationContext(), true);
|
|
|
- BuglyHelper.initAfterGrantedAgreement();
|
|
|
- initAfterGrant(ProcessUtil.isMainProcess(this));
|
|
|
}
|
|
|
}
|