| | |
| | | |
| | | 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; |
| | |
| | | private ImageView iv_bg; |
| | | |
| | | private TextView ad_close_time; |
| | | private Dialog pdialog; |
| | | |
| | | private static String TAG = "SplashActivity"; |
| | | |
| | |
| | | setContentView(R.layout.activity_splash); |
| | | TopStatusSettings.setStatusViewAndDeepColor(this); |
| | | |
| | | if(ConfigUtil.isAiDaoMode(this)){ |
| | | if (ConfigUtil.isAiDaoMode(this)) { |
| | | AiDaoUtil.setAiDaoMode(this); |
| | | } |
| | | |
| | |
| | | iv_bg.setImageBitmap(bitmap1); |
| | | } |
| | | |
| | | private void init(){ |
| | | private void init() { |
| | | SharedPreferences preferences = getSharedPreferences("link_page", |
| | | Context.MODE_PRIVATE); |
| | | isInput = preferences.getBoolean("isInput", false); |
| | |
| | | data += String.format("<a href='%s'>《隐私政策》</a>和", BeibeiConstant.PRIVACY_POLICY); |
| | | data += String.format("<a href='%s'>《用户协议》</a>", BeibeiConstant.USER_AGREEMENT); |
| | | data += "内的所有条款,<b>尤其是:<br>" + |
| | | "1、我们对您的个人信息(包括但不限于<font color='#FF0000'>设备MAC地址、DEVICEID/IMEI/AndroidID/OAID/IMSI/ICCID/GAID/MEID</font>等信息)的收集/保存/使用/对外提供/保护等规则条款,以及您的用户权利等条款;<br>" + |
| | | "1、)为识别您的设备,并预防恶意程序及反作弊、提高服务安全性、保障运营质量及效率,我们会收集您" + |
| | | "的设备信息(包括<font color='#FF0000'>IMEI、设备序列号、OAID、MEID、Android ID、IMSI、GUID、MAC地址、SIM卡序列号</font> )、<font color='#FF0000'>已安装APP信息</font>或运行中的进程信息<br>" + |
| | | "2、约定我们的限制责任、免责条款;<br>" + |
| | | "3、其他以加粗或斜体字进行标识的重要条款。</b><br>" + |
| | | "如您对协议有任何疑虑,可通过电子邮箱: yesbd@qq.com 向我们询问,我们将为您竭诚解答。您点击“同意并继续”的行为代表您已阅读完毕并接受以上协议全部条款。如您同意以上协议内容,请您点击“同意并继续”,开始使用您的产品。"; |
| | | |
| | | if (!UserUtil.isAgreeUserProtocol(BeibeiVideoApplication.application) && !BeibeiConstant.IS_TEST) { |
| | | Dialog dialog = new UserProtocolDialog.Builder(this).setNegativeButton("不同意", new DialogInterface.OnClickListener() { |
| | | pdialog = new UserProtocolDialog.Builder(this).setNegativeButton("不同意", new DialogInterface.OnClickListener() { |
| | | @Override |
| | | public void onClick(DialogInterface dialog, int which) { |
| | | SplashActivity.this.finish(); |
| | | DialogUtil.dismiss(pdialog); |
| | | AlertDialog alertDialog = new AlertDialog.Builder(SplashActivity.this).setTitle("温馨提示").setMessage("我们非常重视对您个人信息的保护,承诺严格按照"+ getResources().getString(R.string.app_name) +"隐私权政策保护及处理您的信息,如不同意该政策,很遗憾我们将无法提供服务").setNegativeButton("退出应用", new DialogInterface.OnClickListener() { |
| | | @Override |
| | | public void onClick(DialogInterface dialog, int which) { |
| | | SplashActivity.this.finish(); |
| | | } |
| | | }).setPositiveButton("再次查看", new DialogInterface.OnClickListener() { |
| | | @Override |
| | | public void onClick(DialogInterface dialog_, int which) { |
| | | DialogUtil.show(pdialog); |
| | | } |
| | | }).create(); |
| | | alertDialog.setCanceledOnTouchOutside(false); |
| | | alertDialog.show(); |
| | | } |
| | | }).setPositiveButton("同意并继续", new DialogInterface.OnClickListener() { |
| | | @Override |
| | |
| | | @Override |
| | | public void run() { |
| | | |
| | | new PermissionAuthNotifyDialog.Builder(SplashActivity.this).setPositiveButton(null, new DialogInterface.OnClickListener() { |
| | | @Override |
| | | public void onClick(DialogInterface dialogInterface, int i) { |
| | | dialogInterface.dismiss(); |
| | | init(); |
| | | } |
| | | }).create().show(); |
| | | |
| | | |
| | | // new PermissionAuthNotifyDialog.Builder(SplashActivity.this).setPositiveButton(null, new DialogInterface.OnClickListener() { |
| | | // @Override |
| | | // public void onClick(DialogInterface dialogInterface, int i) { |
| | | // dialogInterface.dismiss(); |
| | | // init(); |
| | | // } |
| | | // }).create().show(); |
| | | init(); |
| | | } |
| | | }); |
| | | } |
| | | }).setData(data).create(); |
| | | |
| | | if (!isFinishing()) { |
| | | DialogUtil.show(dialog); |
| | | DialogUtil.show(pdialog); |
| | | } |
| | | |
| | | } else { |
| | |
| | | vg_ad.post(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | init(); |
| | | init(); |
| | | } |
| | | }); |
| | | } |
| | |
| | | protected void onDestroy() { |
| | | super.onDestroy(); |
| | | if (mGMAdSplashManager != null) { |
| | | // mGMAdSplashManager.destroy(); |
| | | // mGMAdSplashManager.destroy(); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | private void myRequetPermission() { |
| | | 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 { |
| | | next(); |
| | | } |
| | | } else { |
| | | next(); |
| | | } |
| | | // final String channel = ManifestDataUtil.getAppMetaData(getApplicationContext(), "UMENG_CHANNEL"); |
| | | // // 小米不弹出权限申请框 |
| | | // if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_STATE) != PERMISSION_GRANTED && !"xiaomi".equalsIgnoreCase(channel)) { |
| | | // SharedPreferences sharedPreferences = getSharedPreferences("permission", Context.MODE_PRIVATE); |
| | | // //是否需要再次请求权限 |
| | | // if (sharedPreferences.getBoolean("show", true)) { |
| | | // 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 { |
| | | // next(); |
| | | // } |
| | | next(); |
| | | } |
| | | |
| | | 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 |
| | |
| | | |
| | | // 设置哀悼模式 |
| | | ConfigUtil.saveAiDaoMode(getApplicationContext(), data.optBoolean("aiDaoMode")); |
| | | |
| | | |
| | | |
| | | |
| | | //保存免广告权益持续时间 |
| | |
| | | if (requestCode == REQUEST_CODE) { |
| | | for (int i = 0; i < permissions.length; i++) { |
| | | if (grantResults[i] == PERMISSION_GRANTED) {//选择了“始终允许” |
| | | |
| | | init(); |
| | | } else { |
| | | //拒绝了授权 |