Browse Source

1.上传已安装应用时,应用商店列表内的应用不排除在外(即使它记录在预装应用)。

20241218TB223FC(测试jar包)
wangwanlei 7 months ago
parent
commit
a68d8f7d2c

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

@@ -905,6 +905,7 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>(),Download
905 905
         try {
906 906
             //获得已安装应用列表
907 907
             val appList = AppUtils.GetAllAppList(this)
908
+            getAppStoreList()
908 909
             try {
909 910
                 //获得预装应用的包名
910 911
                 val currentList =
@@ -915,7 +916,8 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>(),Download
915 916
                 val removeList = arrayListOf<AppInfo>()
916 917
                 currentList.forEach { pkg ->
917 918
                     //除了管控之类的我们的app之外的预装都不在统计范围
918
-                    if (Const.CURRENTAPPPKG != pkg && Const.STOREAPPPKG != pkg) {
919
+                    val filter = appStroeList.filter { it.appPackage == pkg }
920
+                    if (Const.CURRENTAPPPKG != pkg && Const.STOREAPPPKG != pkg &&filter.size==0) {
919 921
                         appList.filter { it.packageName == pkg }.forEach {
920 922
                             removeList.add(it)
921 923
                         }

Loading…
Cancel
Save