Browse Source

1.将应用app网络白名单放到登录之后再执行。

2.修改设置自动旋转的方法提示。
20241218TB223FC(测试jar包)
wangwanlei 5 months ago
parent
commit
bef605475a

+ 4
- 4
app/src/main/java/com/xhly/manageapp/AppAdapter.kt View File

@@ -59,11 +59,11 @@ class AppAdapter(var context: Context, var data: ArrayList<AppInfo>) :
59 59
                 }
60 60
             }else if (appInfo.packageName.equals(Const.CUSTOMROTATIONAPP)){
61 61
                 val rotationAllowed = SystemUtil.isRotationAllowed(context)
62
-                ManageApplication.disallowSetAutoRotation(!rotationAllowed)
63
-                val tips=if (!rotationAllowed){
64
-                    context.getString(R.string.openrotation)
65
-                }else{
62
+                ManageApplication.disallowSetAutoRotation(rotationAllowed)
63
+                val tips=if (SystemUtil.isRotationAllowed(context)){
66 64
                     context.getString(R.string.closerotation)
65
+                }else{
66
+                    context.getString(R.string.openrotation)
67 67
                 }
68 68
                 Toaster.showLong(tips)
69 69
             }else if (appInfo.packageName.equals(Const.CUSTOMCHANGEPSD)){

+ 6
- 3
app/src/main/java/com/xhly/manageapp/ManageApplication.kt View File

@@ -7,6 +7,7 @@ import android.content.ComponentName
7 7
 import android.content.Context
8 8
 import android.content.pm.PackageManager
9 9
 import android.os.Build
10
+import android.util.Log
10 11
 import androidx.core.content.ContextCompat
11 12
 import androidx.multidex.BuildConfig
12 13
 import androidx.multidex.MultiDex
@@ -435,7 +436,7 @@ class ManageApplication : MultiDexApplication() {
435 436
          */
436 437
         fun disallowSetAutoRotation(enable: Boolean) {
437 438
             if (ModelNameUtils.IS_LianxX505f()) {
438
-                //true:允许自动旋转屏幕
439
+                //true关闭 flase开启 6e6f可能不一样
439 440
                 csdkManager?.setAutoRotate(enable)
440 441
             } else if (ModelNameUtils.IS_LianxX6e6f()) {
441 442
                 //csdkManager?.disallowSetAutoRotation(enable)
@@ -666,8 +667,10 @@ class ManageApplication : MultiDexApplication() {
666 667
         /**
667 668
          * 添加网络应用白名单
668 669
          */
669
-        fun addAppWhiteRule(pkgList: ArrayList<String>) {
670
-            clearAppWhiteRule()
670
+        fun addAppWhiteRule(pkgList: ArrayList<String>,removeFlag:Boolean=true) {
671
+            if (removeFlag){
672
+                clearAppWhiteRule()
673
+            }
671 674
             if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()) {
672 675
                 pkgList.forEach {
673 676
                     csdkManager?.AddAppWhiteRule(it)

+ 2
- 4
app/src/main/java/com/xhly/manageapp/utils/StrategyUtils.kt View File

@@ -435,14 +435,12 @@ object StrategyUtils {
435 435
             //启用网络白名单,需要处理,不能每次都清除之前的白名单所以默认只添加不移除,请求接口时才移除。目前登录成功才控制
436 436
             if (loginSucess){
437 437
                 ManageApplication.setDefaultUrlWhiteListWrite(arrayListOf())
438
+                //给自己以及联想sn验证加入网络白名单
439
+                ManageApplication.addAppWhiteRule(arrayListOf(Const.CURRENTAPPPKG, "com.lenovo.mia.setupwizard"),false)
438 440
             }
439
-            val urlWhiteListRead = ManageApplication.urlWhiteListRead()
440
-            LogShow("之前的白名单有"+urlWhiteListRead.size)
441 441
             //启用安装白名单
442 442
             ManageApplication.addInstallPackageWhiteList(arrayListOf(Const.CURRENTAPPPKG, Const.STOREAPPPKG))
443 443
             ManageApplication.setSleepTimeoutV3()
444
-            //给自己以及联想sn验证加入网络白名单
445
-            ManageApplication.addAppWhiteRule(arrayListOf(Const.CURRENTAPPPKG, "com.lenovo.mia.setupwizard"))
446 444
             //默认打开wifi禁止用户关闭
447 445
            // ManageApplication.disallowWifi(true)
448 446
             ManageApplication.enableWifi(true)

Loading…
Cancel
Save