Modify change the judgment logic when fetched installed packages list is empty in FrameworkHooker

This commit is contained in:
2023-01-22 14:11:05 +08:00
parent 59f5b27d19
commit 37af877a7d

View File

@@ -244,6 +244,7 @@ object FrameworkHooker : YukiBaseHooker() {
.filter { it.packageName.let { e -> e != "android" && e != BuildConfig.APPLICATION_ID } }
.let { info ->
arrayListOf<AppInfoBean>().apply {
if (info.isNotEmpty())
(if (filters.name.isNotBlank()) info.filter {
it.packageName.contains(filters.name) || context.appNameOf(it.packageName).contains(filters.name)
} else info).let { result ->
@@ -259,7 +260,8 @@ object FrameworkHooker : YukiBaseHooker() {
}
}.sortedByDescending { it.lastUpdateTime }
.forEach { add(AppInfoBean(name = context.appNameOf(it.packageName), packageName = it.packageName)) }
}.apply { if (size <= 0) loggerW(msg = "Fetched installed packages but got empty list") }
else loggerW(msg = "Fetched installed packages but got empty list")
}
}
} ?: arrayListOf()
}