From 837b74aa9d63a50f1ace61d744c9f6e0384bc8f6 Mon Sep 17 00:00:00 2001 From: hch <305670599@qq.com> Date: 星期三, 04 一月 2023 16:27:54 +0800 Subject: [PATCH] 0312 强制需要权限的包 --- SdkProject/plugins/quick/java/com/secondworld/sdk/QuickSdkMgr.java | 60 +++++++++++++++++++++++++++++------------------------------- 1 files changed, 29 insertions(+), 31 deletions(-) diff --git a/SdkProject/plugins/quick/java/com/secondworld/sdk/QuickSdkMgr.java b/SdkProject/plugins/quick/java/com/secondworld/sdk/QuickSdkMgr.java index 3920dc4..95c127b 100644 --- a/SdkProject/plugins/quick/java/com/secondworld/sdk/QuickSdkMgr.java +++ b/SdkProject/plugins/quick/java/com/secondworld/sdk/QuickSdkMgr.java @@ -80,6 +80,7 @@ ActivityCompat.requestPermissions(activity, new String[]{ Manifest.permission.WRITE_EXTERNAL_STORAGE}, RequestCode.QUICK); } + //QuickSdkMgr.I.register(PlatformDiff.I.platformProductCode(), PlatformDiff.I.platformProductKey()); //QuickSdkMgr.I.init(activity); } @@ -90,39 +91,36 @@ public void onRequestPermissionsResult(Activity activity, int requestCode, int[] grantResults) { if (requestCode != RequestCode.QUICK) return; - if (hasPermissions(activity)) - { + + //1768娓犻亾涓�瀹氶渶瑕佹潈闄� + if (hasPermissions(activity)) { LogUtil.i("SdkManager", "onRequestPermissionsResult 鐢宠鎴愬姛"); + //鐢宠鎴愬姛 + QuickSdkMgr.I.register(PlatformDiff.I.platformProductCode(), PlatformDiff.I.platformProductKey()); + QuickSdkMgr.I.init(activity); + return; } - QuickSdkMgr.I.register(PlatformDiff.I.platformProductCode(), PlatformDiff.I.platformProductKey()); - QuickSdkMgr.I.init(activity); -// if (hasPermissions(activity)) { -// //鐢宠鎴愬姛 -// QuickSdkMgr.I.register(PlatformDiff.I.platformProductCode(), PlatformDiff.I.platformProductKey()); -// QuickSdkMgr.I.init(activity); -// return; -// } -// final AlertDialog.Builder normalDialog = new AlertDialog.Builder(activity); -// normalDialog.setTitle("鏉冮檺璁剧疆"); -// normalDialog.setMessage("娓告垙闇�瑕侀儴鍒嗘潈闄愭墠鑳芥甯歌繍琛岋紝璇峰墠寰�璁剧疆涓墦寮�鐢佃瘽鏉冮檺涓庡瓨鍌ㄦ潈闄�"); -// normalDialog.setPositiveButton("鍓嶅線璁剧疆", new DialogInterface.OnClickListener() { -// @Override -// public void onClick(DialogInterface dialog, int which) { -// Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS); -// Uri uri = Uri.fromParts("package", activity.getPackageName(), null); -// intent.setData(uri); -// activity.startActivityForResult(intent, REQUEST_RECORD_PERMISSION_SETTING); -// dialog.dismiss(); -// } -// }); -// normalDialog.setNegativeButton("閫�鍑�", new DialogInterface.OnClickListener() { -// @Override -// public void onClick(DialogInterface dialog, int which) { -// GameAppProxy.appExit(); -// } -// }); -// // 鏄剧ず -// normalDialog.show(); + final AlertDialog.Builder normalDialog = new AlertDialog.Builder(activity); + normalDialog.setTitle("鏉冮檺璁剧疆"); + normalDialog.setMessage("娓告垙闇�瑕侀儴鍒嗘潈闄愭墠鑳芥甯歌繍琛岋紝璇峰墠寰�璁剧疆涓墦寮�瀛樺偍鏉冮檺"); + normalDialog.setPositiveButton("鍓嶅線璁剧疆", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS); + Uri uri = Uri.fromParts("package", activity.getPackageName(), null); + intent.setData(uri); + activity.startActivityForResult(intent, REQUEST_RECORD_PERMISSION_SETTING); + dialog.dismiss(); + } + }); + normalDialog.setNegativeButton("閫�鍑�", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + GameAppProxy.appExit(); + } + }); + // 鏄剧ず + normalDialog.show(); } public void onActivityResult(Activity activity, int requestCode) { -- Gitblit v1.8.0