mirror of
https://github.com/KitsunePie/AppErrorsTracking.git
synced 2025-09-04 02:05:16 +08:00
Modify ignored "android" package name when getting app list data in FrameworkHooker
This commit is contained in:
@@ -235,19 +235,20 @@ object FrameworkHooker : YukiBaseHooker() {
|
|||||||
}
|
}
|
||||||
onPushAppListData { filters ->
|
onPushAppListData { filters ->
|
||||||
appContext?.let { context ->
|
appContext?.let { context ->
|
||||||
arrayListOf<AppInfoBean>().apply {
|
context.listOfPackages()
|
||||||
context.listOfPackages().filter { it.packageName != BuildConfig.APPLICATION_ID }.also { info ->
|
.filter { it.packageName.let { e -> e != "android" && e != BuildConfig.APPLICATION_ID } }
|
||||||
(if (filters.name.isNotBlank()) info.filter {
|
.let { info ->
|
||||||
it.packageName.contains(filters.name) || context.appNameOf(it.packageName).contains(filters.name)
|
arrayListOf<AppInfoBean>().apply {
|
||||||
} else info).let { result ->
|
(if (filters.name.isNotBlank()) info.filter {
|
||||||
if (filters.isContainsSystem.not())
|
it.packageName.contains(filters.name) || context.appNameOf(it.packageName).contains(filters.name)
|
||||||
result.filter { (it.applicationInfo.flags and ApplicationInfo.FLAG_SYSTEM) == 0 }
|
} else info).let { result ->
|
||||||
else result
|
if (filters.isContainsSystem.not())
|
||||||
}.sortedByDescending { it.lastUpdateTime }
|
result.filter { (it.applicationInfo.flags and ApplicationInfo.FLAG_SYSTEM) == 0 }
|
||||||
.forEach { add(AppInfoBean(name = context.appNameOf(it.packageName), packageName = it.packageName)) }
|
else result
|
||||||
|
}.sortedByDescending { it.lastUpdateTime }
|
||||||
|
.forEach { add(AppInfoBean(name = context.appNameOf(it.packageName), packageName = it.packageName)) }
|
||||||
|
}.apply { loggerD(msg = "Fetched installed packages list, size $size") }
|
||||||
}
|
}
|
||||||
loggerD(msg = "Fetched installed packages list, size $size")
|
|
||||||
}
|
|
||||||
} ?: arrayListOf()
|
} ?: arrayListOf()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user