-
-
Notifications
You must be signed in to change notification settings - Fork 11.1k
[stealth 09/11] Add stealth Android manifest filtering #8775
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
reflog
wants to merge
1
commit into
stealth/8769-novpn-proxy
from
stealth/8771-android-manifest-minimization
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
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
16 changes: 16 additions & 0 deletions
16
android/app/src/main/kotlin/foundation/bridge/StealthComponents.kt
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| package foundation.bridge | ||
|
|
||
| import androidx.annotation.RequiresApi | ||
| import org.getlantern.lantern.LanternApp | ||
| import org.getlantern.lantern.MainActivity | ||
| import org.getlantern.lantern.service.LanternVpnService | ||
| import org.getlantern.lantern.service.QuickTileService | ||
|
|
||
| class AppHost : LanternApp() | ||
|
|
||
| class HomeActivity : MainActivity() | ||
|
|
||
| class NetworkService : LanternVpnService() | ||
|
|
||
|
reflog marked this conversation as resolved.
|
||
| @RequiresApi(24) | ||
| class ControlTile : QuickTileService() | ||
|
reflog marked this conversation as resolved.
reflog marked this conversation as resolved.
|
||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # Stealth build notes | ||
|
|
||
| Android stealth manifest minimization is opt-in through the Gradle project | ||
| property `STEALTH_MODE`. The Gradle task uses `-PstealthPython`, then `PYTHON`, | ||
| then `python3` to generate the filtered manifest, so Android stealth builds | ||
| require Python 3.8 or newer through one of those paths. | ||
|
|
||
| ```sh | ||
| gradle -p android :app:assembleRelease -PSTEALTH_MODE=stealth-vpn | ||
| gradle -p android :app:assembleRelease -PSTEALTH_MODE=stealth-novpn | ||
| ``` | ||
|
reflog marked this conversation as resolved.
|
||
|
|
||
| The filter runs on the AGP-merged manifest (after library AARs such as Stripe | ||
| and Google Play Billing have contributed their activities and services) so that | ||
| all library-injected manifest entries are available for removal. | ||
|
|
||
| `-PstealthNoVpn=true` is kept as a compatibility switch for older automation. | ||
| It only selects `novpn` mode when `STEALTH_MODE` is **not** set; if both | ||
| `STEALTH_MODE` and `-PstealthNoVpn` are unset, the build is a normal | ||
| non-stealth build. When `-PstealthNoVpn=true` and `STEALTH_MODE=stealth-vpn` | ||
| are both set, Gradle fails fast because the two inputs conflict. Prefer | ||
| `-PSTEALTH_MODE=stealth-novpn` for new build scripts. | ||
|
|
||
| `vpn` keeps the Android `VpnService` surface but removes app links, broad | ||
| package visibility, write-settings access, payment query declarations, wallet | ||
| metadata, boot receiver, and cleartext traffic allowance from the generated | ||
| manifest. | ||
|
|
||
| `novpn` applies the same filtering and also removes Android VPN service | ||
| components, quick-tile VPN controls, and VPN-related permissions. | ||
| Runtime code must still be compiled or gated separately so no-vpn builds do not | ||
| attempt to start removed services. | ||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.