mirror of
https://github.com/MetaCubeX/ClashMetaForAndroid.git
synced 2024-11-16 13:32:37 +08:00
Fix: use package if only single app in sharedUid group
This commit is contained in:
parent
f16b0048f3
commit
e6859ff56d
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user