admin
2023-10-08 2c5b6e472c368e80d85b8ea2b461c9ea62981d9b
BuWanVideo/src/com/weikou/beibeivideo/ui/SplashActivity.java
@@ -30,6 +30,7 @@
import com.google.gson.Gson;
import com.lcjian.library.dialog.DialogUtil;
import com.lcjian.library.util.ManifestDataUtil;
import com.lcjian.library.util.ScreenUtils;
import com.lcjian.library.util.common.BitmapUtils;
import com.lcjian.library.util.common.DrawableUtils;
@@ -99,7 +100,7 @@
        setContentView(R.layout.activity_splash);
        TopStatusSettings.setStatusViewAndDeepColor(this);
        if(ConfigUtil.isAiDaoMode(this)){
        if (ConfigUtil.isAiDaoMode(this)) {
            AiDaoUtil.setAiDaoMode(this);
        }
@@ -118,7 +119,7 @@
        iv_bg.setImageBitmap(bitmap1);
    }
    private void init(){
    private void init() {
        SharedPreferences preferences = getSharedPreferences("link_page",
                Context.MODE_PRIVATE);
        isInput = preferences.getBoolean("isInput", false);
@@ -179,7 +180,7 @@
            vg_ad.post(new Runnable() {
                @Override
                public void run() {
                   init();
                    init();
                }
            });
        }
@@ -415,7 +416,7 @@
    protected void onDestroy() {
        super.onDestroy();
        if (mGMAdSplashManager != null) {
           // mGMAdSplashManager.destroy();
            // mGMAdSplashManager.destroy();
        }
    }
@@ -463,9 +464,20 @@
        if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_STATE) != PERMISSION_GRANTED) {
            SharedPreferences sharedPreferences = getSharedPreferences("permission", Context.MODE_PRIVATE);
            //是否需要再次请求权限
            if (sharedPreferences.getBoolean("show", true))
                ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_PHONE_STATE}, REQUEST_CODE);
            else {
            if (sharedPreferences.getBoolean("show", true)) {
                String channel = ManifestDataUtil.getAppMetaData(getApplicationContext(), "UMENG_CHANNEL");
                if ("huawei".equalsIgnoreCase(channel)) {
                    next();
                } else {
                    ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_PHONE_STATE}, REQUEST_CODE);
                    iv_bg.post(new Runnable() {
                        @Override
                        public void run() {
                            findViewById(R.id.ll_authority_notify).setVisibility(View.VISIBLE);
                        }
                    });
                }
            } else {
                next();
            }
        } else {
@@ -476,6 +488,13 @@
    private void next() {
        //百度内容联盟
//            MobadsPermissionSettings.setPermissionReadDeviceID(true);
        iv_bg.post(new Runnable() {
            @Override
            public void run() {
                findViewById(R.id.ll_authority_notify).setVisibility(View.GONE);
            }
        });
        if (!BeibeiVideoApplication.IsInited()) {
            BeibeiVideoApplication.init(BeibeiVideoApplication.application, new BeibeiVideoApplication.InitListener() {
                @Override
@@ -529,8 +548,6 @@
                                // 设置哀悼模式
                                ConfigUtil.saveAiDaoMode(getApplicationContext(), data.optBoolean("aiDaoMode"));
                                //保存免广告权益持续时间
@@ -593,6 +610,7 @@
        if (requestCode == REQUEST_CODE) {
            for (int i = 0; i < permissions.length; i++) {
                if (grantResults[i] == PERMISSION_GRANTED) {//选择了“始终允许”
                    init();
                } else {
                    //拒绝了授权