forked from wuxianlin/magisk_boot_patch
-
Notifications
You must be signed in to change notification settings - Fork 1
163 lines (138 loc) · 4.93 KB
/
magiskpatch.yml
File metadata and controls
163 lines (138 loc) · 4.93 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
name: Magisk Boot Patch Application
on:
workflow_dispatch:
inputs:
sysAbi:
description: "System ABI"
required: true
default: "aarch64"
type: choice
options:
- aarch64
- armv7
- s390x
- ppc64le
- riscv64
romUrl:
description: 'Android ROM Url'
required: true
default: "http://sysuptxdl.vivo.com.cn/upgrade/recovery/recoveryFiles/20230606041525f522fd2533870116df1099e0b64d7250.zip"
type: string
cpuAbi:
description: "Android ABI"
required: true
default: "arm64-v8a"
type: choice
options:
- arm64-v8a
- armeabi-v7a
- x86_64
- x86
keepForceEncrypt:
description: 'KEEPFORCEENCRYPT'
default: true
type: boolean
keepVerity:
description: 'KEEPVERITY'
default: true
type: boolean
magiskUrl:
description: 'Custom Magisk Url'
required: true
default: 'https://github.com/4accccc/vivo-Magisk-Delta-suu/releases/download/d2a66567-delta(26105)/app-release.apk'
type: string
jobs:
getboot:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
sudo apt-get install axel brotli
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- uses: actions/checkout@v3
with:
path: payload_dumper
repository: vm03/payload_dumper
- name: Update update_metadata_pb2.py
run: |
curl -s https://android.googlesource.com/platform/system/update_engine/+/refs/heads/master/scripts/update_metadata_pb2.py?format=TEXT | base64 -d > payload_dumper/update_metadata_pb2.py
- name: Get boot
run: |
bash get_boot.sh
env:
ROM_URL: ${{ inputs.romUrl }}
- name: Upload build artifact
uses: actions/upload-artifact@v3
with:
name: imgs
path: out/img/**/*.img
if-no-files-found: error
magiskpatch:
needs: getboot
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: 'imgs'
path: imgs
- name: Display structure of downloaded files
run: ls -R
working-directory: imgs
# - name: Set up running base.
# uses: uraimo/run-on-arch-action@v2
# id: system_setup
# with:
# arch: ${{ inputs.sysAbi }}
# distro: ubuntu22.04
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Download Magisk
run: |
if [ -z $MAGISK_ASSET_URL ];then
LATEST_MAGISK_JSON=$(curl --fail --retry 3 -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/topjohnwu/Magisk/releases/latest)
MAGISK_ASSET_URL=$(echo "$LATEST_MAGISK_JSON" | jq -r '.assets[].browser_download_url | select(contains("stub")|not)')
fi
curl --silent --show-error --location --fail --retry 3 --output magisk.zip $MAGISK_ASSET_URL
unzip -q -o magisk.zip -d magisk
env:
MAGISK_ASSET_URL: ${{ inputs.magiskUrl }}
- name: Download avbtool
run: |
curl -s https://android.googlesource.com/platform/external/avb/+/refs/heads/master/avbtool.py?format=TEXT | base64 -d > avbtool.py
curl -s https://android.googlesource.com/platform/external/avb/+/refs/heads/master/test/data/testkey_rsa2048.pem?format=TEXT | base64 -d > testkey_rsa2048.pem
curl -s https://android.googlesource.com/platform/external/avb/+/refs/heads/master/test/data/testkey_rsa4096.pem?format=TEXT | base64 -d > testkey_rsa4096.pem
curl -s https://android.googlesource.com/platform/external/avb/+/refs/heads/master/test/data/testkey_rsa8192.pem?format=TEXT | base64 -d > testkey_rsa8192.pem
- name: Run magisk patch
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
# arch: ${{ github.event.inputs.cpuAbi }}
script: ./magisk_patch.sh ${{ inputs.cpuAbi }} ${{ inputs.keepForceEncrypt }} ${{ inputs.keepVerity }}
- name: Upload build artifact
uses: actions/upload-artifact@v3
with:
name: magisk
path: imgs/**/magisk-*.img
if-no-files-found: error
- name: Download Android Image Kitchen
run: |
curl --silent --show-error --location --fail --retry 3 --output AIK-Linux-v3.8-ALL.tar.gz "https://forum.xda-developers.com/attachments/aik-linux-v3-8-all-tar-gz.5300923/"
tar -xzf AIK-Linux-v3.8-ALL.tar.gz
- name: Run repack
run: |
bash repack.sh
- name: Upload build artifact
uses: actions/upload-artifact@v3
with:
name: repack
path: imgs/**/*-repack.img
if-no-files-found: error