Skip to content

feat: surface allow/bypass reason in connection log bottomsheet#2833

Open
mvanhorn wants to merge 1 commit into
celzero:mainfrom
mvanhorn:feat/2815-firewall-log-allow-reason
Open

feat: surface allow/bypass reason in connection log bottomsheet#2833
mvanhorn wants to merge 1 commit into
celzero:mainfrom
mvanhorn:feat/2815-firewall-log-allow-reason

Conversation

@mvanhorn

Copy link
Copy Markdown
Contributor

Summary

The Network connection-log bottomsheet now shows why a connection was allowed when a trust or bypass rule (isolated, trusted, or bypassed app/IP/domain) took precedence over universal or app block rules. A small reason row appears under the connection summary; it stays hidden for blocked and normally-allowed connections.

Why this matters

In #2815 a user reported that with "Block all apps when device is locked" active, connections from isolated or trusted apps and domains were still permitted, which looked like a bug. The maintainer confirmed this is intended (bypass/trust rules take precedence) and proposed surfacing the reason in the connection-log bottomsheet. This change adds that transparency without altering any firewall behavior.

What changed

  • FirewallRuleset.getAllowReason(ruleId) returns the matched rule only when it is an allow-acting bypass rule (act == allow and isBypassRule), else null, so unmapped or block rules show nothing.
  • ConnTrackerBottomSheet.updateAllowReason() renders the reason via the existing rule title into a new bs_conn_allow_reason_text row, hidden when the connection is blocked or no bypass rule applied.
  • Added the bs_conn_allow_reason_text TextView (gone by default) to bottom_sheet_conn_track.xml and the bsct_allow_reason string.

Testing

Local Android SDK is not available in this environment, so a full Gradle build was not run. Validated the layout and strings XML for well-formedness, confirmed the new symbols are wired to call sites, and checked the allow-over-block, isolate/trusted, normally-blocked (row hidden), and unmapped-rule (graceful fallback) paths by inspection.

Fixes #2815

Show why an allowed connection bypassed existing block rules (isolated,
trusted, or bypassed app/IP/domain) in the Network log bottomsheet, so an
intended allow-over-block is not mistaken for a bug. The reason row stays
hidden for blocked or normally-allowed connections.

Fixes celzero#2815
Comment thread app/src/full/java/com/celzero/bravedns/ui/bottomsheet/ConnTrackerBottomSheet.kt Dismissed
@hussainmohd-a

Copy link
Copy Markdown
Collaborator

Hi @mvanhorn, Thanks for the pull request!!

@hussainmohd-a hussainmohd-a left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In updateBlockedRulesChip(), the reason is fetched (getFirewallRule(ruleId)) regardless of whether the connection is blocked or allowed. Also, there are two proxy override checks.

Could you verify whether the additional check introduces any different behavior? If not, will it end up overriding the existing proxy-related checks and affect what is shown in the UI?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Block ALL apps when device is locked

3 participants