diff --git a/app/src/main/kotlin/li/songe/gkd/data/GlobalRule.kt b/app/src/main/kotlin/li/songe/gkd/data/GlobalRule.kt index a02161f..3c53b45 100644 --- a/app/src/main/kotlin/li/songe/gkd/data/GlobalRule.kt +++ b/app/src/main/kotlin/li/songe/gkd/data/GlobalRule.kt @@ -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 diff --git a/app/src/main/kotlin/li/songe/gkd/data/SubsConfig.kt b/app/src/main/kotlin/li/songe/gkd/data/SubsConfig.kt index 25c50b7..4e994f6 100644 --- a/app/src/main/kotlin/li/songe/gkd/data/SubsConfig.kt +++ b/app/src/main/kotlin/li/songe/gkd/data/SubsConfig.kt @@ -85,8 +85,8 @@ data class ExcludeData( val appIds: Map, val activityIds: Set>, ) { - 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 {