Skip to content

Intercept some popular Chinese apps #3097

Intercept some popular Chinese apps

Intercept some popular Chinese apps #3097

Workflow file for this run

name: Debug Build
on:
push:
branches:
- 'master'
- 'AppManager-*'
paths-ignore:
- 'fastlane/**'
- 'scripts/**'
- '*.md'
pull_request:
branches: [ master ]
paths-ignore:
- 'fastlane/**'
- 'scripts/**'
- '*.md'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Clone the repository
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '21'
cache: 'gradle'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Get app version
run: echo "APP_VERSION=v$(cat ./app/build.gradle | grep -m1 versionName | awk -F \" '{print $2}')" >> $GITHUB_ENV
- name: Get app name
run: echo "APP_NAME=AppManager_${{ env.APP_VERSION }}-DEBUG#${{ github.run_number }}" >> $GITHUB_ENV
- name: Inject run number
run: sed -i -e 's|versionName "\([0-9\.]\+\)"|versionName "\1-${{ github.run_number }}"|' ./app/build.gradle
- name: Build with Gradle
run: ./gradlew packageDebugUniversalApk
- name: Rename the APK file
run: mv ./app/build/outputs/apk_from_bundle/debug/app-debug-universal.apk ./${{ env.APP_NAME }}.apk
- name: Store generated APK file
uses: actions/upload-artifact@v4
with:
name: ${{ env.APP_NAME }}
path: ./${{ env.APP_NAME }}.apk
- name: Upload APK to telegram
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
document: ./${{ env.APP_NAME }}.apk
format: markdown
message: |
*AM Debug ${{ env.APP_VERSION }} Run#${{ github.run_number }}*
${{ github.event.head_commit.message }}
continue-on-error: true
- name: Checkout AMInsecureDebugBuilds
uses: actions/checkout@v4
with:
repository: MuntashirAkon/AMInsecureDebugBuilds
token: ${{ secrets.AMIDB_TOKEN }}
fetch-depth: 0
ref: master
path: upload-repo
- name: Copy APK to AMInsecureDebugBuilds
run: |
cp ${{ env.APP_NAME }}.apk upload-repo/
cd upload-repo
git config --local user.name "github-actions[bot]"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
bash ../scripts/keep-five.sh
git add ${{ env.APP_NAME }}.apk
echo "${{ github.run_number }}: ${{ github.event.head_commit.message }}" > commit_msg.txt
git commit -F commit_msg.txt
rm commit_msg.txt
cd ..
- name: Push changes to GitHub
uses: ad-m/github-push-action@master
with:
repository: MuntashirAkon/AMInsecureDebugBuilds
github_token: ${{ secrets.AMIDB_TOKEN }}
branch: master
force: true
directory: upload-repo