Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .github/workflows/build-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,28 @@ on:
installer_base_name:
required: true
type: string
android_identity_seed:
required: false
type: string
stealth_leakage_mode:
description: "Optional stealth leakage scan mode, for example stealth or stealth-novpn"
required: false
type: string
default: ""
obfuscate_go:
description: "Build Android Go/native libraries through garble"
required: false
type: boolean
default: false
secrets:
GRADLE_PROPERTIES:
required: true
APP_ENV:
required: true
KEYSTORE:
required: true
STEALTH_GARBLE_SEED:
required: false

jobs:
build-android:
Expand Down Expand Up @@ -128,14 +150,58 @@ jobs:
env:
GOMOBILECACHE: ${{ env.GOMOBILECACHE }}

- name: Run stealth manifest filter tests
run: make stealth-manifest-filter-test

- name: Install garble
if: ${{ inputs.obfuscate_go }}
run: make install-garble

- name: Build Android obfuscated (APK + AAB)
if: ${{ inputs.obfuscate_go }}
run: make android-release-ci-obfuscated
env:
BUILD_TYPE: ${{ inputs.build_type }}
VERSION: ${{ inputs.version }}
INSTALLER_NAME: ${{ inputs.installer_base_name }}
ANDROID_IDENTITY_SEED: ${{ inputs.android_identity_seed }}
GOMOBILECACHE: ${{ env.GOMOBILECACHE }}
STEALTH_GARBLE_SEED: ${{ secrets.STEALTH_GARBLE_SEED }}

- name: Build Android (APK + AAB)
if: ${{ !inputs.obfuscate_go }}
run: make android-release-ci
env:
BUILD_TYPE: ${{ inputs.build_type }}
VERSION: ${{ inputs.version }}
INSTALLER_NAME: ${{ inputs.installer_base_name }}
ANDROID_IDENTITY_SEED: ${{ inputs.android_identity_seed }}
GOMOBILECACHE: ${{ env.GOMOBILECACHE }}

- name: Stealth leakage check
id: stealth_leakage_check
if: ${{ inputs.stealth_leakage_mode != '' }}
shell: bash
run: |
set -o pipefail
: > stealth-leakage-report.txt
make stealth-leakage-check 2>&1 | tee stealth-leakage-report.txt
env:
STEALTH_LEAKAGE_MODE: ${{ inputs.stealth_leakage_mode }}
STEALTH_LEAKAGE_MISSING_OK: "0"
STEALTH_LEAKAGE_PATHS: >-
${{ inputs.installer_base_name }}${{ inputs.build_type != 'production' && format('-{0}', inputs.build_type) || '' }}.apk
${{ inputs.installer_base_name }}${{ inputs.build_type != 'production' && format('-{0}', inputs.build_type) || '' }}.aab

- name: Upload stealth leakage report
if: ${{ always() && inputs.stealth_leakage_mode != '' && steps.stealth_leakage_check.outcome != 'skipped' }}
uses: actions/upload-artifact@v4
with:
name: stealth-leakage-report
path: stealth-leakage-report.txt
if-no-files-found: error
retention-days: 14

- name: Upload Android APK
uses: actions/upload-artifact@v4
with:
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ on:
required: false
type: boolean
default: false
stealth_leakage_mode:
description: "Run Android stealth leakage scanner for manual Android builds"
required: false
type: choice
options:
- none
- stealth
- stealth-novpn
default: none

env:
# Scheduled nightly store uploads run on these UTC weekdays. Configure via
Expand Down Expand Up @@ -81,6 +90,7 @@ jobs:
is_test_run: ${{ steps.meta.outputs.is_test_run }}
publish_mobile_stores: ${{ steps.meta.outputs.publish_mobile_stores }}
smoke_enable_ip_check: ${{ steps.meta.outputs.smoke_enable_ip_check }}
stealth_leakage_mode: ${{ steps.meta.outputs.stealth_leakage_mode }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
Expand All @@ -95,6 +105,7 @@ jobs:
shell: bash
env:
GH_TOKEN: ${{ github.token }}
REQUESTED_STEALTH_LEAKAGE_MODE: ${{ github.event.inputs.stealth_leakage_mode }}
run: |
EVENT="${{ github.event_name }}"
REQUEST_MOBILE_STORE_PUBLISH="false"
Expand Down Expand Up @@ -257,6 +268,18 @@ jobs:
fi

SMOKE_ENABLE_IP_CHECK="false"
STEALTH_LEAKAGE_MODE=""
if [[ "$EVENT" == "workflow_dispatch" ]]; then
requested_stealth_leakage_mode="${REQUESTED_STEALTH_LEAKAGE_MODE:-none}"
case "$requested_stealth_leakage_mode" in
none|'') ;;
stealth|stealth-novpn) STEALTH_LEAKAGE_MODE="$requested_stealth_leakage_mode" ;;
*)
echo "Error: invalid stealth_leakage_mode '$requested_stealth_leakage_mode'" >&2
exit 1
;;
esac
fi

echo "Build Configuration:"
echo " Event: $EVENT"
Expand All @@ -277,6 +300,7 @@ jobs:
echo "is_test_run=$IS_TEST_RUN" >> $GITHUB_OUTPUT
echo "publish_mobile_stores=$PUBLISH_MOBILE_STORES" >> $GITHUB_OUTPUT
echo "smoke_enable_ip_check=$SMOKE_ENABLE_IP_CHECK" >> $GITHUB_OUTPUT
echo "stealth_leakage_mode=$STEALTH_LEAKAGE_MODE" >> $GITHUB_OUTPUT

- name: Update pubspec.yaml version
shell: bash
Expand Down Expand Up @@ -421,6 +445,7 @@ jobs:
version: ${{ needs.set-metadata.outputs.version }}
build_type: ${{ needs.set-metadata.outputs.build_type }}
installer_base_name: ${{ needs.set-metadata.outputs.installer_base_name }}
stealth_leakage_mode: ${{ needs.set-metadata.outputs.stealth_leakage_mode }}

release-create:
needs: set-metadata
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Miscellaneous
*.class
*.apk
*.so
*.log
*.pyc
*.swp
Expand Down
Loading
Loading