mirror of
https://github.com/greenart7c3/Amber.git
synced 2026-10-06 11:28:22 +00:00
Merge pull request #335 from greenart7c3/claude/offline-build-permissions-check-w1zyh
Add CI workflow to verify offline build has no INTERNET permission
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
name: Check Offline Build Permissions
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [master]
|
||||
push:
|
||||
branches: [master]
|
||||
|
||||
jobs:
|
||||
check-offline-permissions:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 20
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up JDK 21
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: 21
|
||||
|
||||
- name: Cache Gradle
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.gradle/caches
|
||||
~/.gradle/wrapper
|
||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-gradle-
|
||||
|
||||
- name: Create keystore.properties
|
||||
run: touch keystore.properties
|
||||
|
||||
- name: Generate merged manifest for offline build
|
||||
run: ./gradlew processOfflineDebugManifest --no-daemon
|
||||
|
||||
- name: Check for INTERNET permission in offline merged manifest
|
||||
run: |
|
||||
MANIFEST=$(find app/build/intermediates/merged_manifests -name "AndroidManifest.xml" | grep -i offline | head -1)
|
||||
if [ -z "$MANIFEST" ]; then
|
||||
echo "ERROR: Could not find merged manifest for offline build"
|
||||
exit 1
|
||||
fi
|
||||
echo "Checking: $MANIFEST"
|
||||
if grep -q 'android.permission.INTERNET' "$MANIFEST"; then
|
||||
echo ""
|
||||
echo "ERROR: android.permission.INTERNET found in offline build manifest!"
|
||||
echo "The offline flavor must not include INTERNET permission."
|
||||
echo ""
|
||||
echo "Offending lines:"
|
||||
grep 'android.permission.INTERNET' "$MANIFEST"
|
||||
exit 1
|
||||
else
|
||||
echo "OK: No INTERNET permission in offline build manifest"
|
||||
fi
|
||||
Reference in New Issue
Block a user