Skip to content
Snippets Groups Projects
Commit e6859ff5 authored by kr328's avatar kr328
Browse files

Fix: use package if only single app in sharedUid group

parent f16b0048
No related branches found
No related tags found
No related merge requests found
......@@ -15,7 +15,19 @@ class AppListCacheModule(service: Service) : Module<Unit>(service) {
private fun reload() {
val packages = service.packageManager.getInstalledPackages(0)
.map { it.applicationInfo.uid to it.uniqueUidName() }
.groupBy { it.uniqueUidName() }
.map { (_, v) ->
val info = v[0]
if (v.size == 1) {
// Force use package name if only one app in a single sharedUid group
// Example: firefox
info.applicationInfo.uid to info.packageName
} else {
info.applicationInfo.uid to info.uniqueUidName()
}
}
Clash.notifyInstalledAppsChanged(packages)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment