Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

excludeSystemApps seems broken #42

Open
builtbybrayne opened this issue Nov 26, 2024 · 2 comments
Open

excludeSystemApps seems broken #42

builtbybrayne opened this issue Nov 26, 2024 · 2 comments

Comments

@builtbybrayne
Copy link

builtbybrayne commented Nov 26, 2024

Previously worked fine (1.3.1) but now (1.5.2) hides apps like YouTube and Chrome.

I can still find them by setting excludeSystemApps=false. But then I have all the noise of the random system stuff.

What changed and how can I continue with the previous logic of including the user-facing system apps but excluding the under-the-hood apps?

@builtbybrayne
Copy link
Author

builtbybrayne commented Nov 26, 2024

I suspect this change may be related?

/android/src/main/kotlin/com/sharmadhiraj/installed_apps/InstalledAppsPlugin.kt

     private fun isSystemApp(packageManager: PackageManager, packageName: String): Boolean {
-        return packageManager.getLaunchIntentForPackage(packageName) == null
+        return try {
+            val ai = packageManager.getApplicationInfo(packageName, 0)
+            (ai.flags and ApplicationInfo.FLAG_SYSTEM) != 0
+        } catch (e: PackageManager.NameNotFoundException) {
+            e.printStackTrace()
+            false
+        }
      #}

@builtbybrayne
Copy link
Author

Perhaps add an 'excludeUnlaunchable'?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant