-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (57 loc) · 1.92 KB
/
build.yml
File metadata and controls
68 lines (57 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Build and Upload APK
on:
push:
branches: [ main ]
workflow_dispatch:
# watch:
# types: [ started ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v5
with:
java-version: '25'
distribution: 'temurin'
- name: Install dependencies
run: |
# 安装 apktool
wget https://raw.githubusercontent.com/iBotPeaches/Apktool/master/scripts/linux/apktool
wget https://github.com/iBotPeaches/Apktool/releases/download/v2.7.0/apktool_2.7.0.jar
chmod +x apktool apktool_2.7.0.jar
sudo mv apktool apktool_2.7.0.jar /usr/local/bin/
sudo ln -s /usr/local/bin/apktool_2.7.0.jar /usr/local/bin/apktool.jar
# 安装 Android SDK Command Line Tools
wget https://dl.google.com/android/repository/commandlinetools-linux-10406996_latest.zip
unzip commandlinetools-linux-10406996_latest.zip
sudo mkdir -p /opt/android-sdk
sudo mv cmdline-tools /opt/android-sdk/
echo "ANDROID_HOME=/opt/android-sdk" >> $GITHUB_ENV
echo "PATH=$PATH:/opt/android-sdk/cmdline-tools/latest/bin:/opt/android-sdk/build-tools/34.0.0" >> $GITHUB_ENV
# 安装 build-tools
yes | /opt/android-sdk/cmdline-tools/bin/sdkmanager --sdk_root=/opt/android-sdk "build-tools;34.0.0"
- name: Check dependencies
run: |
java -version
apktool --version
which zipalign
which apksigner
- name: Create config.json if not exists
run: |
if [ ! -f config.json ]; then
cat > config.json << 'EOF'
[
["com.example.app", "ModifiedApp", 9999, "9999.0.0"]
]
EOF
fi
- name: Run main.py
run: |
python3 main.py
- name: Upload APK artifacts
uses: actions/upload-artifact@v4
with:
name: modified-apks
path: output/*.apk