Skip to content

[stealth 02/11] Gate identifying features for stealth builds#8786

Open
reflog wants to merge 10 commits into
mainfrom
stealth/8764-remove-identifying-features-clean
Open

[stealth 02/11] Gate identifying features for stealth builds#8786
reflog wants to merge 10 commits into
mainfrom
stealth/8764-remove-identifying-features-clean

Conversation

@reflog
Copy link
Copy Markdown
Contributor

@reflog reflog commented May 15, 2026

Summary

  • adds compile-time stealth feature gates derived from STEALTH_BUILD=true or STEALTH_MODE=stealth-vpn/stealth-novpn
  • hides and short-circuits OAuth login/callback surfaces, app-link handling, payment/restore/manage-subscription flows, social/follow/download/forum surfaces, and auto-update/appcast handling
  • keeps email/password and activation/license-style account paths available when payment surfaces are disabled
  • documents the stealth gates and native manifest/leakage-check expectations

Closes getlantern/engineering#3574

Validation

  • dart format --set-exit-if-changed on touched Dart files
  • flutter analyze --no-pub --no-fatal-infos on touched Dart files
  • git diff --cached --check

Analyzer notes

  • Analyze reports existing info-level lints on touched files (use_build_context_synchronously, private type in public API). There are no warnings/errors after removing the new unused imports.

Not included

  • Native manifest/entitlement removal is handled by the stealth manifest filtering PR.
  • Final artifact string removal is enforced by the leakage-check PR rather than source-level string deletion here.

Copilot AI review requested due to automatic review settings May 15, 2026 14:58
@reflog reflog self-assigned this May 15, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces compile-time “stealth build” feature gates (driven by --dart-define env vars) to remove/short-circuit high-identification surfaces (OAuth, payments, app links, social/external links, auto-update) while preserving lower-profile auth flows like email/password and license-style activation.

Changes:

  • Add stealth build detection and derived enable* gates in AppBuildInfo, plus documentation for build flags and expected artifact leakage checks.
  • Gate UI entry points and runtime handlers for OAuth, deep links, payments/restore/manage-subscription flows, and social/download/forum surfaces.
  • Disable desktop auto-update initialization/checks and appcast URL resolution in stealth builds.

Reviewed changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
lib/main.dart Gate updater initialization behind enableAutoUpdate.
lib/lantern_app.dart Gate deep link subscription and OAuth callback deep links behind build flags.
lib/features/support/support.dart Hide forum/FAQ/privacy/terms + download/follow surfaces when social links are disabled.
lib/features/setting/setting.dart Hide upgrade/pro, update-check, and external project/referral surfaces behind build flags.
lib/features/setting/follow_us.dart Short-circuit “Follow us” UI when social links are disabled.
lib/features/setting/download_links.dart Short-circuit “Download links” UI when social links are disabled.
lib/features/plans/restore_purchase_mixin.dart Block restore flows when store payments are disabled.
lib/features/plans/provider/payment_notifier.dart Add feature-disabled early returns for payment/IAP APIs and centralize failure creation.
lib/features/plans/plans.dart Block menu/payment flows when payments/store payments are disabled; preserve license/email path.
lib/features/home/provider/radiance_settings_providers.dart Return safe defaults for OAuth-derived settings when OAuth is disabled.
lib/features/auth/sign_in_email.dart Hide OAuth login buttons and block OAuth result handling when OAuth is disabled.
lib/features/auth/provider/auth_notifier.dart Block OAuth login/callback APIs when OAuth is disabled; add feature-disabled failures.
lib/features/auth/confirm_email.dart Route away from payment-based flows when payments are disabled.
lib/features/auth/choose_payment_method.dart Short-circuit payment-method screen when payments are disabled.
lib/features/auth/add_email.dart Hide OAuth sign-up buttons and block OAuth result handling when OAuth is disabled.
lib/features/account/delete_account.dart Gate SSO/OAuth-based delete-account verification behind OAuth enablement.
lib/features/account/account.dart Hide/manage subscription CTAs and renewal entry points when payments are disabled.
lib/core/widgets/pro_banner.dart Hide pro banner in builds where payments are disabled.
lib/core/widgets/oauth_login.dart Make OAuthLogin a no-op widget/handler when OAuth is disabled.
lib/core/updater/updater.dart Disable updater init/checks and appcast usage when auto-update is disabled.
lib/core/services/injection_container.dart Skip AppPurchase initialization when payments/store payments are disabled.
lib/core/common/common.dart Make isStoreVersion() return false when payments/store payments are disabled.
lib/core/common/app_urls.dart Convert social URLs + appcast lookup to be build-flag-aware (including nullable appcast).
lib/core/common/app_build_info.dart Add stealth env parsing and enable* gates derived from stealth mode.
docs/stealth-feature-gates.md Document stealth flags, gated surfaces, and leakage-check expectations.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/core/common/app_build_info.dart
Comment thread lib/features/plans/provider/payment_notifier.dart Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 26 out of 26 changed files in this pull request and generated 2 comments.

Comment thread lib/features/auth/choose_payment_method.dart Outdated
Comment thread docs/stealth-feature-gates.md
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 26 out of 26 changed files in this pull request and generated 2 comments.

Comment thread lib/core/utils/failure.dart Outdated
Comment thread lib/core/common/app_urls.dart
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 47 out of 47 changed files in this pull request and generated 1 comment.

Comment thread lib/features/support/support.dart Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 47 out of 47 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

lib/core/widgets/app_webview.dart:216

  • OAuth completion handling in AppWebView is still active even when stealth gates disable OAuth. Because this block (and the earlier lantern://auth callback) is not guarded by a compile-time AppBuildInfo.enableOAuth check, the /auth + token callback surface and related strings remain in the stealth artifact and can still be triggered if a webview navigates there. Wrap the OAuth callback handling in _handleCompletionUrl with AppBuildInfo.enableOAuth (ideally as part of the condition) so it is compiled out for stealth builds.
    if (AppUrls.isLanternHost(uri.host) &&
        uri.path == '/auth' &&
        uri.queryParameters.containsKey('token')) {
      loading.stop();
      await appRouter.maybePop(uri.queryParameters);

Comment thread lib/core/widgets/app_webview.dart Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 47 out of 47 changed files in this pull request and generated 1 comment.

Comment thread docs/stealth-feature-gates.md
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 47 out of 47 changed files in this pull request and generated 2 comments.

Comment thread lib/core/widgets/app_webview.dart Outdated
Comment thread lib/features/account/delete_account.dart Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 47 out of 47 changed files in this pull request and generated no new comments.

@reflog reflog changed the title Gate identifying features for stealth builds [stealth 02/11] Gate identifying features for stealth builds May 16, 2026
@reflog
Copy link
Copy Markdown
Contributor Author

reflog commented May 17, 2026

@copilot review

Copy link
Copy Markdown
Contributor

Copilot AI commented May 17, 2026

@copilot review

Reviewed at 9020bd1. There are no new actionable issues from the latest Copilot review cycle, and no additional code changes are required on this thread.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 47 out of 47 changed files in this pull request and generated no new comments.

@reflog
Copy link
Copy Markdown
Contributor Author

reflog commented May 18, 2026

@copilot review

Copy link
Copy Markdown
Contributor

Copilot AI commented May 18, 2026

@copilot review

Reviewed at 5302aaa. There are no new actionable issues from the latest Copilot review cycle, and no additional code changes are required on this thread.

Copilot finished work on behalf of reflog May 18, 2026 10:17
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.

4 participants