Browse Source

1.x505f机型添加新的应用禁用。

20241218TB223FC(测试jar包)
wangwanlei 2 months ago
parent
commit
f8e1b13511

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

@@ -137,7 +137,7 @@ class ManageApplication : MultiDexApplication() {
137 137
                     csdkManager?.setPackageEnabled(pkg, enableFlag)
138 138
                 }
139 139
             }catch (e:Exception){
140
-
140
+             Log.d("问题是","应用冻结=="+e.toString())
141 141
             }
142 142
         }
143 143
 
@@ -844,7 +844,7 @@ class ManageApplication : MultiDexApplication() {
844 844
         }
845 845
 
846 846
         /**
847
-         * 禁用谷歌输入法
847
+         * 禁用谷歌输入法,未使用这个方法直接使用应用冻结禁用了
848 848
          */
849 849
         fun disallowSetInputMethod_v3(pkgName:String="com.google.android.inputmethod.pinyin",b: Boolean=false){
850 850
             try {
@@ -857,6 +857,38 @@ class ManageApplication : MultiDexApplication() {
857 857
                 Log.d("问题==","禁用recovery模式,"+e.toString())
858 858
             }
859 859
         }
860
+
861
+        /**
862
+         * true:禁止设备使用蓝牙分享
863
+         * false:允许设备使用蓝牙分享
864
+         */
865
+        fun disableBluetoothShare(b:Boolean=true){
866
+            try {
867
+                if (ModelNameUtils.IS_LianxX505f()){
868
+                    csdkManager?.disallowBluetoothShare_v3(b)
869
+                }else if (ModelNameUtils.IS_LianxX6e6f()){
870
+                    csdkManager?.disallowBluetoothV3(b)
871
+                }
872
+            }catch (e:Exception){
873
+                Log.d("问题==","disableBluetoothShare,"+e.toString())
874
+            }
875
+        }
876
+        /**
877
+         * 禁用状态栏通知,
878
+         * true:禁止状态栏通知
879
+         * false:启用状态栏通知
880
+         */
881
+        fun disableStatusBarNotification(b:Boolean=true){
882
+            try {
883
+                if (ModelNameUtils.IS_LianxX505f()){
884
+                    csdkManager?.disableStatusBarNotification(b)
885
+                }else if (ModelNameUtils.IS_LianxX6e6f()){
886
+                    csdkManager?.disallowStatusBarNotification(b)
887
+                }
888
+            }catch (e:Exception){
889
+                Log.d("问题==","disableStatusBarNotification,"+e.toString())
890
+            }
891
+        }
860 892
     }
861 893
 
862 894
     override fun onCreate() {

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

@@ -396,11 +396,13 @@ object StrategyUtils {
396 396
               ManageApplication.setLockScreenMode(1)
397 397
               //关闭运行时权限
398 398
               ManageApplication.setRuntimePermissions(false)
399
+              //允许蓝牙分享
400
+              ManageApplication.disableBluetoothShare(false)
399 401
               //未知来源
400 402
               ManageApplication.enableAllUnkownsourcesV3(false)
401 403
               //X505F默认应用解除应用冻结
402
-              Const.X505FBANAPPLIST.forEach {
403
-                  if (ModelNameUtils.IS_LianxX505f()){
404
+              if (ModelNameUtils.IS_LianxX505f()){
405
+                  Const.X505FBANAPPLIST.forEach {
404 406
                       ManageApplication.setPackageEnabled(it,true)
405 407
                   }
406 408
               }
@@ -464,11 +466,13 @@ object StrategyUtils {
464 466
             ManageApplication.hideMenuSoftKey(true)
465 467
             ManageApplication.enableAccessibility()
466 468
             ManageApplication.setLockScreenMode()
469
+            //禁用蓝牙分享
470
+            ManageApplication.disableBluetoothShare()
467 471
             //冻结默认启动器
468 472
             ManageApplication.setPackageEnabled("com.tblenovo.launcher",false)
469 473
             //X505F冻结默认应用
470
-            Const.X505FBANAPPLIST.forEach {
471
-                if (ModelNameUtils.IS_LianxX505f()){
474
+            if (ModelNameUtils.IS_LianxX505f()){
475
+                Const.X505FBANAPPLIST.forEach {
472 476
                     ManageApplication.setPackageEnabled(it,false)
473 477
                 }
474 478
             }

+ 36
- 1
corelib/src/main/java/com/xhly/corelib/Const.kt View File

@@ -326,12 +326,47 @@ object Const {
326 326
 
327 327
     const val X505INPUT="com.google.android.inputmethod.pinyin"
328 328
 
329
+    const val X505FEMAIL="com.android.email"
330
+
331
+    const val X505FMUSIC="com.android.music"
332
+
333
+    const val X505FAPPSTORE="com.lenovo.leos.appstore.pad"
334
+
335
+    const val X505FOFFICEHUB="com.microsoft.office.officehub"
336
+
337
+    const val X505FONENOTE="com.microsoft.office.onenote"
338
+
339
+    const val X505FWANTJOIN="com.android.wantjoin.settings"
340
+
341
+    const val X505FDOLBY="com.dolby.daxappui"
342
+
343
+    const val X505FFMRADIO="com.caf.fmradio"
344
+
345
+    const val X505FFILES="com.google.android.apps.nbu.files"
346
+
347
+     const val X505FTAB_M10_HD="com.lenovo.tab_m10_hd"
348
+
349
+    const val X505FLENOVOTIPS="com.tblenovo.lenovotips"
350
+
329 351
     /**
330 352
      * x505f 默认冻结的应用,解除管控时解除
331 353
      */
332 354
     val X505FBANAPPLIST= arrayListOf(
333 355
         ANDROIDCALENDAR,
334
-        BINGINTLX505F
356
+        BINGINTLX505F,
357
+        X505INPUT,
358
+        X505FEMAIL,
359
+        X505FMUSIC,
360
+        X505FAPPSTORE,
361
+        X505FOFFICEHUB,
362
+        X505FONENOTE,
363
+        ANDROIDRECORDER,
364
+        X505FWANTJOIN,
365
+        X505FDOLBY,
366
+        X505FFMRADIO,
367
+        X505FFILES,
368
+        X505FTAB_M10_HD,
369
+        X505FLENOVOTIPS
335 370
     )
336 371
 
337 372
     /**

Loading…
Cancel
Save