mirror of
https://github.com/MetaCubeX/ClashMetaForAndroid.git
synced 2025-02-22 09:43:15 +03: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() {
|
private fun reload() {
|
||||||
val packages = service.packageManager.getInstalledPackages(0)
|
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)
|
Clash.notifyInstalledAppsChanged(packages)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user