feat: 广告位前置工作(接入新版 OAID SDK) https://jira.shanqu.cc/browse/GHZS-2389

This commit is contained in:
chenjuntao
2023-05-29 16:49:25 +08:00
parent aa069b7a21
commit 68a3eadfeb
25 changed files with 331 additions and 42 deletions

View File

@ -43,6 +43,7 @@ import com.gh.gamecenter.BuildConfig;
import com.gh.gamecenter.Injection;
import com.gh.gamecenter.common.constant.Config;
import com.gh.gamecenter.common.constant.Constants;
import com.gh.gamecenter.common.exposure.meta.MetaUtil;
import com.gh.gamecenter.common.image.EmptyDecoder;
import com.gh.gamecenter.common.tracker.Tracker;
import com.gh.gamecenter.common.utils.DarkModeUtils;
@ -58,6 +59,7 @@ import com.gh.gamecenter.core.utils.SPUtils;
import com.gh.gamecenter.entity.SubjectRecommendEntity;
import com.gh.gamecenter.fragment.MainWrapperRepository;
import com.gh.gamecenter.login.user.UserRepository;
import com.gh.gamecenter.oaid.OAIDHelper;
import com.gh.gamecenter.packagehelper.PackageRepository;
import com.gh.gamecenter.core.provider.IFlavorProvider;
import com.gh.gamecenter.provider.FlavorProviderImp;
@ -204,6 +206,9 @@ public class HaloApp extends MultiDexApplication {
application.onCreate(mInstance);
}
// 似乎只是 load SO 不涉及方法调用,所以可以在隐私政策前调用吧?
OAIDHelper.INSTANCE.doSystemLoad();
// 70ms
PlayerFactory.setPlayManager(Exo2PlayerManager.class);
CacheFactory.setCacheManager(ExoPlayerCacheManager.class);
@ -273,6 +278,12 @@ public class HaloApp extends MultiDexApplication {
// 获取/更新 GID 和 读 SP 的操作不需要 delay
DataUtils.getGid();
OAIDHelper.INSTANCE.getOAID(this, s -> {
setOAID(s);
MetaUtil.INSTANCE.refreshMeta();
return null;
});
// 获取 settings 配置
ExtensionsKt.doOnMainProcessOnly(this, com.gh.common.constant.Config::getGhzsSettings);