Browse Source

1.添加解除管控功能

20241218TB223FC(测试jar包)
wangwanlei 1 year ago
parent
commit
0a1dae49aa

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

@@ -516,6 +516,7 @@ class ManageApplication : MultiDexApplication() {
516 516
             disableStatusBarPanel(true)
517 517
             hideHomeSoftKey(true)
518 518
             hideMenuSoftKey(true)
519
+            disallowWifi(true)
519 520
             enableAccessibility()
520 521
             setCustomLauncher(
521 522
                 "com.xhly.manageapp",

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

@@ -238,6 +238,7 @@ class LoginActivity : BaseActivity<LoginViewModel, ActivityLoginBinding>() {
238 238
 
239 239
             Const.CODE2007.toString() -> {
240 240
                 postLogPush(7)
241
+                StrategyUtils.releaseControl()
241 242
             }
242 243
 
243 244
             Const.SDINSTALL -> {

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

@@ -573,7 +573,7 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>() {
573 573
 
574 574
             Const.CODE2007.toString() -> {
575 575
                 postLogPush(7)
576
-
576
+                StrategyUtils.releaseControl()
577 577
             }
578 578
 
579 579
             Const.LOGAPPSTART -> {

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

@@ -325,4 +325,36 @@ object StrategyUtils {
325 325
 
326 326
         }
327 327
     }
328
+
329
+    /**
330
+     * 解除管控
331
+     */
332
+    public fun releaseControl(){
333
+          try {
334
+              //允许截屏
335
+              ManageApplication.enableCaptureScreen(true)
336
+              //解除状态栏管理
337
+              ManageApplication.disableStatusBarPanel(false)
338
+              //允许安装app
339
+              ManageApplication.disableInstallation(false)
340
+              //取消相机禁用
341
+              ManageApplication.disableCamera(false)
342
+              //显示底部虚拟键
343
+              ManageApplication.hideHomeSoftKey(false)
344
+              ManageApplication.hideMenuSoftKey(false)
345
+              //允许截屏
346
+              ManageApplication.enableCaptureScreen(true)
347
+              //允许操作wifi
348
+              ManageApplication.disallowWifi(false)
349
+              ManageApplication.disallowWifiAdvanceSettings(false)
350
+              //允许sd卡
351
+              ManageApplication.enableMassStorage(true)
352
+              //允许OTG
353
+              ManageApplication.setCustomOTG(true)
354
+              //设置默认启动器
355
+              ManageApplication.setCustomLauncher("com.tblenovo.launcher","com.android.iotlauncher.IotLauncher")
356
+          }catch (e:Exception){
357
+
358
+          }
359
+    }
328 360
 }

Loading…
Cancel
Save