mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-09-30 05:12:00 +02:00
refactor(discord): remove rich presence and bundled SDK
Remove the presence setting, platform bridge, SDK archive, and SDK preparation from local and CI builds. Reject leftover Discord native libraries in release APK audits.
This commit is contained in:
@@ -1,17 +0,0 @@
|
||||
name: Prepare Discord Social SDK
|
||||
description: Decrypt and verify the pinned Android SDK before Gradle configures native builds.
|
||||
inputs:
|
||||
passphrase:
|
||||
description: Decryption key for the bundled Android SDK, supplied from a repository secret.
|
||||
required: true
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Decrypt and verify SDK
|
||||
shell: bash
|
||||
env:
|
||||
DISCORD_SDK_PASSPHRASE: ${{ inputs.passphrase }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
sdk_dir="$(python3 scripts/prepare_discord_sdk.py)"
|
||||
printf 'SPOTIFLAC_DISCORD_SDK_DIR=%s\n' "$sdk_dir" >> "$GITHUB_ENV"
|
||||
@@ -66,10 +66,6 @@ jobs:
|
||||
- 'scripts/build_rust_backend.sh'
|
||||
- 'scripts/check_backend_apk.py'
|
||||
- 'scripts/test_check_backend_apk.py'
|
||||
- 'scripts/prepare_discord_sdk.py'
|
||||
- 'scripts/test_prepare_discord_sdk.py'
|
||||
- '.github/actions/discord-sdk/**'
|
||||
- 'third_party/discord/**'
|
||||
- 'lib/**'
|
||||
- 'assets/**'
|
||||
- 'pubspec.yaml'
|
||||
@@ -231,20 +227,10 @@ jobs:
|
||||
"cmake;3.22.1"
|
||||
echo "ANDROID_NDK_HOME=$ANDROID_HOME/ndk/29.0.14206865" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Test Discord SDK preparation and APK audits
|
||||
- name: Test APK audits
|
||||
run: |
|
||||
python3 -m unittest discover -s scripts -p 'test_prepare_discord_sdk.py'
|
||||
python3 -m unittest discover -s scripts -p 'test_check_backend_apk.py'
|
||||
|
||||
# Fork PRs do not receive SDK decryption secrets. They still compile the
|
||||
# optional debug bridge and run native tests, but never produce a release
|
||||
# APK with the advertised Discord feature silently missing.
|
||||
- name: Prepare pinned Discord SDK
|
||||
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
|
||||
uses: ./.github/actions/discord-sdk
|
||||
with:
|
||||
passphrase: ${{ secrets.DISCORD_SDK_PASSPHRASE }}
|
||||
|
||||
- name: Get Flutter dependencies
|
||||
run: flutter pub get
|
||||
|
||||
@@ -264,18 +250,16 @@ jobs:
|
||||
run: gradle -p android :app:assembleDebug :app:testDebugUnitTest
|
||||
|
||||
- name: Build Rust release application
|
||||
if: env.SPOTIFLAC_DISCORD_SDK_DIR != ''
|
||||
run: bash scripts/build_android.sh --target lib/main.dart
|
||||
|
||||
- name: Verify Rust release APK payloads
|
||||
if: env.SPOTIFLAC_DISCORD_SDK_DIR != ''
|
||||
run: |
|
||||
python3 scripts/check_backend_apk.py \
|
||||
build/app/outputs/flutter-apk/app-arm64-v8a-release.apk \
|
||||
--backend rust --abis arm64-v8a --require-discord
|
||||
--backend rust --abis arm64-v8a
|
||||
python3 scripts/check_backend_apk.py \
|
||||
build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk \
|
||||
--backend rust --abis armeabi-v7a --require-discord
|
||||
--backend rust --abis armeabi-v7a
|
||||
# PR builds use Gradle's test key; production signing stays in Release.
|
||||
for abi in arm64-v8a armeabi-v7a; do
|
||||
"$ANDROID_HOME/build-tools/37.0.0/apksigner" verify --verbose \
|
||||
|
||||
@@ -120,11 +120,6 @@ jobs:
|
||||
# Set NDK path
|
||||
echo "ANDROID_NDK_HOME=$ANDROID_HOME/ndk/29.0.14206865" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Prepare pinned Discord SDK
|
||||
uses: ./.github/actions/discord-sdk
|
||||
with:
|
||||
passphrase: ${{ secrets.DISCORD_SDK_PASSPHRASE }}
|
||||
|
||||
- name: Setup Flutter
|
||||
uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 # v2
|
||||
with:
|
||||
@@ -209,9 +204,9 @@ jobs:
|
||||
run: |
|
||||
apk_dir=build/app/outputs/flutter-apk
|
||||
python3 scripts/check_backend_apk.py "$apk_dir/SpotiFLAC-${VERSION}-arm64.apk" \
|
||||
--backend rust --abis arm64-v8a --require-discord
|
||||
--backend rust --abis arm64-v8a
|
||||
python3 scripts/check_backend_apk.py "$apk_dir/SpotiFLAC-${VERSION}-arm32.apk" \
|
||||
--backend rust --abis armeabi-v7a --require-discord
|
||||
--backend rust --abis armeabi-v7a
|
||||
for abi in arm64 arm32; do
|
||||
"$ANDROID_HOME/build-tools/37.0.0/zipalign" -c -P 16 4 \
|
||||
"$apk_dir/SpotiFLAC-${VERSION}-${abi}.apk"
|
||||
|
||||
Reference in New Issue
Block a user