[stealth 05/11] Add stealth direct-connection app exclusions#8783
[stealth 05/11] Add stealth direct-connection app exclusions#8783reflog wants to merge 7 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an opt-in “stealth direct-connection apps” mode that reuses the existing split-tunneling UI to manage an Android-only, user-editable package denylist that is applied via VpnService.Builder.addDisallowedApplication, backed by shipped JSON defaults plus SharedPreferences edits.
Changes:
- Introduces
STEALTH_DIRECT_CONNECTION_APPSbuild flag in both Flutter (bool.fromEnvironment) and Android (BuildConfigfield parsed from Flutter dart-defines / env / Gradle properties). - Adds default exclusions asset (
assets/stealth/default_exclusions.json) and a Dart test to validate schema/package-name correctness. - Adds Android storage + builder-application logic, and routes split-tunnel method-channel operations to the new store when the flag is enabled (package-name filter type).
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| test/features/split_tunneling/default_exclusions_asset_test.dart | Validates the shipped stealth default exclusions JSON structure and package-name validity. |
| pubspec.yaml | Ensures stealth assets directory is bundled. |
| lib/features/split_tunneling/split_tunneling.dart | Adds stealth UI mode that rewords/hides split-tunnel elements (websites hidden, apps wording made neutral). |
| lib/features/split_tunneling/apps_split_tunneling.dart | Rewords titles/section label for stealth direct-connection mode. |
| lib/core/common/app_build_info.dart | Adds compile-time flag stealthDirectConnectionApps. |
| docs/stealth-direct-connection-apps.md | Documents behavior, build inputs, and default asset update workflow. |
| assets/stealth/default_exclusions.json | Ships the initial default disallowed package list with metadata. |
| assets/locales/en.po | Adds new English strings for stealth direct-connection wording. |
| android/app/src/main/kotlin/org/getlantern/lantern/stealth/DirectConnectionAppExclusionStore.kt | Implements defaults loading, user edits storage, and applying exclusions to VpnService.Builder. |
| android/app/src/main/kotlin/org/getlantern/lantern/stealth/DirectConnectionAppExclusions.kt | Parses defaults JSON and computes effective package sets with validation/normalization. |
| android/app/src/main/kotlin/org/getlantern/lantern/service/LanternVpnService.kt | Applies configured direct-connection exclusions during tunnel build. |
| android/app/src/main/kotlin/org/getlantern/lantern/handler/MethodHandler.kt | Routes split-tunnel add/remove/get calls to the new exclusion store in stealth mode. |
| android/app/build.gradle | Adds parsing for Flutter dart-defines and emits BuildConfig.STEALTH_DIRECT_CONNECTION_APPS. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ac556ce to
cb01400
Compare
|
Integration wiring note (for #8794 integrator + dev1/#8784)
Neither item blocks this PR (normal-build safe: |
…-D JNI gate - generate_profile.py: emit directConnectionAppsEnabled in profile JSON and dart-defines (STEALTH_DIRECT_CONNECTION_APPS=true by default for both stealth modes; false for normal). Addresses #3568 under-protection gap flagged in reviewer item #4. - android/app/build.gradle: read STEALTH_DIRECT_CONNECTION_APPS from stealthProfile.directConnectionAppsEnabled (loaded via loadStealthProfile()) instead of the standalone buildConfigBoolean() dart-defines fallback. Remove the now-redundant dart-defines parser block and buildConfigBoolean closure added by #8783. A stealth-vpn build can no longer ship without the RKS denylist unless the profile explicitly sets directConnectionAppsEnabled=false. - Makefile: add verify-stealth-jni target that extracts arm64-v8a/libgojni.so from the built AAR and hard-fails if Java_lantern_io_* is present or Java_foundation_engine_* is absent. Called automatically from build-android-obfuscated when STEALTH_ENABLED is set. Also add STEALTH_VPN_BUILD_VARS and android-stealth-vpn-{apk,aab,release} targets parallel to the existing novpn variants. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Superseded — the 11 per-issue stealth PRs were consolidated into a 6-PR stack for epic getlantern/engineering#3569. This work now lives in #8863. |
Summary
STEALTH_DIRECT_CONNECTION_APPSbuild flag shared by Flutter and AndroidVpnService.Builder.addDisallowedApplicationon each tunnel startCloses getlantern/engineering#3568
Validation
dart format --set-exit-if-changed lib/core/common/app_build_info.dart lib/features/split_tunneling/apps_split_tunneling.dart lib/features/split_tunneling/split_tunneling.dart test/features/split_tunneling/default_exclusions_asset_test.dartpython3JSON/schema validation forassets/stealth/default_exclusions.jsondart test test/features/split_tunneling/default_exclusions_asset_test.dartpassed after allowing SDK cache writes; local resolver lockfile churn was revertedgit diff --cached --checkNot run
gradle.flutter testbundle path: local checkout has noapp.env, so Flutter asset bundling fails before reaching this asset.