Browse Source

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

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

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

354
          */
354
          */
355
         fun setWifiWhiteList(list: List<String>) {
355
         fun setWifiWhiteList(list: List<String>) {
356
             if (ModelNameUtils.IS_LianxX505f()) {
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
             } else if (ModelNameUtils.IS_LianxX6e6f()) {
368
             } else if (ModelNameUtils.IS_LianxX6e6f()) {
359
                 enableWifiWhiteList(true)
369
                 enableWifiWhiteList(true)
360
                 csdkManager?.addWifiWhiteList(list)
370
                 csdkManager?.addWifiWhiteList(list)
784
 
794
 
785
             }
795
             }
786
             if (!exitControlFlag) {
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
                     }
35
                     }
36
                 }
36
                 }
37
                 //先移除再添加
37
                 //先移除再添加
38
-                val wifiWhiteList = ManageApplication.getWifiWhiteList()
38
+              /*  val wifiWhiteList = ManageApplication.getWifiWhiteList()
39
                 if (wifiWhiteList.isNotEmpty()){
39
                 if (wifiWhiteList.isNotEmpty()){
40
                     ManageApplication.removeWifiWhiteList(wifiWhiteList)
40
                     ManageApplication.removeWifiWhiteList(wifiWhiteList)
41
-                }
41
+                }*/
42
                 ManageApplication.addWifiWhiteList(list)
42
                 ManageApplication.addWifiWhiteList(list)
43
             }
43
             }
44
         } else {
44
         } else {
429
     }
429
     }
430
 
430
 
431
     //初始化管控的默认规则
431
     //初始化管控的默认规则
432
-    public fun initControlStrategy(loginSucess:Boolean=false){
432
+    public fun initControlStrategy(loginSucess:Boolean=true){
433
         if (ModelNameUtils.IS_LianxX505f()||ModelNameUtils.IS_LianxX6e6f()) {
433
         if (ModelNameUtils.IS_LianxX505f()||ModelNameUtils.IS_LianxX6e6f()) {
434
             //是505f则执行
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
             ManageApplication.addInstallPackageWhiteList(arrayListOf(Const.CURRENTAPPPKG, Const.STOREAPPPKG))
442
             ManageApplication.addInstallPackageWhiteList(arrayListOf(Const.CURRENTAPPPKG, Const.STOREAPPPKG))
439
             ManageApplication.setSleepTimeoutV3()
443
             ManageApplication.setSleepTimeoutV3()

Loading…
Cancel
Save