Skip to content

[stealth 03/11] Stealth Lantern: randomize Android build identity#8781

Open
reflog wants to merge 14 commits into
mainfrom
stealth/8765-android-identity-randomization
Open

[stealth 03/11] Stealth Lantern: randomize Android build identity#8781
reflog wants to merge 14 commits into
mainfrom
stealth/8765-android-identity-randomization

Conversation

@reflog
Copy link
Copy Markdown
Contributor

@reflog reflog commented May 15, 2026

Summary

  • add a deterministic/random Stealth Android identity profile generator
  • wire Android Gradle to consume profile values for applicationId, labels, auth scheme, metadata, BuildConfig, manifest placeholders, and app name resValue
  • move VPN session, notification, and quick settings tile visible labels to generated BuildConfig values
  • add neutral Android icon resources, Make/CI wiring, docs, and generator tests

Dependency / non-goals

This closes #8765 for per-build install identity and native Android identity surfaces. Static inspection can still find source namespace/class/action strings such as org.getlantern and LanternVpnService until the manifest/source minimization work lands; this PR intentionally depends on #8763 for that broader minimization instead of expanding this branch.

Verification

  • python3 -m unittest discover -s scripts/stealth -p '*_test.py'
  • make android-identity-profile BUILD_TYPE=stealth ANDROID_IDENTITY_SEED=issue-8765-test
  • make -n android-apk-release BUILD_TYPE=stealth ANDROID_IDENTITY_SEED=issue-8765-test
  • python3 -m py_compile scripts/stealth/generate_android_identity.py scripts/stealth/generate_android_identity_test.py
  • git diff --check

Closes #8765

Copilot AI review requested due to automatic review settings May 15, 2026 13:05
@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

Adds build-time “identity profiles” for Stealth Android builds so each artifact can have a distinct install identity (applicationId, labels, scheme, icons, and various user-visible strings), while keeping normal builds on the existing Lantern identity.

Changes:

  • Introduces a Python generator + unit tests to produce deterministic (seeded) or random Android identity .properties profiles.
  • Wires Android Gradle/manifest placeholders + BuildConfig fields to consume identity profile values (applicationId, labels, auth scheme, metadata, notification/tile strings, icons).
  • Adds Make/CI/docs plumbing and neutral icon resources to support reproducible Stealth builds.

Reviewed changes

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

Show a summary per file
File Description
scripts/stealth/generate_android_identity.py Generates Android identity profiles (applicationId, labels, metadata, icons, strings).
scripts/stealth/generate_android_identity_test.py Unit tests for deterministic/random generation and properties output.
Makefile Adds identity profile generation and injects ANDROID_IDENTITY_PROFILE into Flutter Android builds.
docs/stealth-android-identity.md Documents how to generate/use identity profiles and schema.
android/app/src/main/res/values/string.xml Removes static app_name so Gradle resValue can control it per build.
android/app/src/main/res/drawable/neutral_notification_icon.xml Adds neutral notification small icon vector.
android/app/src/main/res/drawable/neutral_app_icon.xml Adds neutral app icon vector.
android/app/src/main/kotlin/org/getlantern/lantern/service/QuickTileService.kt Uses BuildConfig-provided quick settings tile labels.
android/app/src/main/kotlin/org/getlantern/lantern/service/LanternVpnService.kt Uses BuildConfig-provided VPN session name.
android/app/src/main/kotlin/org/getlantern/lantern/notification/NotificationManager.kt Uses BuildConfig-provided notification strings + resolves small icon from BuildConfig.
android/app/src/main/AndroidManifest.xml Switches app labels/icons/schemes to manifest placeholders; adds identity meta-data placeholders.
android/app/build.gradle Loads identity profile, validates applicationId, sets manifest placeholders, resValue app_name, and BuildConfig fields.
.github/workflows/build-android.yml Adds optional android_identity_seed input passed through to builds.

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

Comment thread android/app/src/main/AndroidManifest.xml Outdated
Comment thread Makefile 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 13 out of 13 changed files in this pull request and generated 2 comments.

Comment thread android/app/build.gradle
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 13 out of 13 changed files in this pull request and generated 2 comments.

Comment thread android/app/build.gradle
Comment thread android/app/src/main/res/drawable/neutral_notification_icon.xml 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 13 out of 13 changed files in this pull request and generated 1 comment.

Comment thread docs/stealth-android-identity.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 13 out of 13 changed files in this pull request and generated 3 comments.

Comment thread android/app/build.gradle Outdated
Comment thread android/app/src/main/AndroidManifest.xml
Comment thread scripts/stealth/generate_android_identity.py
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 16 out of 16 changed files in this pull request and generated 1 comment.

Comment thread Makefile 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 16 out of 16 changed files in this pull request and generated 2 comments.

Comment thread scripts/stealth/generate_android_identity.py Outdated
Comment thread lib/core/common/app_build_info.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 16 out of 16 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

lib/lantern_app.dart:199

  • _buildPrivateServerAccessKey() now accepts any AppBuildInfo.appAuthScheme URI, but still normalizes the returned access key to a hardcoded lantern//... prefix and the comment/example also hardcode lantern://.... If the intention is to preserve the randomized scheme end-to-end (or to avoid leaking "lantern" into a user-visible access key), update the normalization and comment to use AppBuildInfo.appAuthScheme (or add an explicit comment explaining why the lantern// prefix must remain constant).
    if (AppBuildInfo.isAppAuthUri(uri)) {
      // lantern://private-server?key=value → lantern//private-server?key=value
      var accessKey = 'lantern//${uri.host}';
      if (uri.hasQuery) {
        accessKey += '?${uri.query}';
      }
      return accessKey;

Comment thread Makefile Outdated
Comment thread scripts/stealth/generate_android_identity.py 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 16 out of 16 changed files in this pull request and generated no new comments.

@reflog reflog changed the title Stealth Lantern: randomize Android build identity [stealth 03/11] Stealth Lantern: randomize Android build identity 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

Ran a fresh review pass on commit 9933f02; there are no new actionable findings to address in this branch.

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 16 out of 16 changed files in this pull request and generated 2 comments.

Comment thread Makefile Outdated
Comment thread android/app/build.gradle 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 16 out of 16 changed files in this pull request and generated 1 comment.

Comment thread lib/lantern_app.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 16 out of 16 changed files in this pull request and generated no new comments.

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 16 out of 16 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

Ran a fresh review pass on commit ad2f3e4; there are no new actionable findings to address in this branch.

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.

Stealth Lantern: Per-build Android identity randomization

3 participants