mirror of
https://github.com/gkd-kit/gkd.git
synced 2024-11-16 03:32:38 +08:00
fix: can not exclude page when manual enable app
This commit is contained in:
parent
0806d14616
commit
f98daefbd0
|
@ -62,12 +62,14 @@ class GlobalRule(
|
|||
if (excludeData.excludeAppIds.contains(appId)) {
|
||||
return false
|
||||
}
|
||||
if (activityId != null && excludeData.activityIds.contains(appId to activityId)) {
|
||||
return false
|
||||
}
|
||||
if (excludeData.includeAppIds.contains(appId)) {
|
||||
activityId ?: return true
|
||||
val app = apps[appId] ?: return true
|
||||
// 规则自带页面的禁用
|
||||
return !app.excludeActivityIds.any { e -> e.startsWith(activityId) }
|
||||
} else if (activityId != null && excludeData.activityIds.contains(appId to activityId)) {
|
||||
return false
|
||||
}
|
||||
if (!matchLauncher && appId == launcherAppId) {
|
||||
return false
|
||||
|
|
|
@ -85,8 +85,8 @@ data class ExcludeData(
|
|||
val appIds: Map<String, Boolean>,
|
||||
val activityIds: Set<Pair<String, String>>,
|
||||
) {
|
||||
val excludeAppIds = appIds.entries.filter { e -> e.value }.map { e -> e.key }.toSet()
|
||||
val includeAppIds = appIds.entries.filter { e -> !e.value }.map { e -> e.key }.toSet()
|
||||
val excludeAppIds = appIds.entries.filter { e -> e.value }.map { e -> e.key }.toHashSet()
|
||||
val includeAppIds = appIds.entries.filter { e -> !e.value }.map { e -> e.key }.toHashSet()
|
||||
|
||||
companion object {
|
||||
fun parse(exclude: String?): ExcludeData {
|
||||
|
|
Loading…
Reference in New Issue
Block a user