|
@@ -115,7 +115,7 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>() {
|
115
|
115
|
}
|
116
|
116
|
ManageApplication.addAppWhiteRule(whiteList)
|
117
|
117
|
spUtils.saveJson(Const.APPSTOREKEY, appNameList)
|
118
|
|
- //获得应用集合,必装应用和推荐应用,再加上预装应用,其余应用需要静默卸载,必装应用需要进行静默下载和安装。安装应用从forceapp接口获取
|
|
118
|
+ //获得应用集合,必装应用和推荐应用,再加上预装应用(预装应用直接隐藏),其余应用需要静默卸载,必装应用需要进行静默下载和安装。安装应用从forceapp接口获取
|
119
|
119
|
val appList = AppUtils.GetAppList(this)
|
120
|
120
|
val firstAppList = arrayListOf<String>()
|
121
|
121
|
try {
|
|
@@ -729,6 +729,29 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>() {
|
729
|
729
|
dataList.clear()
|
730
|
730
|
var appList = AppUtils.GetAppList(this)
|
731
|
731
|
appList.addAll(CustomAppUtils().getCustomAppList(this))
|
|
732
|
+ //获得预装应用直接隐藏
|
|
733
|
+ try {
|
|
734
|
+ //获得预装应用的包名
|
|
735
|
+ val currentList =
|
|
736
|
+ currentSpUtils.getFromJson(
|
|
737
|
+ Const.FIRSTAPPLIST,
|
|
738
|
+ ArrayList<String>().javaClass
|
|
739
|
+ ) as ArrayList<String>
|
|
740
|
+ val removeList= arrayListOf<AppInfo>()
|
|
741
|
+ currentList.forEach {pkg->
|
|
742
|
+ //学校控制之外的预装应用加入移除集合
|
|
743
|
+ if (!Const.schoolSetAppList.contains(pkg)){
|
|
744
|
+ appList.filter { it.packageName==pkg }.forEach {
|
|
745
|
+ removeList.add(it)
|
|
746
|
+ }
|
|
747
|
+ }
|
|
748
|
+ }
|
|
749
|
+ //移除学校控制之外预装应用
|
|
750
|
+ appList.removeAll(removeList)
|
|
751
|
+ } catch (e: Exception) {
|
|
752
|
+
|
|
753
|
+ }
|
|
754
|
+ //获得学校设置,设置应用显示(部分回合预装重合,由学校设置判断是否显示)
|
732
|
755
|
if (schoolDeviceSetBean != null) {
|
733
|
756
|
appList = StrategyUtils.setSchoolSetDevice(schoolDeviceSetBean, appList)
|
734
|
757
|
}
|