Browse Source

1.添加TB223FC机型判断和网络白名单设置代码。

2025_1_17_tb223fc
wangwanlei 1 month ago
parent
commit
52b1bbba6a

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

69
                 val rotationAllowed = SystemUtil.isRotationAllowed(context)
69
                 val rotationAllowed = SystemUtil.isRotationAllowed(context)
70
                 if (ModelNameUtils.IS_LianxX505f()){
70
                 if (ModelNameUtils.IS_LianxX505f()){
71
                     ManageApplication.disallowSetAutoRotation(rotationAllowed)
71
                     ManageApplication.disallowSetAutoRotation(rotationAllowed)
72
-                }else  if (ModelNameUtils.IS_LianxX6e6f()){
72
+                }else  if (ModelNameUtils.IS_LianxX6e6f()||ModelNameUtils.IS_LianxTB223FC()){
73
                     ManageApplication.disallowSetAutoRotation(!rotationAllowed)
73
                     ManageApplication.disallowSetAutoRotation(!rotationAllowed)
74
                 }
74
                 }
75
                 val tips=if (SystemUtil.isRotationAllowed(context)){
75
                 val tips=if (SystemUtil.isRotationAllowed(context)){

+ 122
- 95
app/src/main/java/com/xhly/manageapp/ManageApplication.kt View File

15
 import com.kongzue.dialogx.DialogX
15
 import com.kongzue.dialogx.DialogX
16
 import com.tencent.bugly.crashreport.CrashReport
16
 import com.tencent.bugly.crashreport.CrashReport
17
 import com.xhly.corelib.Const
17
 import com.xhly.corelib.Const
18
+import com.xhly.corelib.utils.AppUtils
18
 import com.xhly.corelib.utils.LogShow
19
 import com.xhly.corelib.utils.LogShow
19
 import com.xhly.corelib.utils.LogUtils
20
 import com.xhly.corelib.utils.LogUtils
20
 import com.xhly.corelib.utils.ModelNameUtils
21
 import com.xhly.corelib.utils.ModelNameUtils
22
 import com.xhly.corelib.utils.SystemUtil
23
 import com.xhly.corelib.utils.SystemUtil
23
 import com.xhly.manageapp.bean.user.UserBean
24
 import com.xhly.manageapp.bean.user.UserBean
24
 import com.xhly.manageapp.service.websocket.AppSocket
25
 import com.xhly.manageapp.service.websocket.AppSocket
26
+import com.xhly.manageapp.utils.AfwUtils
25
 import com.xhly.manageapp.utils.CurrentAppSharedPreferencesUtils
27
 import com.xhly.manageapp.utils.CurrentAppSharedPreferencesUtils
26
 import com.xhly.manageapp.utils.StrategyUtils
28
 import com.xhly.manageapp.utils.StrategyUtils
27
 import com.xhly.manageapp.utils.ZJAPPUtils
29
 import com.xhly.manageapp.utils.ZJAPPUtils
39
          * 加入可安装应用白名单
41
          * 加入可安装应用白名单
40
          */
42
          */
41
         fun addInstallPackageWhiteList(pkgList: ArrayList<String>) {
43
         fun addInstallPackageWhiteList(pkgList: ArrayList<String>) {
42
-            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()) {
44
+            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
43
                 //先移除,再添加。
45
                 //先移除,再添加。
44
                 removeInstallPackageWhiteList(getInstallPackageWhiteList())
46
                 removeInstallPackageWhiteList(getInstallPackageWhiteList())
45
                 pkgList.add(Const.CURRENTAPPPKG)
47
                 pkgList.add(Const.CURRENTAPPPKG)
54
          * 移除可安装应用白名单
56
          * 移除可安装应用白名单
55
          */
57
          */
56
         fun removeInstallPackageWhiteList(pkgList: ArrayList<String>) {
58
         fun removeInstallPackageWhiteList(pkgList: ArrayList<String>) {
57
-            if ((ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()) && pkgList.size > 0) {
59
+            if ((ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f() ||ModelNameUtils.IS_LianxTB223FC()) && pkgList.size > 0) {
58
                 pkgList.remove(Const.CURRENTAPPPKG)
60
                 pkgList.remove(Const.CURRENTAPPPKG)
59
                 pkgList.remove("com.xhkjedu.pinyin")
61
                 pkgList.remove("com.xhkjedu.pinyin")
60
                 csdkManager?.removeInstallPackageWhiteList(pkgList)
62
                 csdkManager?.removeInstallPackageWhiteList(pkgList)
67
          */
69
          */
68
         fun getInstallPackageWhiteList(): ArrayList<String> {
70
         fun getInstallPackageWhiteList(): ArrayList<String> {
69
             try {
71
             try {
70
-                if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()) {
72
+                if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
71
                     return csdkManager?.installPackageWhiteList as ArrayList<String>
73
                     return csdkManager?.installPackageWhiteList as ArrayList<String>
72
                 }
74
                 }
73
             } catch (e: Exception) {
75
             } catch (e: Exception) {
82
 
84
 
83
         fun installPackage(string: String) {
85
         fun installPackage(string: String) {
84
             enableAllUnkownsourcesV3(true)
86
             enableAllUnkownsourcesV3(true)
85
-            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()) {
87
+            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
86
                 LogShow("开始安装$string" + File(string).exists())
88
                 LogShow("开始安装$string" + File(string).exists())
87
                 csdkManager?.installPackage(string)
89
                 csdkManager?.installPackage(string)
88
             } else {
90
             } else {
97
          */
99
          */
98
 
100
 
99
         fun uninstallPackage(pkg: String) {
101
         fun uninstallPackage(pkg: String) {
100
-            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()) {
102
+            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
101
                 if (pkg == Const.CURRENTAPPPKG || pkg == Const.STOREAPPPKG || pkg == Const.INPUTMETHODPKG) {
103
                 if (pkg == Const.CURRENTAPPPKG || pkg == Const.STOREAPPPKG || pkg == Const.INPUTMETHODPKG) {
102
                     //不卸载管控和商店以及输入法
104
                     //不卸载管控和商店以及输入法
103
                     return
105
                     return
110
          * 禁止安装app,true:禁止安装应用 false:取消禁止安装应用,禁止时静默安装只能安装白名单内的应用,不禁止时静默安装可以安装白名单外的应用
112
          * 禁止安装app,true:禁止安装应用 false:取消禁止安装应用,禁止时静默安装只能安装白名单内的应用,不禁止时静默安装可以安装白名单外的应用
111
          */
113
          */
112
         fun disableInstallation(isInstall: Boolean) {
114
         fun disableInstallation(isInstall: Boolean) {
113
-            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()) {
115
+            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
114
                 csdkManager?.disableInstallation(isInstall)
116
                 csdkManager?.disableInstallation(isInstall)
115
             }
117
             }
116
         }
118
         }
123
         fun disableApplicationManage(enable: Boolean) {
125
         fun disableApplicationManage(enable: Boolean) {
124
             if (ModelNameUtils.IS_LianxX505f()) {
126
             if (ModelNameUtils.IS_LianxX505f()) {
125
                 csdkManager?.disableApplicationManage_v3(enable)
127
                 csdkManager?.disableApplicationManage_v3(enable)
126
-            } else if (ModelNameUtils.IS_LianxX6e6f()) {
128
+            } else if (ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
127
                 csdkManager?.disableApplicationManageV3(enable)
129
                 csdkManager?.disableApplicationManageV3(enable)
128
             }
130
             }
129
         }
131
         }
133
          */
135
          */
134
         fun setPackageEnabled(pkg: String, enableFlag: Boolean) {
136
         fun setPackageEnabled(pkg: String, enableFlag: Boolean) {
135
             try {
137
             try {
136
-                if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()) {
138
+                if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
137
                     csdkManager?.setPackageEnabled(pkg, enableFlag)
139
                     csdkManager?.setPackageEnabled(pkg, enableFlag)
138
                 }
140
                 }
139
             }catch (e:Exception){
141
             }catch (e:Exception){
147
         fun setDisplayBlacklist(pkgList: ArrayList<String>) {
149
         fun setDisplayBlacklist(pkgList: ArrayList<String>) {
148
             if (ModelNameUtils.IS_LianxX505f()) {
150
             if (ModelNameUtils.IS_LianxX505f()) {
149
                 csdkManager?.displayBlacklist_v3 = pkgList
151
                 csdkManager?.displayBlacklist_v3 = pkgList
150
-            } else if (ModelNameUtils.IS_LianxX6e6f()) {
152
+            } else if (ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
151
                 csdkManager?.displayBlacklistV3 = pkgList
153
                 csdkManager?.displayBlacklistV3 = pkgList
152
             }
154
             }
153
         }
155
         }
156
          * 杀进程
158
          * 杀进程
157
          */
159
          */
158
         fun killApplicationProcess(pkg: String) {
160
         fun killApplicationProcess(pkg: String) {
159
-            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()) {
161
+            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
160
                 csdkManager?.killApplicationProcess(pkg)
162
                 csdkManager?.killApplicationProcess(pkg)
161
             }
163
             }
162
         }
164
         }
166
          * false:启用相机
168
          * false:启用相机
167
          */
169
          */
168
         fun disableCamera(enableFlag: Boolean) {
170
         fun disableCamera(enableFlag: Boolean) {
169
-            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()) {
171
+            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
170
                 csdkManager?.disableCamera(enableFlag)
172
                 csdkManager?.disableCamera(enableFlag)
171
             }
173
             }
172
         }
174
         }
178
         fun enableBluetooth(enableFlag: Boolean) {
180
         fun enableBluetooth(enableFlag: Boolean) {
179
             if (ModelNameUtils.IS_LianxX505f()) {
181
             if (ModelNameUtils.IS_LianxX505f()) {
180
                 csdkManager?.enableBluetooth_v3(enableFlag)
182
                 csdkManager?.enableBluetooth_v3(enableFlag)
181
-            } else if (ModelNameUtils.IS_LianxX6e6f()) {
183
+            } else if (ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
182
                 csdkManager?.enableBluetoothV3(enableFlag)
184
                 csdkManager?.enableBluetoothV3(enableFlag)
183
             }
185
             }
184
         }
186
         }
189
         fun disallowUsbDebugging(enableFlag: Boolean) {
191
         fun disallowUsbDebugging(enableFlag: Boolean) {
190
             if (ModelNameUtils.IS_LianxX505f()) {
192
             if (ModelNameUtils.IS_LianxX505f()) {
191
                 csdkManager?.disallowUsbDebugging_v3(enableFlag)
193
                 csdkManager?.disallowUsbDebugging_v3(enableFlag)
192
-            } else if (ModelNameUtils.IS_LianxX6e6f()) {
194
+            } else if (ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
193
                 csdkManager?.disallowUsbDebuggingV3(enableFlag)
195
                 csdkManager?.disallowUsbDebuggingV3(enableFlag)
194
             }
196
             }
195
         }
197
         }
200
         fun disallowWifi(enableFlag: Boolean) {
202
         fun disallowWifi(enableFlag: Boolean) {
201
             if (ModelNameUtils.IS_LianxX505f()) {
203
             if (ModelNameUtils.IS_LianxX505f()) {
202
                 csdkManager?.disallowWifi_v3(enableFlag)
204
                 csdkManager?.disallowWifi_v3(enableFlag)
203
-            } else if (ModelNameUtils.IS_LianxX6e6f()) {
205
+            } else if (ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
204
                 csdkManager?.disallowWifiV3(enableFlag)
206
                 csdkManager?.disallowWifiV3(enableFlag)
205
             }
207
             }
206
         }
208
         }
211
         fun enableWifi(enableFlag: Boolean) {
213
         fun enableWifi(enableFlag: Boolean) {
212
             if (ModelNameUtils.IS_LianxX505f()) {
214
             if (ModelNameUtils.IS_LianxX505f()) {
213
                 csdkManager?.enableWifi_v3(enableFlag)
215
                 csdkManager?.enableWifi_v3(enableFlag)
214
-            } else if (ModelNameUtils.IS_LianxX6e6f()) {
216
+            } else if (ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
215
                 csdkManager?.enableWifiV3(enableFlag)
217
                 csdkManager?.enableWifiV3(enableFlag)
216
             }
218
             }
217
         }
219
         }
222
         fun disallowData(enableFlag: Boolean) {
224
         fun disallowData(enableFlag: Boolean) {
223
             if (ModelNameUtils.IS_LianxX505f()) {
225
             if (ModelNameUtils.IS_LianxX505f()) {
224
                 csdkManager?.disallowData_v3(enableFlag)
226
                 csdkManager?.disallowData_v3(enableFlag)
225
-            } else if (ModelNameUtils.IS_LianxX6e6f()) {
227
+            } else if (ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
226
                 csdkManager?.disallowDataV3(enableFlag)
228
                 csdkManager?.disallowDataV3(enableFlag)
227
             }
229
             }
228
         }
230
         }
233
         fun enableData(enableFlag: Boolean) {
235
         fun enableData(enableFlag: Boolean) {
234
             if (ModelNameUtils.IS_LianxX505f()) {
236
             if (ModelNameUtils.IS_LianxX505f()) {
235
                 csdkManager?.enableData_v3(enableFlag)
237
                 csdkManager?.enableData_v3(enableFlag)
236
-            } else if (ModelNameUtils.IS_LianxX6e6f()) {
238
+            } else if (ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
237
                 csdkManager?.enableDataV3(enableFlag)
239
                 csdkManager?.enableDataV3(enableFlag)
238
             }
240
             }
239
         }
241
         }
244
         fun disallowLocation(enableFlag: Boolean) {
246
         fun disallowLocation(enableFlag: Boolean) {
245
             if (ModelNameUtils.IS_LianxX505f()) {
247
             if (ModelNameUtils.IS_LianxX505f()) {
246
                 csdkManager?.disallowLocation_v3(enableFlag)
248
                 csdkManager?.disallowLocation_v3(enableFlag)
247
-            } else if (ModelNameUtils.IS_LianxX6e6f()) {
249
+            } else if (ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
248
                 csdkManager?.disallowLocationV3(enableFlag)
250
                 csdkManager?.disallowLocationV3(enableFlag)
249
             }
251
             }
250
         }
252
         }
255
         fun enableLocation(enableFlag: Boolean) {
257
         fun enableLocation(enableFlag: Boolean) {
256
             if (ModelNameUtils.IS_LianxX505f()) {
258
             if (ModelNameUtils.IS_LianxX505f()) {
257
                 csdkManager?.enableLocation_v3(enableFlag)
259
                 csdkManager?.enableLocation_v3(enableFlag)
258
-            } else if (ModelNameUtils.IS_LianxX6e6f()) {
260
+            } else if (ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
259
                 csdkManager?.enableLocationV3(enableFlag)
261
                 csdkManager?.enableLocationV3(enableFlag)
260
             }
262
             }
261
         }
263
         }
266
         fun disallowWifiAdvanceSettings(enableFlag: Boolean) {
268
         fun disallowWifiAdvanceSettings(enableFlag: Boolean) {
267
             if (ModelNameUtils.IS_LianxX505f()) {
269
             if (ModelNameUtils.IS_LianxX505f()) {
268
                 csdkManager?.disallowWifiadvancesettings_v3(enableFlag)
270
                 csdkManager?.disallowWifiadvancesettings_v3(enableFlag)
269
-            } else if (ModelNameUtils.IS_LianxX6e6f()) {
271
+            } else if (ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
270
                 csdkManager?.disallowWifiAdvanceSettingsV3(enableFlag)
272
                 csdkManager?.disallowWifiAdvanceSettingsV3(enableFlag)
271
             }
273
             }
272
         }
274
         }
275
          *禁用/启用SD卡 true:允许连接外部存储设备
277
          *禁用/启用SD卡 true:允许连接外部存储设备
276
          */
278
          */
277
         fun enableMassStorage(enableFlag: Boolean) {
279
         fun enableMassStorage(enableFlag: Boolean) {
278
-            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()) {
280
+            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
279
                 csdkManager?.enableMassStorage(enableFlag)
281
                 csdkManager?.enableMassStorage(enableFlag)
280
             }
282
             }
281
         }
283
         }
284
          *禁用/启用OTG true:允许连接外部OTG
286
          *禁用/启用OTG true:允许连接外部OTG
285
          */
287
          */
286
         fun setCustomOTG(enableFlag: Boolean) {
288
         fun setCustomOTG(enableFlag: Boolean) {
287
-            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()) {
289
+            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
288
                 csdkManager?.customOTG = enableFlag
290
                 csdkManager?.customOTG = enableFlag
289
             }
291
             }
290
         }
292
         }
296
         fun disallowSwitchLauncher_v3(enableFlag: Boolean) {
298
         fun disallowSwitchLauncher_v3(enableFlag: Boolean) {
297
             if (ModelNameUtils.IS_LianxX505f()) {
299
             if (ModelNameUtils.IS_LianxX505f()) {
298
                 csdkManager?.disallowSwitchLauncher_v3(enableFlag)
300
                 csdkManager?.disallowSwitchLauncher_v3(enableFlag)
299
-            } else if (ModelNameUtils.IS_LianxX6e6f()) {
301
+            } else if (ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
300
                 csdkManager?.disallowSwitchLauncherV3(enableFlag)
302
                 csdkManager?.disallowSwitchLauncherV3(enableFlag)
301
             }
303
             }
302
         }
304
         }
305
          * 设置运行时权限
307
          * 设置运行时权限
306
          */
308
          */
307
         fun setRuntimePermissions(enableFlag: Boolean) {
309
         fun setRuntimePermissions(enableFlag: Boolean) {
308
-            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()) {
310
+            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
309
                 csdkManager?.setRuntimePermissions(enableFlag)
311
                 csdkManager?.setRuntimePermissions(enableFlag)
310
             }
312
             }
311
         }
313
         }
314
          * "设备Mac地址", "设备SN号", "获取设备型号信息", "获取设备IMEI信息" 1,2,3,4
316
          * "设备Mac地址", "设备SN号", "获取设备型号信息", "获取设备IMEI信息" 1,2,3,4
315
          */
317
          */
316
         fun getDeviceInfo(type: Int = 2): String? {
318
         fun getDeviceInfo(type: Int = 2): String? {
317
-            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()) {
319
+            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
318
                 return csdkManager?.getDeviceInfo(type)
320
                 return csdkManager?.getDeviceInfo(type)
319
             }
321
             }
320
             try {
322
             try {
345
          * 恢复出场设置
347
          * 恢复出场设置
346
          */
348
          */
347
         fun launchFactoryReset() {
349
         fun launchFactoryReset() {
348
-            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()) {
350
+            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
349
                 csdkManager?.launchFactoryReset()
351
                 csdkManager?.launchFactoryReset()
350
             }
352
             }
351
         }
353
         }
355
          */
357
          */
356
 
358
 
357
         fun rebootDevice() {
359
         fun rebootDevice() {
358
-            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()) {
360
+            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
359
                 csdkManager?.rebootDevice()
361
                 csdkManager?.rebootDevice()
360
             }
362
             }
361
         }
363
         }
364
          * 增加wifi白名单
366
          * 增加wifi白名单
365
          */
367
          */
366
         fun addWifiWhiteList(list: List<String>) {
368
         fun addWifiWhiteList(list: List<String>) {
367
-            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()) {
368
-                //csdkManager?.addWifiWhiteList(list)
369
+            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
369
                 setWifiWhiteList(list)
370
                 setWifiWhiteList(list)
370
             }
371
             }
371
         }
372
         }
386
                 } catch (e: Exception) {
387
                 } catch (e: Exception) {
387
                     csdkManager?.wifiWhiteList = list
388
                     csdkManager?.wifiWhiteList = list
388
                 }
389
                 }
389
-            } else if (ModelNameUtils.IS_LianxX6e6f()) {
390
+            } else if (ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
390
                 enableWifiWhiteList(true)
391
                 enableWifiWhiteList(true)
391
                 csdkManager?.addWifiWhiteList(list)
392
                 csdkManager?.addWifiWhiteList(list)
392
             }
393
             }
397
          */
398
          */
398
         fun enableWifiWhiteList(enable: Boolean) {
399
         fun enableWifiWhiteList(enable: Boolean) {
399
             if (ModelNameUtils.IS_LianxX505f()) {
400
             if (ModelNameUtils.IS_LianxX505f()) {
400
-                //csdkManager?.whitelist
401
-            } else if (ModelNameUtils.IS_LianxX6e6f()) {
401
+               //移除就是启用所以505不调用方法
402
+            } else if (ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
402
                 csdkManager?.enableWifiWhiteList(enable)
403
                 csdkManager?.enableWifiWhiteList(enable)
403
             }
404
             }
404
         }
405
         }
407
          * 移除wifi白名单
408
          * 移除wifi白名单
408
          */
409
          */
409
         fun removeWifiWhiteList(list: List<String>) {
410
         fun removeWifiWhiteList(list: List<String>) {
410
-            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()) {
411
+            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
411
                 csdkManager?.removeWifiWhiteList(list)
412
                 csdkManager?.removeWifiWhiteList(list)
412
             }
413
             }
413
         }
414
         }
416
          * 获得wifi白名单
417
          * 获得wifi白名单
417
          */
418
          */
418
         fun getWifiWhiteList(): List<String> {
419
         fun getWifiWhiteList(): List<String> {
419
-            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()) {
420
+            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
420
                 val wifiWhiteList = csdkManager?.wifiWhiteList
421
                 val wifiWhiteList = csdkManager?.wifiWhiteList
421
                 if (wifiWhiteList != null) {
422
                 if (wifiWhiteList != null) {
422
                     return wifiWhiteList
423
                     return wifiWhiteList
432
         fun enableCaptureScreen(enable: Boolean) {
433
         fun enableCaptureScreen(enable: Boolean) {
433
             if (ModelNameUtils.IS_LianxX505f()) {
434
             if (ModelNameUtils.IS_LianxX505f()) {
434
                 csdkManager?.enableCaptureScreen_v3(enable)
435
                 csdkManager?.enableCaptureScreen_v3(enable)
435
-            } else if (ModelNameUtils.IS_LianxX6e6f()) {
436
+            } else if (ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
436
                 csdkManager?.enableCaptureScreenV3(enable)
437
                 csdkManager?.enableCaptureScreenV3(enable)
437
             }
438
             }
438
         }
439
         }
444
             if (ModelNameUtils.IS_LianxX505f()) {
445
             if (ModelNameUtils.IS_LianxX505f()) {
445
                 //true关闭 flase开启 6e6f可能不一样
446
                 //true关闭 flase开启 6e6f可能不一样
446
                 csdkManager?.setAutoRotate(enable)
447
                 csdkManager?.setAutoRotate(enable)
447
-            } else if (ModelNameUtils.IS_LianxX6e6f()) {
448
+            } else if (ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
448
                 //true开启  flase关闭
449
                 //true开启  flase关闭
449
                 csdkManager?.enableAutoRotation(enable)
450
                 csdkManager?.enableAutoRotation(enable)
450
             }
451
             }
454
          * 隐藏底部返回键
455
          * 隐藏底部返回键
455
          */
456
          */
456
         fun hideBackSoftKey(enableFlag: Boolean) {
457
         fun hideBackSoftKey(enableFlag: Boolean) {
457
-            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()) {
458
+            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
458
                 csdkManager?.hideBackSoftKey(enableFlag)
459
                 csdkManager?.hideBackSoftKey(enableFlag)
459
             }
460
             }
460
         }
461
         }
463
          * 隐藏底部菜单键
464
          * 隐藏底部菜单键
464
          */
465
          */
465
         fun hideMenuSoftKey(enableFlag: Boolean) {
466
         fun hideMenuSoftKey(enableFlag: Boolean) {
466
-            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()) {
467
+            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
467
                 csdkManager?.hideMenuSoftKey(enableFlag)
468
                 csdkManager?.hideMenuSoftKey(enableFlag)
468
             }
469
             }
469
         }
470
         }
473
          * 隐藏底部home键
474
          * 隐藏底部home键
474
          */
475
          */
475
         fun hideHomeSoftKey(enableFlag: Boolean) {
476
         fun hideHomeSoftKey(enableFlag: Boolean) {
476
-            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()) {
477
+            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
477
                 csdkManager?.hideHomeSoftKey(enableFlag)
478
                 csdkManager?.hideHomeSoftKey(enableFlag)
478
             }
479
             }
479
         }
480
         }
482
          * 隐藏电源,音量键int:24, 25, 26(音量上,音量下,电源键) true:启用
483
          * 隐藏电源,音量键int:24, 25, 26(音量上,音量下,电源键) true:启用
483
          */
484
          */
484
         fun requestKeyControl_V3(code: Int, enableFlag: Boolean) {
485
         fun requestKeyControl_V3(code: Int, enableFlag: Boolean) {
485
-            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()) {
486
+            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
486
                 csdkManager?.requestKeyControl_V3(code, enableFlag)
487
                 csdkManager?.requestKeyControl_V3(code, enableFlag)
487
             }
488
             }
488
         }
489
         }
499
          */
500
          */
500
 
501
 
501
         fun setComponentEnabled(componentName: ComponentName, newstate: Int, flag: Int) {
502
         fun setComponentEnabled(componentName: ComponentName, newstate: Int, flag: Int) {
502
-            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()) {
503
+            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
503
                try {
504
                try {
504
                    csdkManager?.setComponentEnabled(componentName, newstate, flag)
505
                    csdkManager?.setComponentEnabled(componentName, newstate, flag)
505
                }catch (e:Exception){
506
                }catch (e:Exception){
512
          * 设置启动器
513
          * 设置启动器
513
          */
514
          */
514
         fun setCustomLauncher(pkg: String, activityName: String) {
515
         fun setCustomLauncher(pkg: String, activityName: String) {
515
-            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()) {
516
+            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
516
                 csdkManager?.setCustomLauncher(pkg, activityName)
517
                 csdkManager?.setCustomLauncher(pkg, activityName)
517
             }
518
             }
518
         }
519
         }
524
         fun disallowAirplaneMode_v3(enableFlag: Boolean) {
525
         fun disallowAirplaneMode_v3(enableFlag: Boolean) {
525
             if (ModelNameUtils.IS_LianxX505f()) {
526
             if (ModelNameUtils.IS_LianxX505f()) {
526
                 csdkManager?.disallowAirplaneMode_v3(enableFlag)
527
                 csdkManager?.disallowAirplaneMode_v3(enableFlag)
527
-            } else if (ModelNameUtils.IS_LianxX6e6f()) {
528
+            } else if (ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
528
                 csdkManager?.disallowAirplaneModeV3(enableFlag)
529
                 csdkManager?.disallowAirplaneModeV3(enableFlag)
529
             }
530
             }
530
         }
531
         }
535
          * false:显示状态栏
536
          * false:显示状态栏
536
          */
537
          */
537
         fun hideStatusBar(enableFlag: Boolean) {
538
         fun hideStatusBar(enableFlag: Boolean) {
538
-            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()) {
539
+            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
539
                 csdkManager?.hideStatusBar(enableFlag)
540
                 csdkManager?.hideStatusBar(enableFlag)
540
             }
541
             }
541
         }
542
         }
545
          * false:启用状态栏下拉
546
          * false:启用状态栏下拉
546
          */
547
          */
547
         fun disableStatusBarPanel(enableFlag: Boolean) {
548
         fun disableStatusBarPanel(enableFlag: Boolean) {
548
-            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()) {
549
+            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
549
                 csdkManager?.disableStatusBarPanel(enableFlag)
550
                 csdkManager?.disableStatusBarPanel(enableFlag)
550
             }
551
             }
551
         }
552
         }
558
         fun enableAllUnkownsourcesV3(enableFlag: Boolean) {
559
         fun enableAllUnkownsourcesV3(enableFlag: Boolean) {
559
             if (ModelNameUtils.IS_LianxX505f()) {
560
             if (ModelNameUtils.IS_LianxX505f()) {
560
                 csdkManager?.enableAllUnkownsources_v3(enableFlag)
561
                 csdkManager?.enableAllUnkownsources_v3(enableFlag)
561
-            } else if (ModelNameUtils.IS_LianxX6e6f()) {
562
+            } else if (ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
562
                 csdkManager?.enableAllUnkownsourcesV3(enableFlag)
563
                 csdkManager?.enableAllUnkownsourcesV3(enableFlag)
563
             }
564
             }
564
         }
565
         }
570
         fun enableUnkownsources(pkg: String, enableFlag: Boolean) {
571
         fun enableUnkownsources(pkg: String, enableFlag: Boolean) {
571
             if (ModelNameUtils.IS_LianxX505f()) {
572
             if (ModelNameUtils.IS_LianxX505f()) {
572
                 csdkManager?.enableUnkownsources_v3(pkg, enableFlag)
573
                 csdkManager?.enableUnkownsources_v3(pkg, enableFlag)
573
-            } else if (ModelNameUtils.IS_LianxX6e6f()) {
574
+            } else if (ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
574
                 csdkManager?.enableUnkownsourcesV3(pkg, enableFlag)
575
                 csdkManager?.enableUnkownsourcesV3(pkg, enableFlag)
575
             }
576
             }
576
         }
577
         }
580
          * false:关闭 USB 调试
581
          * false:关闭 USB 调试
581
          */
582
          */
582
         fun enableUsbDebugging(enableFlag: Boolean) {
583
         fun enableUsbDebugging(enableFlag: Boolean) {
583
-            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()) {
584
+            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
584
                 csdkManager?.enableUsbDebugging(true)
585
                 csdkManager?.enableUsbDebugging(true)
585
                 if (ModelNameUtils.IS_LianxX505f()) {
586
                 if (ModelNameUtils.IS_LianxX505f()) {
586
                     //关闭usb调试时设置为充电模式
587
                     //关闭usb调试时设置为充电模式
608
          *设置系统时间
609
          *设置系统时间
609
          */
610
          */
610
         fun setSysTime(time: Long) {
611
         fun setSysTime(time: Long) {
611
-            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()) {
612
+            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
612
                 csdkManager?.setSysTime(time)
613
                 csdkManager?.setSysTime(time)
613
             }
614
             }
614
         }
615
         }
617
          * 添加网络白名单
618
          * 添加网络白名单
618
          */
619
          */
619
         fun setUrlWhiteListWrite(list: ArrayList<String>) {
620
         fun setUrlWhiteListWrite(list: ArrayList<String>) {
620
-            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()) {
621
+            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
621
                 setUrlWhiteListEnable(true)
622
                 setUrlWhiteListEnable(true)
622
                 //先清除再添加
623
                 //先清除再添加
623
                 ClearIpHostRules()
624
                 ClearIpHostRules()
624
                 list.add(Const.BASEURL)
625
                 list.add(Const.BASEURL)
625
                 list.addAll(Const.whiteList)
626
                 list.addAll(Const.whiteList)
626
-                csdkManager?.urlWhiteListWrite(list)
627
-                csdkManager?.urlBlackListWrite(arrayListOf("*"))
627
+                if (ModelNameUtils.IS_LianxTB223FC()){
628
+                  AfwUtils.addUrLWhiteList(list)
629
+                  AfwUtils.addUrLBlackList(arrayListOf("*"))
630
+                }else{
631
+                    csdkManager?.urlWhiteListWrite(list)
632
+                    csdkManager?.urlBlackListWrite(arrayListOf("*"))
633
+                }
628
             }
634
             }
629
         }
635
         }
630
 
636
 
633
          * 添加默认网络白名单
639
          * 添加默认网络白名单
634
          */
640
          */
635
         fun setDefaultUrlWhiteListWrite(list: ArrayList<String>) {
641
         fun setDefaultUrlWhiteListWrite(list: ArrayList<String>) {
636
-            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()) {
642
+            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
637
                 setUrlWhiteListEnable(true)
643
                 setUrlWhiteListEnable(true)
638
                 val urlWhiteListRead = urlWhiteListRead()
644
                 val urlWhiteListRead = urlWhiteListRead()
639
                 LogShow("之前的白名单有" + urlWhiteListRead.size)
645
                 LogShow("之前的白名单有" + urlWhiteListRead.size)
650
          * 启动网络白名单true启动,false关闭
656
          * 启动网络白名单true启动,false关闭
651
          */
657
          */
652
         fun setUrlWhiteListEnable(enableFlag: Boolean) {
658
         fun setUrlWhiteListEnable(enableFlag: Boolean) {
653
-            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()) {
654
-                csdkManager?.SetEnable(enableFlag)
659
+            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
660
+                if (ModelNameUtils.IS_LianxTB223FC()){
661
+                    AfwUtils.setEnable(enableFlag)
662
+                }else{
663
+                    csdkManager?.SetEnable(enableFlag)
664
+                }
655
             }
665
             }
656
         }
666
         }
657
 
667
 
659
          * 移除网络白名单505f使用这个
669
          * 移除网络白名单505f使用这个
660
          */
670
          */
661
         fun ClearIpHostRules(): Boolean {
671
         fun ClearIpHostRules(): Boolean {
662
-            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()) {
663
-                val clearIpHostRules = csdkManager?.ClearIpHostRules()
664
-                clearIpHostRules?.let {
665
-                    return it
672
+            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
673
+                if (ModelNameUtils.IS_LianxTB223FC()){
674
+                    AfwUtils.clearIpHostRules()
675
+                }else{
676
+                    val clearIpHostRules = csdkManager?.ClearIpHostRules()
677
+                    clearIpHostRules?.let {
678
+                        return it
679
+                    }
666
                 }
680
                 }
667
             }
681
             }
668
             return false
682
             return false
676
 
690
 
677
         fun  setSafeModeDisabled(boolean: Boolean=true){
691
         fun  setSafeModeDisabled(boolean: Boolean=true){
678
            try {
692
            try {
679
-               if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()) {
693
+               if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
680
                    csdkManager?.setSafeModeDisabled(boolean)
694
                    csdkManager?.setSafeModeDisabled(boolean)
681
                }
695
                }
682
            }catch (e:Exception){
696
            }catch (e:Exception){
693
                 pkgList.forEach {
707
                 pkgList.forEach {
694
                     csdkManager?.clearAppData(it)
708
                     csdkManager?.clearAppData(it)
695
                 }
709
                 }
696
-            }else if (ModelNameUtils.IS_LianxX6e6f()){
710
+            }else if (ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()){
697
                 pkgList.forEach {
711
                 pkgList.forEach {
698
                     csdkManager?.clearAppData(it)
712
                     csdkManager?.clearAppData(it)
699
                 }
713
                 }
707
             if (removeFlag) {
721
             if (removeFlag) {
708
                 clearAppWhiteRule()
722
                 clearAppWhiteRule()
709
             }
723
             }
710
-            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()) {
711
-                pkgList.forEach {
712
-                    csdkManager?.AddAppWhiteRule(it)
724
+            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
725
+                if (ModelNameUtils.IS_LianxTB223FC()){
726
+                  try {
727
+                      pkgList.forEach {
728
+                          AfwUtils.jurisdiction(1,AfwUtils.getUUid(instance!!,it).toInt())
729
+                      }
730
+                  }catch (e:Exception){
731
+
732
+                  }
733
+                }else{
734
+                    pkgList.forEach {
735
+                        csdkManager?.AddAppWhiteRule(it)
736
+                    }
713
                 }
737
                 }
714
             }
738
             }
715
         }
739
         }
718
          * 移除网络应用白名单
742
          * 移除网络应用白名单
719
          */
743
          */
720
         fun clearAppWhiteRule() {
744
         fun clearAppWhiteRule() {
721
-            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()) {
722
-                csdkManager?.ClearAppRules()
723
-                //不移除自己和商店
724
-                csdkManager?.AddAppWhiteRule(Const.CURRENTAPPPKG)
725
-                csdkManager?.AddAppWhiteRule(Const.STOREAPPPKG)
726
-                csdkManager?.AddAppWhiteRule("com.lenovo.mia.setupwizard")
745
+            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
746
+                if (ModelNameUtils.IS_LianxTB223FC()){
747
+                    AfwUtils.clearAppRules()
748
+                }else{
749
+                    csdkManager?.ClearAppRules()
750
+                    //不移除自己和商店
751
+                    csdkManager?.AddAppWhiteRule(Const.CURRENTAPPPKG)
752
+                    csdkManager?.AddAppWhiteRule(Const.STOREAPPPKG)
753
+                    csdkManager?.AddAppWhiteRule("com.lenovo.mia.setupwizard")
754
+                }
727
             }
755
             }
728
         }
756
         }
729
 
757
 
732
          */
760
          */
733
         fun GetAppWhiteRules(): ArrayList<String> {
761
         fun GetAppWhiteRules(): ArrayList<String> {
734
             val appList = arrayListOf<String>()
762
             val appList = arrayListOf<String>()
735
-            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()) {
736
-                var appWhiteRules = csdkManager?.appWhiteRules
737
-                appWhiteRules?.let {
738
-                    appList.addAll(it)
763
+            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
764
+                if (ModelNameUtils.IS_LianxTB223FC()){
765
+                    AfwUtils.getNetAppWhiteList()
766
+                }else{
767
+                    val appWhiteRules = csdkManager?.appWhiteRules
768
+                    appWhiteRules?.let {
769
+                        appList.addAll(it)
770
+                    }
739
                 }
771
                 }
740
             }
772
             }
741
             return appList
773
             return appList
748
         fun setSleepTimeoutV3(time: Int = 1000 * 60 * 60) {
780
         fun setSleepTimeoutV3(time: Int = 1000 * 60 * 60) {
749
             if (ModelNameUtils.IS_LianxX505f()) {
781
             if (ModelNameUtils.IS_LianxX505f()) {
750
                 csdkManager?.setSleepTimeout_V3(time)
782
                 csdkManager?.setSleepTimeout_V3(time)
751
-            } else if (ModelNameUtils.IS_LianxX6e6f()) {
783
+            } else if (ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
752
                 csdkManager?.setSleepTimeoutV3(time)
784
                 csdkManager?.setSleepTimeoutV3(time)
753
             }
785
             }
754
         }
786
         }
757
          * 获得网址白名单
789
          * 获得网址白名单
758
          */
790
          */
759
         fun urlWhiteListRead(): List<String> {
791
         fun urlWhiteListRead(): List<String> {
760
-            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()) {
761
-                csdkManager?.urlWhiteListRead()?.let {
762
-                    return it
792
+            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
793
+                if (ModelNameUtils.IS_LianxTB223FC()){
794
+                    AfwUtils.getNetAppWhiteList()
795
+                }else{
796
+                    csdkManager?.urlWhiteListRead()?.let {
797
+                        return it
798
+                    }
763
                 }
799
                 }
764
             }
800
             }
765
             return arrayListOf()
801
             return arrayListOf()
766
         }
802
         }
767
 
803
 
768
-        /**
769
-         * 允许悬浮窗packageName: 应用的包名
770
-         * true:打开在其它应用的上层
771
-         * false:关闭在其它应用的上层
772
-         */
773
-        fun enableOverlayWindow(pkg: String = Const.CURRENTAPPPKG, enableFlag: Boolean = true) {
774
-            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()) {
775
-                csdkManager?.enableOverlayWindow(pkg, enableFlag)
776
-            }
777
-        }
778
 
804
 
779
         /**
805
         /**
780
          * 设置锁屏模式 0:取消解锁模式 1:滑动解锁
806
          * 设置锁屏模式 0:取消解锁模式 1:滑动解锁
781
          */
807
          */
782
         fun setLockScreenMode(enableFlag: Int = 0) {
808
         fun setLockScreenMode(enableFlag: Int = 0) {
783
-            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()) {
809
+            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
784
                 csdkManager?.setLockScreenMode(enableFlag)
810
                 csdkManager?.setLockScreenMode(enableFlag)
785
             }
811
             }
786
         }
812
         }
791
         fun setEnabledEyeMode(enableFlag: Boolean) {
817
         fun setEnabledEyeMode(enableFlag: Boolean) {
792
             if (ModelNameUtils.IS_LianxX505f()) {
818
             if (ModelNameUtils.IS_LianxX505f()) {
793
                 csdkManager?.setEnabledEyeMode(enableFlag)
819
                 csdkManager?.setEnabledEyeMode(enableFlag)
794
-            }else if (ModelNameUtils.IS_LianxX6e6f()){
820
+            }else if (ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()){
795
                 csdkManager?.setEnabledEyeMode(enableFlag)
821
                 csdkManager?.setEnabledEyeMode(enableFlag)
796
             }
822
             }
797
         }
823
         }
798
 
824
 
799
         //设置默认输入法
825
         //设置默认输入法
800
         fun setDefaultInputMethod(pkg: String="com.xhkjedu.pinyin/.PinyinIME"){
826
         fun setDefaultInputMethod(pkg: String="com.xhkjedu.pinyin/.PinyinIME"){
801
-            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()){
827
+            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()){
802
                 try {
828
                 try {
803
                     var defaultInputMethod = csdkManager?.setDefaultInputMethod(pkg)
829
                     var defaultInputMethod = csdkManager?.setDefaultInputMethod(pkg)
804
                     //Log.d("设置输入法","设置结果"+defaultInputMethod)
830
                     //Log.d("设置输入法","设置结果"+defaultInputMethod)
816
              try {
842
              try {
817
                  if (ModelNameUtils.IS_LianxX505f()){
843
                  if (ModelNameUtils.IS_LianxX505f()){
818
                      csdkManager?.customRecovery_v3=b
844
                      csdkManager?.customRecovery_v3=b
819
-                 }else if (ModelNameUtils.IS_LianxX6e6f()){
845
+                 }else if (ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()){
820
                      csdkManager?.isCustomRecoveryV3=b
846
                      csdkManager?.isCustomRecoveryV3=b
821
                  }
847
                  }
822
              }catch (e:Exception){
848
              }catch (e:Exception){
831
             try {
857
             try {
832
                 if (ModelNameUtils.IS_LianxX505f()){
858
                 if (ModelNameUtils.IS_LianxX505f()){
833
                     csdkManager?.disallowSetInputMethod_v3(pkgName,b)
859
                     csdkManager?.disallowSetInputMethod_v3(pkgName,b)
834
-                }else if (ModelNameUtils.IS_LianxX6e6f()){
860
+                }else if (ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()){
835
                     csdkManager?.disallowSetInputMethodV3(pkgName,b)
861
                     csdkManager?.disallowSetInputMethodV3(pkgName,b)
836
                 }
862
                 }
837
             }catch (e:Exception){
863
             }catch (e:Exception){
844
          * false:允许设备使用蓝牙分享
870
          * false:允许设备使用蓝牙分享
845
          */
871
          */
846
         fun disableBluetoothShare(b:Boolean=true){
872
         fun disableBluetoothShare(b:Boolean=true){
873
+            //TB223FC禁用蓝牙分享,会导致蓝牙无法打开,所以不限制
847
             try {
874
             try {
848
                 if (ModelNameUtils.IS_LianxX505f()){
875
                 if (ModelNameUtils.IS_LianxX505f()){
849
                     csdkManager?.disallowBluetoothShare_v3(b)
876
                     csdkManager?.disallowBluetoothShare_v3(b)
863
             try {
890
             try {
864
                 if (ModelNameUtils.IS_LianxX505f()){
891
                 if (ModelNameUtils.IS_LianxX505f()){
865
                     csdkManager?.disableStatusBarNotification(b)
892
                     csdkManager?.disableStatusBarNotification(b)
866
-                }else if (ModelNameUtils.IS_LianxX6e6f()){
893
+                }else if (ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()){
867
                     csdkManager?.disallowStatusBarNotification(b)
894
                     csdkManager?.disallowStatusBarNotification(b)
868
                 }
895
                 }
869
             }catch (e:Exception){
896
             }catch (e:Exception){
887
             val exitControlFlag =false
914
             val exitControlFlag =false
888
             Toaster.init(this)
915
             Toaster.init(this)
889
             DialogX.init(this)
916
             DialogX.init(this)
890
-            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()) {
917
+            if (ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
891
                 csdkManager = CSDKManager(this)
918
                 csdkManager = CSDKManager(this)
892
                 //允许运行时权限
919
                 //允许运行时权限
893
                 setDefaultInputMethod()
920
                 setDefaultInputMethod()

+ 1
- 1
app/src/main/java/com/xhly/manageapp/ui/main/activity/MainActivity.kt View File

403
                         val rxPermissions = RxPermissions(this@MainActivity)
403
                         val rxPermissions = RxPermissions(this@MainActivity)
404
                         rxPermissions.request(Manifest.permission.REQUEST_INSTALL_PACKAGES)
404
                         rxPermissions.request(Manifest.permission.REQUEST_INSTALL_PACKAGES)
405
                             .subscribe { granted ->
405
                             .subscribe { granted ->
406
-                                if (granted || ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()) {
406
+                                if (granted || ModelNameUtils.IS_LianxX505f() || ModelNameUtils.IS_LianxX6e6f()|| ModelNameUtils.IS_LianxTB223FC()) {
407
                                     // 权限已授予,执行安装操作
407
                                     // 权限已授予,执行安装操作
408
                                     val appList = AppUtils.GetAppList(this@MainActivity)
408
                                     val appList = AppUtils.GetAppList(this@MainActivity)
409
                                     getExternalFilesDir(null)?.let {
409
                                     getExternalFilesDir(null)?.let {

+ 121
- 18
app/src/main/java/com/xhly/manageapp/utils/AfwUtils.kt View File

53
         intent.putExtras(bundle)
53
         intent.putExtras(bundle)
54
         context.bindService(intent, mServiceConnection, Context.BIND_AUTO_CREATE)
54
         context.bindService(intent, mServiceConnection, Context.BIND_AUTO_CREATE)
55
     }
55
     }
56
-    //添加黑白名单
57
-    @Throws(java.lang.Exception::class)
58
-     fun jurisdiction(type: String, appUid: Int) {
59
-        if (type == "黑名单") {
60
-            if (iafwService != null) {
61
-                val afwRes = iafwService!!.addAppBlackRule(appUid.toString() + "")
62
-                Log.i(TAG, "addAppBlackRule result=" + afwRes.operationResult)
63
-            }
64
-        } else if (type == "白名单") {
65
-            if (iafwService != null) {
66
-                val afwRes = iafwService!!.addAppWhiteRule(appUid.toString() + "")
67
-                Log.i(TAG, "addAppWhiteRule result=" + afwRes.operationResult)
68
-            }
69
-        }
56
+
57
+    /**
58
+     * 添加黑白名单 0为黑名单,1为白名单
59
+     */
60
+     fun jurisdiction(type: Int=0, appUid: Int) {
61
+       try {
62
+           if (type == 0) {
63
+               //黑名单
64
+               if (iafwService != null) {
65
+                   val afwRes = iafwService!!.addAppBlackRule(appUid.toString() + "")
66
+                   Log.i(TAG, "addAppBlackRule result=" + afwRes.operationResult)
67
+               }
68
+           } else if (type == 1) {
69
+               //白名单
70
+               if (iafwService != null) {
71
+                   val afwRes = iafwService!!.addAppWhiteRule(appUid.toString() + "")
72
+                   Log.i(TAG, "addAppWhiteRule result=" + afwRes.operationResult)
73
+               }
74
+           }
75
+       }catch (e:Exception){
76
+
77
+       }
70
     }
78
     }
71
     fun getNetAppBlockList():String{
79
     fun getNetAppBlockList():String{
72
         val sb=StringBuffer()
80
         val sb=StringBuffer()
113
         return sb.toString()
121
         return sb.toString()
114
     }
122
     }
115
 
123
 
116
-    fun addUrLWhiteList(url:String){
124
+    /**
125
+     * 添加网址白名单
126
+     */
127
+    fun addUrLWhiteList(urlList:List<String>){
128
+        try {
129
+            if (iafwService != null) {
130
+                urlList.forEach {url->
131
+                    val afwRes = iafwService!!.addWhiteRule(url)
132
+                    Log.i(TAG, "setEnable=" + afwRes.operationResult)
133
+                }
134
+            } else {
135
+                Log.i(TAG, "iafwService=null")
136
+            }
137
+        } catch (e: java.lang.Exception) {
138
+            e.printStackTrace()
139
+            Log.e(TAG, e.toString())
140
+        }
141
+    }
142
+
143
+    /**
144
+     * 添加网址黑名单
145
+     */
146
+    fun addUrLBlackList(urlList:List<String>){
147
+        try {
148
+            if (iafwService != null) {
149
+               urlList.forEach {url->
150
+                   val afwRes = iafwService!!.addBlackRule(url)
151
+                   Log.i(TAG, "setEnable=" + afwRes.operationResult)
152
+               }
153
+            } else {
154
+                Log.i(TAG, "iafwService=null")
155
+            }
156
+        } catch (e: java.lang.Exception) {
157
+            e.printStackTrace()
158
+            Log.e(TAG, e.toString())
159
+        }
160
+    }
161
+
162
+    /**
163
+     * 清除APP网络规则
164
+     */
165
+    fun clearAppRules(){
117
         try {
166
         try {
118
             if (iafwService != null) {
167
             if (iafwService != null) {
119
-                val afwRes = iafwService!!.addWhiteRule(url)
168
+                val afwRes = iafwService!!.clearAppRules()
120
                 Log.i(TAG, "setEnable=" + afwRes.operationResult)
169
                 Log.i(TAG, "setEnable=" + afwRes.operationResult)
121
             } else {
170
             } else {
122
                 Log.i(TAG, "iafwService=null")
171
                 Log.i(TAG, "iafwService=null")
127
         }
176
         }
128
     }
177
     }
129
 
178
 
130
-    fun addUrLBlackList(url:String){
179
+    /**
180
+     * 清除IP和网址规则
181
+     */
182
+    fun clearIpHostRules(){
131
         try {
183
         try {
132
             if (iafwService != null) {
184
             if (iafwService != null) {
133
-                val afwRes = iafwService!!.addBlackRule(url)
185
+                val afwRes = iafwService!!.clearIpHostRules()
186
+                Log.i(TAG, "clearIpHostRules=" + afwRes.operationResult)
187
+            } else {
188
+                Log.i(TAG, "iafwService=null")
189
+            }
190
+        } catch (e: java.lang.Exception) {
191
+            e.printStackTrace()
192
+            Log.e(TAG, e.toString())
193
+        }
194
+    }
195
+
196
+    /**
197
+     * 清除所有规则
198
+     */
199
+    fun clearRules(){
200
+        try {
201
+            if (iafwService != null) {
202
+                val afwRes = iafwService!!.clearRules()
203
+                Log.i(TAG, "clearRules=" + afwRes.operationResult)
204
+            } else {
205
+                Log.i(TAG, "iafwService=null")
206
+            }
207
+        } catch (e: java.lang.Exception) {
208
+            e.printStackTrace()
209
+            Log.e(TAG, e.toString())
210
+        }
211
+    }
212
+
213
+    /**
214
+     * 打开防火墙开关
215
+     */
216
+    fun setEnable(enable: Boolean) {
217
+        try {
218
+            if (iafwService != null) {
219
+                val afwRes = iafwService!!.setEnable(enable)
134
                 Log.i(TAG, "setEnable=" + afwRes.operationResult)
220
                 Log.i(TAG, "setEnable=" + afwRes.operationResult)
135
             } else {
221
             } else {
136
                 Log.i(TAG, "iafwService=null")
222
                 Log.i(TAG, "iafwService=null")
141
         }
227
         }
142
     }
228
     }
143
 
229
 
230
+    /**
231
+     * 固化规则,将规则固化到系统,下次启动应用生效
232
+     */
233
+    fun writeToFile(){
234
+        try {
235
+            if (iafwService != null) {
236
+                val afwRes = iafwService!!.writeToFile()
237
+                Log.i(TAG, "WriteToFile=" + afwRes.operationResult)
238
+            } else {
239
+                Log.i(TAG, "iafwService=null")
240
+            }
241
+        } catch (e: java.lang.Exception) {
242
+            e.printStackTrace()
243
+            Log.e(TAG, e.toString())
244
+        }
245
+    }
246
+
144
     fun getUUid(context: Context,pkgName:String): String {
247
     fun getUUid(context: Context,pkgName:String): String {
145
         return try {
248
         return try {
146
             val packageManager: PackageManager = context.packageManager
249
             val packageManager: PackageManager = context.packageManager

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

244
     public fun setSchoolSetDevice(schoolDeviceSetBean: SchoolDeviceSetBean, appList: List<AppInfo>):ArrayList<AppInfo> {
244
     public fun setSchoolSetDevice(schoolDeviceSetBean: SchoolDeviceSetBean, appList: List<AppInfo>):ArrayList<AppInfo> {
245
         val dataList = arrayListOf<AppInfo>()
245
         val dataList = arrayListOf<AppInfo>()
246
         appList.forEach { appinfo ->
246
         appList.forEach { appinfo ->
247
-            if (ModelNameUtils.IS_LianxX505f()||ModelNameUtils.IS_LianxX6e6f()){
247
+            if (ModelNameUtils.IS_LianxX505f()||ModelNameUtils.IS_LianxX6e6f()||ModelNameUtils.IS_LianxTB223FC()){
248
                 //启用电话短信:1是0否
248
                 //启用电话短信:1是0否
249
                 if (schoolDeviceSetBean.simcard == 0 && (appinfo.packageName.equals(Const.ANDROIDPHONE) || appinfo.packageName.equals(Const.ANDROIDMMS))) {
249
                 if (schoolDeviceSetBean.simcard == 0 && (appinfo.packageName.equals(Const.ANDROIDPHONE) || appinfo.packageName.equals(Const.ANDROIDMMS))) {
250
                     return@forEach
250
                     return@forEach
470
 
470
 
471
     //初始化管控的默认规则 (x505f设置运行时权限默认打开,即使没有禁止安装应用也会导致应用无法安装)
471
     //初始化管控的默认规则 (x505f设置运行时权限默认打开,即使没有禁止安装应用也会导致应用无法安装)
472
     public fun initControlStrategy(loginSucess:Boolean=true){
472
     public fun initControlStrategy(loginSucess:Boolean=true){
473
-        if (ModelNameUtils.IS_LianxX505f()||ModelNameUtils.IS_LianxX6e6f()) {
473
+        if (ModelNameUtils.IS_LianxX505f()||ModelNameUtils.IS_LianxX6e6f()||ModelNameUtils.IS_LianxTB223FC()) {
474
             //是505f则执行
474
             //是505f则执行
475
             //启用网络白名单,需要处理,不能每次都清除之前的白名单所以默认只添加不移除,请求接口时才移除。目前登录成功才控制
475
             //启用网络白名单,需要处理,不能每次都清除之前的白名单所以默认只添加不移除,请求接口时才移除。目前登录成功才控制
476
             if (loginSucess){
476
             if (loginSucess){

+ 1
- 1
corelib/src/main/java/com/xhly/corelib/utils/ModelNameUtils.kt View File

9
 
9
 
10
         fun IS_LianxX6e6f(): Boolean{
10
         fun IS_LianxX6e6f(): Boolean{
11
             val systemModel: String = SystemUtil.getSystemModel()
11
             val systemModel: String = SystemUtil.getSystemModel()
12
-            return "Lenovo TB-X6E6F" == systemModel || IS_LianxTB223FC()
12
+            return "Lenovo TB-X6E6F" == systemModel
13
         }
13
         }
14
         fun IS_LianxTB223FC(): Boolean{
14
         fun IS_LianxTB223FC(): Boolean{
15
             val systemModel: String = SystemUtil.getSystemModel()
15
             val systemModel: String = SystemUtil.getSystemModel()

Loading…
Cancel
Save