From 2eec3de87b6b616a69a46c1f97c2397159031d2f Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期二, 21 十一月 2023 18:01:43 +0800 Subject: [PATCH] 广告升级/bug修复 --- BuWanVideo/src/com/weikou/beibeivideo/ui/SplashActivity.java | 94 ++++++++++++++++++++++++++++++++--------------- 1 files changed, 64 insertions(+), 30 deletions(-) diff --git a/BuWanVideo/src/com/weikou/beibeivideo/ui/SplashActivity.java b/BuWanVideo/src/com/weikou/beibeivideo/ui/SplashActivity.java index c535066..292a9fa 100644 --- a/BuWanVideo/src/com/weikou/beibeivideo/ui/SplashActivity.java +++ b/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; @@ -76,6 +77,7 @@ private ImageView iv_bg; private TextView ad_close_time; + private Dialog pdialog; private static String TAG = "SplashActivity"; @@ -99,7 +101,7 @@ setContentView(R.layout.activity_splash); TopStatusSettings.setStatusViewAndDeepColor(this); - if(ConfigUtil.isAiDaoMode(this)){ + if (ConfigUtil.isAiDaoMode(this)) { AiDaoUtil.setAiDaoMode(this); } @@ -118,7 +120,7 @@ iv_bg.setImageBitmap(bitmap1); } - private void init(){ + private void init() { SharedPreferences preferences = getSharedPreferences("link_page", Context.MODE_PRIVATE); isInput = preferences.getBoolean("isInput", false); @@ -135,16 +137,30 @@ 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鍦板潃銆丏EVICEID/IMEI/AndroidID/OAID/IMSI/ICCID/GAID/MEID</font>绛変俊鎭級鐨勬敹闆�/淇濆瓨/浣跨敤/瀵瑰鎻愪緵/淇濇姢绛夎鍒欐潯娆�,浠ュ強鎮ㄧ殑鐢ㄦ埛鏉冨埄绛夋潯娆撅紱<br>" + + "1銆�)涓鸿瘑鍒偍鐨勮澶�,骞堕闃叉伓鎰忕▼搴忓強鍙嶄綔寮娿�佹彁楂樻湇鍔″畨鍏ㄦ�с�佷繚闅滆繍钀ヨ川閲忓強鏁堢巼锛屾垜浠細鏀堕泦鎮�" + + "鐨勮澶囦俊鎭紙鍖呮嫭<font color='#FF0000'>IMEI銆佽澶囧簭鍒楀彿銆丱AID銆丮EID銆丄ndroid ID銆両MSI銆丟UID銆丮AC鍦板潃銆丼IM鍗″簭鍒楀彿</font> 锛夈��<font color='#FF0000'>宸插畨瑁匒PP淇℃伅</font>鎴栬繍琛屼腑鐨勮繘绋嬩俊鎭�<br>" + "2銆佺害瀹氭垜浠殑闄愬埗璐d换銆佸厤璐f潯娆撅紱<br>" + "3銆佸叾浠栦互鍔犵矖鎴栨枩浣撳瓧杩涜鏍囪瘑鐨勯噸瑕佹潯娆俱��</b><br>" + "濡傛偍瀵瑰崗璁湁浠讳綍鐤戣檻锛屽彲閫氳繃鐢靛瓙閭锛� yesbd@qq.com 鍚戞垜浠闂紝鎴戜滑灏嗕负鎮ㄧ璇氳В绛斻�傛偍鐐瑰嚮鈥滃悓鎰忓苟缁х画鈥濈殑琛屼负浠h〃鎮ㄥ凡闃呰瀹屾瘯骞舵帴鍙椾互涓婂崗璁叏閮ㄦ潯娆俱�傚鎮ㄥ悓鎰忎互涓婂崗璁唴瀹癸紝璇锋偍鐐瑰嚮鈥滃悓鎰忓苟缁х画鈥濓紝寮�濮嬩娇鐢ㄦ偍鐨勪骇鍝併��"; 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 @@ -156,22 +172,21 @@ @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 { @@ -179,7 +194,7 @@ vg_ad.post(new Runnable() { @Override public void run() { - init(); + init(); } }); } @@ -415,7 +430,7 @@ protected void onDestroy() { super.onDestroy(); if (mGMAdSplashManager != null) { - // mGMAdSplashManager.destroy(); + // mGMAdSplashManager.destroy(); } } @@ -460,22 +475,42 @@ } 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 @@ -529,8 +564,6 @@ // 璁剧疆鍝�鎮兼ā寮� ConfigUtil.saveAiDaoMode(getApplicationContext(), data.optBoolean("aiDaoMode")); - - //淇濆瓨鍏嶅箍鍛婃潈鐩婃寔缁椂闂� @@ -593,6 +626,7 @@ if (requestCode == REQUEST_CODE) { for (int i = 0; i < permissions.length; i++) { if (grantResults[i] == PERMISSION_GRANTED) {//閫夋嫨浜嗏�滃缁堝厑璁糕�� + init(); } else { //鎷掔粷浜嗘巿鏉� -- Gitblit v1.8.0