feat: add IFW rule editor UI for per-component intent filtering#1498
Merged
feat: add IFW rule editor UI for per-component intent filtering#1498
Conversation
…rule flow Adds a new top-level navigation tab for viewing and managing all IFW rules on the device. Includes rule list grouped by package, delete with confirmation, and an add-rule screen with condition editor.
… and edit rule flow
…ponent names, add transition animation, translate Block to 阻止
Change-Id: I95b5c309cb4a2adf48cc047962e738619fb7133e
Change-Id: I3f8fe5c2326d0bca14798fef751c8a5a4b23de03
Change-Id: I70740d09ae9fb52d8226e51fce9f637c112e78b3
...ifwrule/impl/src/main/kotlin/com/merxury/blocker/feature/globalifwrule/impl/AddRuleScreen.kt
Fixed
Show fixed
Hide fixed
...e/impl/src/main/kotlin/com/merxury/blocker/feature/globalifwrule/impl/GlobalIfwRuleScreen.kt
Fixed
Show fixed
Hide fixed
...e/impl/src/main/kotlin/com/merxury/blocker/feature/globalifwrule/impl/GlobalIfwRuleScreen.kt
Fixed
Show fixed
Hide fixed
...e/impl/src/main/kotlin/com/merxury/blocker/feature/globalifwrule/impl/GlobalIfwRuleScreen.kt
Fixed
Show fixed
Hide fixed
...e/impl/src/main/kotlin/com/merxury/blocker/feature/globalifwrule/impl/GlobalIfwRuleScreen.kt
Fixed
Show fixed
Hide fixed
Change-Id: I871aa52fddb35740dfae2fe0e4fda6ab54a072f3
Change-Id: Icb245523621a5384e71bdd33ad6095c74b18ed46
Change-Id: I7e5d46a4473784ad5c9d8555307c7d787b167f25
There was a problem hiding this comment.
Android Lint found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
- Fix toTopLevelFilters() to always wrap root group as single filter, preventing ALL-mode conditions from being incorrectly OR'd by IFW - Simplify per-component toIfwFilter() to use toIfwFilterOrNull() directly - Replace FQN references in AddRuleScreen SwitchRow with proper imports - Update test expectation for nested And structure
… toolbar - Split IfwRuleTreeEditor.kt (732 lines) into 5 focused files in ifwruleeditor sub-package - Fix critical IFW semantic bug: top-level filters in a rule are OR'd (not AND'd). toEditorRootGroup() now defaults to ANY mode, matching IFW behavior. Per-component editor correctly uses ALL for filters extracted from And wrappers - Move save button from bottom to toolbar (check icon) in both IfwRuleEditorScreen and AddRuleScreen - Add unsaved changes confirmation dialog on back navigation - Add app icon to Firewall page package headers - Fix FQN reference in IfwRuleEditorScreen
Change-Id: I9cae42be44b33d9d7ad3785a86b380d76af89d89
Change-Id: I741ce05436b36e6cfeef925f0c6c894e3f3cf083
juliewww
reviewed
Mar 18, 2026
core/ui/src/main/kotlin/com/merxury/blocker/core/ui/ifwruleeditor/ConditionEditorCard.kt
Outdated
Show resolved
Hide resolved
juliewww
reviewed
Mar 18, 2026
core/ui/src/main/kotlin/com/merxury/blocker/core/ui/ifwruleeditor/GroupEditorCard.kt
Outdated
Show resolved
Hide resolved
juliewww
reviewed
Mar 18, 2026
...ifwrule/impl/src/main/kotlin/com/merxury/blocker/feature/globalifwrule/impl/AddRuleScreen.kt
Outdated
Show resolved
Hide resolved
juliewww
reviewed
Mar 18, 2026
...ifwrule/impl/src/main/kotlin/com/merxury/blocker/feature/globalifwrule/impl/AddRuleScreen.kt
Outdated
Show resolved
Hide resolved
juliewww
reviewed
Mar 18, 2026
...ifwrule/impl/src/main/kotlin/com/merxury/blocker/feature/globalifwrule/impl/AddRuleScreen.kt
Outdated
Show resolved
Hide resolved
juliewww
reviewed
Mar 18, 2026
...ifwrule/impl/src/main/kotlin/com/merxury/blocker/feature/globalifwrule/impl/AddRuleScreen.kt
Outdated
Show resolved
Hide resolved
juliewww
reviewed
Mar 18, 2026
...e/impl/src/main/kotlin/com/merxury/blocker/feature/globalifwrule/impl/GlobalIfwRuleScreen.kt
Outdated
Show resolved
Hide resolved
juliewww
reviewed
Mar 18, 2026
...e/impl/src/main/kotlin/com/merxury/blocker/feature/globalifwrule/impl/GlobalIfwRuleScreen.kt
Outdated
Show resolved
Hide resolved
juliewww
reviewed
Mar 18, 2026
...mpl/src/main/kotlin/com/merxury/blocker/feature/globalifwrule/impl/GlobalIfwRuleViewModel.kt
Show resolved
Hide resolved
juliewww
reviewed
Mar 18, 2026
...mpl/src/main/kotlin/com/merxury/blocker/feature/globalifwrule/impl/GlobalIfwRuleViewModel.kt
Outdated
Show resolved
Hide resolved
juliewww
reviewed
Mar 18, 2026
...mpl/src/main/kotlin/com/merxury/blocker/feature/globalifwrule/impl/GlobalIfwRuleViewModel.kt
Show resolved
Hide resolved
juliewww
reviewed
Mar 18, 2026
...mpl/src/main/kotlin/com/merxury/blocker/feature/globalifwrule/impl/GlobalIfwRuleViewModel.kt
Outdated
Show resolved
Hide resolved
juliewww
reviewed
Mar 18, 2026
...ule/impl/src/main/kotlin/com/merxury/blocker/feature/ifwrule/impl/model/RuleEditorUiState.kt
Outdated
Show resolved
Hide resolved
juliewww
reviewed
Mar 18, 2026
...ifwrule/impl/src/main/kotlin/com/merxury/blocker/feature/ifwrule/impl/IfwRuleEditorScreen.kt
Outdated
Show resolved
Hide resolved
juliewww
reviewed
Mar 18, 2026
...ifwrule/impl/src/main/kotlin/com/merxury/blocker/feature/ifwrule/impl/IfwRuleEditorScreen.kt
Outdated
Show resolved
Hide resolved
juliewww
reviewed
Mar 18, 2026
...ifwrule/impl/src/main/kotlin/com/merxury/blocker/feature/ifwrule/impl/IfwRuleEditorScreen.kt
Outdated
Show resolved
Hide resolved
juliewww
reviewed
Mar 18, 2026
...ifwrule/impl/src/main/kotlin/com/merxury/blocker/feature/ifwrule/impl/IfwRuleEditorScreen.kt
Outdated
Show resolved
Hide resolved
juliewww
reviewed
Mar 18, 2026
...ifwrule/impl/src/main/kotlin/com/merxury/blocker/feature/ifwrule/impl/IfwRuleEditorScreen.kt
Outdated
Show resolved
Hide resolved
juliewww
reviewed
Mar 18, 2026
...ifwrule/impl/src/main/kotlin/com/merxury/blocker/feature/ifwrule/impl/IfwRuleEditorScreen.kt
Outdated
Show resolved
Hide resolved
juliewww
reviewed
Mar 18, 2026
...ifwrule/impl/src/main/kotlin/com/merxury/blocker/feature/ifwrule/impl/IfwRuleEditorScreen.kt
Outdated
Show resolved
Hide resolved
juliewww
reviewed
Mar 18, 2026
...ifwrule/impl/src/main/kotlin/com/merxury/blocker/feature/ifwrule/impl/IfwRuleEditorScreen.kt
Outdated
Show resolved
Hide resolved
juliewww
reviewed
Mar 18, 2026
...rule/impl/src/main/kotlin/com/merxury/blocker/feature/ifwrule/impl/IfwRuleEditorViewModel.kt
Show resolved
Hide resolved
juliewww
reviewed
Mar 18, 2026
...rule/impl/src/main/kotlin/com/merxury/blocker/feature/ifwrule/impl/IfwRuleEditorViewModel.kt
Show resolved
Hide resolved
juliewww
reviewed
Mar 18, 2026
...rule/impl/src/main/kotlin/com/merxury/blocker/feature/ifwrule/impl/IfwRuleEditorViewModel.kt
Show resolved
Hide resolved
Collaborator
|
Find an issue: Every time I open the Firewall screen, it will reload even though it's empty |
Change-Id: I4d6d3f21f2ea9d7dcfcdc33453baad3f819e8109
Change-Id: Iabf8b1d96c223cd67fe5db5f1401d6ebaf5d24b5
Change-Id: I5fcd8482b820b48acab46ac35c72d8dfcf4281e8
Change-Id: I70360b3f28d4e287f98dc3f653a3cc2d5341ae30
lihenggui
commented
Mar 18, 2026
...ifwrule/impl/src/main/kotlin/com/merxury/blocker/feature/ifwrule/impl/IfwRuleEditorScreen.kt
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
feature:ifwrulemodule (api + impl) with per-component IFW rule editor screenIfwRuleUiMapper) converts between UI state andIfwRulesdomain modelIfwRuleper component for independent block/log settingsDepends on #1497 (IFW full parameter support)
Test plan