|
@@ -24,18 +24,13 @@ import com.baidu.location.LocationClient;
|
|
|
import com.baidu.location.LocationClientOption;
|
|
import com.baidu.location.LocationClientOption;
|
|
|
import com.bumptech.glide.Glide;
|
|
import com.bumptech.glide.Glide;
|
|
|
import com.danikula.videocache.HttpProxyCacheServer;
|
|
import com.danikula.videocache.HttpProxyCacheServer;
|
|
|
-import com.jasmine.cantaloupe.engine.JasmineEngine;
|
|
|
|
|
-import com.jasmine.cantaloupe.utils.LogUtils2;
|
|
|
|
|
import com.kfzs.cfyl.share_library.util.ContextHolder;
|
|
import com.kfzs.cfyl.share_library.util.ContextHolder;
|
|
|
import com.liulishuo.okdownload.OkDownload;
|
|
import com.liulishuo.okdownload.OkDownload;
|
|
|
import com.liulishuo.okdownload.core.dispatcher.DownloadDispatcher;
|
|
import com.liulishuo.okdownload.core.dispatcher.DownloadDispatcher;
|
|
|
-import com.lygame.wrapper.sdk.LySdk;
|
|
|
|
|
-import com.lygame.wrapper.strategy.DefaultStrategy;
|
|
|
|
|
import com.sheep.gamegroup.di.components.DaggerNetComponent;
|
|
import com.sheep.gamegroup.di.components.DaggerNetComponent;
|
|
|
import com.sheep.gamegroup.di.components.NetComponent;
|
|
import com.sheep.gamegroup.di.components.NetComponent;
|
|
|
import com.sheep.gamegroup.di.modules.NetModule;
|
|
import com.sheep.gamegroup.di.modules.NetModule;
|
|
|
import com.sheep.gamegroup.model.entity.BaseMessage;
|
|
import com.sheep.gamegroup.model.entity.BaseMessage;
|
|
|
-import com.sheep.gamegroup.model.entity.ThirdAdsConfigEntity;
|
|
|
|
|
import com.sheep.gamegroup.model.entity.WebProcessConfigEntity;
|
|
import com.sheep.gamegroup.model.entity.WebProcessConfigEntity;
|
|
|
import com.sheep.gamegroup.model.util.SheepSubscriber;
|
|
import com.sheep.gamegroup.model.util.SheepSubscriber;
|
|
|
import com.sheep.gamegroup.module.login.AccountConsistenceAct;
|
|
import com.sheep.gamegroup.module.login.AccountConsistenceAct;
|
|
@@ -81,9 +76,6 @@ import com.stmsdk.AbsTMSConfig;
|
|
|
import com.stmsdk.TMSDKContext;
|
|
import com.stmsdk.TMSDKContext;
|
|
|
import com.tencent.bugly.Bugly;
|
|
import com.tencent.bugly.Bugly;
|
|
|
import com.tencent.bugly.beta.Beta;
|
|
import com.tencent.bugly.beta.Beta;
|
|
|
-import com.tencent.klevin.KlevinConfig;
|
|
|
|
|
-import com.tencent.klevin.KlevinManager;
|
|
|
|
|
-import com.tencent.klevin.listener.InitializationListener;
|
|
|
|
|
import com.tencent.mm.opensdk.openapi.IWXAPI;
|
|
import com.tencent.mm.opensdk.openapi.IWXAPI;
|
|
|
import com.tencent.mm.opensdk.openapi.WXAPIFactory;
|
|
import com.tencent.mm.opensdk.openapi.WXAPIFactory;
|
|
|
import com.tencent.qqmini.minigame.opensdk.OpenSdkLoginManager;
|
|
import com.tencent.qqmini.minigame.opensdk.OpenSdkLoginManager;
|
|
@@ -222,27 +214,6 @@ public class SheepApp extends MultiDexApplication {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- SheepApp.getInstance().getNetComponent()
|
|
|
|
|
- .getApiService()
|
|
|
|
|
- .commonConfig("third_ad")
|
|
|
|
|
- .subscribeOn(Schedulers.io())
|
|
|
|
|
- .observeOn(AndroidSchedulers.mainThread())
|
|
|
|
|
- .subscribe(new SheepSubscriber<BaseMessage>(this) {
|
|
|
|
|
- @Override
|
|
|
|
|
- public void onError(BaseMessage baseMessage) {
|
|
|
|
|
- if (BuildConfig.DEBUG)
|
|
|
|
|
- G.showToast("获取三方广告配置失败" + baseMessage.getMsg());
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public void onNext(BaseMessage baseMessage) {
|
|
|
|
|
- ThirdAdsConfigEntity thirdAdsConfigEntity = baseMessage.getData(ThirdAdsConfigEntity.class);
|
|
|
|
|
- initYKYAd(thirdAdsConfigEntity.getYkyConfig().getAppid());
|
|
|
|
|
- initYTAd(thirdAdsConfigEntity.getYtConfig().getAppid(), thirdAdsConfigEntity.getYtConfig().getAd_id());
|
|
|
|
|
- initZKAd();
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
SheepApp.getInstance().getNetComponent().getApiService().commonConfig("should_open_in_new_process")
|
|
SheepApp.getInstance().getNetComponent().getApiService().commonConfig("should_open_in_new_process")
|
|
|
.subscribeOn(Schedulers.io())
|
|
.subscribeOn(Schedulers.io())
|
|
|
.observeOn(AndroidSchedulers.mainThread())
|
|
.observeOn(AndroidSchedulers.mainThread())
|
|
@@ -261,64 +232,6 @@ public class SheepApp extends MultiDexApplication {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- //初始化游可盈广告
|
|
|
|
|
- private void initYKYAd(String appId) {
|
|
|
|
|
- KlevinConfig.Builder builder = new KlevinConfig.Builder()
|
|
|
|
|
- .appId(appId) //【必须】AppId,AndroidManifest.xml 中配置后可不调用
|
|
|
|
|
- .debugMode(true) //打开调试日志,上线前关闭,【可选】
|
|
|
|
|
- .networkType(KlevinConfig.NETWORK_NOTLIMIT);//可下载的网络,【可选】
|
|
|
|
|
-
|
|
|
|
|
- KlevinManager.init(this, builder.build(), new InitializationListener() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public void onSuccess() {
|
|
|
|
|
- if (BuildConfig.DEBUG)
|
|
|
|
|
- G.showToast("游可赢广告初始化:init onSuccess ");
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public void onError(int i, String s) {
|
|
|
|
|
- if (BuildConfig.DEBUG)
|
|
|
|
|
- G.showToast("游可赢广告初始化:init onFail : " + i + ": " + s);
|
|
|
|
|
- //code:KLAdEvent_InitError = 801; // 宿主初始化错误
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public void onIdentifier(boolean support, String oaid) {
|
|
|
|
|
-
|
|
|
|
|
- // support 为 true 时,oaid 返回设备的 oaid。false 时返回为空或错误码
|
|
|
|
|
- /*if (support) {
|
|
|
|
|
- Log.i(TAG, "oaid=" + oaid);
|
|
|
|
|
- } else {
|
|
|
|
|
- Log.e(TAG, "not support oaid");
|
|
|
|
|
- }*/
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- //初始化优投广告
|
|
|
|
|
- private void initYTAd(String appId, String adId) {
|
|
|
|
|
- JasmineEngine.getInstance(this).init(
|
|
|
|
|
- appId,
|
|
|
|
|
- Integer.parseInt(adId),
|
|
|
|
|
- new JasmineEngine.InitCallBack() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public void initSuccess() {
|
|
|
|
|
- LogUtils2.info("initSuccess");
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public void initFailed(String err) {
|
|
|
|
|
- LogUtils2.info("initFailed:" + err);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- //初始化掌酷广告
|
|
|
|
|
- private void initZKAd() {
|
|
|
|
|
- //sdk策略配置
|
|
|
|
|
- DefaultStrategy defaultStrategy = new DefaultStrategy(this);
|
|
|
|
|
- LySdk.setSdkStrategy(defaultStrategy);
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* https://bugly.qq.com/v2/crash-reporting/crashes/0dd998212c/21541?pid=1
|
|
* https://bugly.qq.com/v2/crash-reporting/crashes/0dd998212c/21541?pid=1
|