Browse Source

1.当wifi白名单列表不变时,不重新设置白名单。

20241218TB223FC(测试jar包)
wangwanlei 6 months ago
parent
commit
7c726472d6

+ 12
- 2
app/src/main/java/com/xhly/manageapp/ManageApplication.kt View File

@@ -354,7 +354,17 @@ class ManageApplication : MultiDexApplication() {
354 354
          */
355 355
         fun setWifiWhiteList(list: List<String>) {
356 356
             if (ModelNameUtils.IS_LianxX505f()) {
357
-                csdkManager?.wifiWhiteList = list
357
+                try {
358
+                    val sorted = getWifiWhiteList().sorted()
359
+                    LogShow("wifi白名单有$sorted")
360
+                    if (sorted.equals(list.sorted())){
361
+                        return
362
+                    }else{
363
+                        csdkManager?.wifiWhiteList = list
364
+                    }
365
+                }catch (e:Exception){
366
+                    csdkManager?.wifiWhiteList = list
367
+                }
358 368
             } else if (ModelNameUtils.IS_LianxX6e6f()) {
359 369
                 enableWifiWhiteList(true)
360 370
                 csdkManager?.addWifiWhiteList(list)
@@ -784,7 +794,7 @@ class ManageApplication : MultiDexApplication() {
784 794
 
785 795
             }
786 796
             if (!exitControlFlag) {
787
-                StrategyUtils.initControlStrategy()
797
+                StrategyUtils.initControlStrategy(false)
788 798
             }
789 799
         }
790 800
     }

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

@@ -35,10 +35,10 @@ object StrategyUtils {
35 35
                     }
36 36
                 }
37 37
                 //先移除再添加
38
-                val wifiWhiteList = ManageApplication.getWifiWhiteList()
38
+              /*  val wifiWhiteList = ManageApplication.getWifiWhiteList()
39 39
                 if (wifiWhiteList.isNotEmpty()){
40 40
                     ManageApplication.removeWifiWhiteList(wifiWhiteList)
41
-                }
41
+                }*/
42 42
                 ManageApplication.addWifiWhiteList(list)
43 43
             }
44 44
         } else {
@@ -429,11 +429,15 @@ object StrategyUtils {
429 429
     }
430 430
 
431 431
     //初始化管控的默认规则
432
-    public fun initControlStrategy(loginSucess:Boolean=false){
432
+    public fun initControlStrategy(loginSucess:Boolean=true){
433 433
         if (ModelNameUtils.IS_LianxX505f()||ModelNameUtils.IS_LianxX6e6f()) {
434 434
             //是505f则执行
435
-            //启用网络白名单,需要处理,不能每次都清除之前的白名单所以默认只添加不移除,请求接口时才移除。
436
-            ManageApplication.setDefaultUrlWhiteListWrite(arrayListOf())
435
+            //启用网络白名单,需要处理,不能每次都清除之前的白名单所以默认只添加不移除,请求接口时才移除。目前登录成功才控制
436
+            if (loginSucess){
437
+                ManageApplication.setDefaultUrlWhiteListWrite(arrayListOf())
438
+            }
439
+            val urlWhiteListRead = ManageApplication.urlWhiteListRead()
440
+            LogShow("之前的白名单有"+urlWhiteListRead.size)
437 441
             //启用安装白名单
438 442
             ManageApplication.addInstallPackageWhiteList(arrayListOf(Const.CURRENTAPPPKG, Const.STOREAPPPKG))
439 443
             ManageApplication.setSleepTimeoutV3()

Loading…
Cancel
Save