feat(ifw): Add full AOSP Intent Firewall parameter support#1497
Merged
feat(ifw): Add full AOSP Intent Firewall parameter support#1497
Conversation
lihenggui
commented
Mar 14, 2026
core/ifw-api/src/main/kotlin/com/merxury/core/ifw/model/IfwRule.kt
Outdated
Show resolved
Hide resolved
lihenggui
commented
Mar 14, 2026
core/ifw-api/src/main/kotlin/com/merxury/core/ifw/xml/IfwXmlDeserializer.kt
Show resolved
Hide resolved
lihenggui
commented
Mar 14, 2026
core/ifw-api/src/main/kotlin/com/merxury/core/ifw/xml/IfwXmlSerializer.kt
Show resolved
Hide resolved
lihenggui
commented
Mar 14, 2026
core/ifw-api/src/main/kotlin/com/merxury/core/ifw/xml/IfwXmlSerializer.kt
Outdated
Show resolved
Hide resolved
lihenggui
commented
Mar 14, 2026
core/ifw-api/src/main/kotlin/com/merxury/core/ifw/xml/IfwXmlSerializer.kt
Outdated
Show resolved
Hide resolved
lihenggui
commented
Mar 14, 2026
core/ifw-api/src/main/kotlin/com/merxury/core/ifw/IntentFirewall.kt
Outdated
Show resolved
Hide resolved
lihenggui
commented
Mar 14, 2026
core/testing/src/main/kotlin/com/merxury/blocker/core/testing/controller/FakeIntentFirewall.kt
Outdated
Show resolved
Hide resolved
lihenggui
commented
Mar 14, 2026
core/ifw-api/src/test/kotlin/com/merxury/core/ifw/IntentFirewallNewModelTest.kt
Outdated
Show resolved
Hide resolved
lihenggui
added a commit
that referenced
this pull request
Mar 14, 2026
Changes based on PR #1497 review feedback: 1. log default → true (IfwRule, IfwXmlDeserializer) 2. Remove fully qualified names in IfwXmlSerializer (use import alias) 3. DI for IfwXmlSerializer/IfwXmlDeserializer via constructor injection 4. Unified interface: rename add/remove → addComponentFilter/removeComponentFilter 5. Remove dual rules - single IfwRules cache, delete old IfwEntity.kt 6. Rename "legacy" → "component-filter only" in test naming 7. Remove xmlutil/kotlinx-serialization dependencies from ifw-api 8. Migrate ImportIfwRulesWorker to use IfwXmlDeserializer
57ee2f2 to
793ffc9
Compare
Redesign core:ifw-api to support all 18 AOSP IntentFirewall filter types
using a type-safe sealed class domain model with a separate XML
serialization layer.
Domain model (com.merxury.core.ifw.model):
- IfwFilter: sealed interface with all filter types
- Composite: And, Or, Not
- String-based (10 types × 6 matching modes): Action, Component,
ComponentName, ComponentPackage, Data, Host, MimeType, Scheme,
SchemeSpecificPart, Path
- StringMatcher: Equals, StartsWith, Contains, Pattern, Regex, IsNull
- Special: Category, Port, Sender, SenderPackage, SenderPermission
- Legacy: ComponentFilter
- IfwRule/IfwRules with configurable block/log attributes
XML serialization layer (com.merxury.core.ifw.xml):
- IfwXmlSerializer/IfwXmlDeserializer (XmlPullParser-based)
- IfwXmlConstants for all AOSP XML tag/attribute names
- Full backward compatibility with existing component-filter XML
Interface redesign:
- Unified IIntentFirewall: getRules/saveRules as core API,
addComponentFilter/removeComponentFilter as convenience methods
- Single IfwRules cache (removed old dual-model approach)
- DI for serializer/deserializer via constructor injection
- Removed xmlutil/kotlinx-serialization dependencies
- Deleted old IfwEntity.kt
- Migrated ImportIfwRulesWorker to new deserializer
793ffc9 to
2bceaaa
Compare
7 tasks
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
core:ifw-apimodule with type-safe sealed class domain model supporting all 18 AOSP IntentFirewall filter typesXmlPullParser(decoupled from domain model)IIntentFirewallinterface withgetRules/saveRulesfor the new domain model while preserving full backward compatibilityNew Domain Model (
com.merxury.core.ifw.model)And,Or,NotAction,Component,ComponentName,ComponentPackage,Data,Host,MimeType,Scheme,SchemeSpecificPart,PathEquals,StartsWith,Contains,Pattern,Regex,IsNullCategory,Port(exact/range),Sender(signature/system/userId),SenderPackage,SenderPermissionComponentFilter(backward compat)block/logattributes now configurable per ruleArchitecture
Test plan