-
Notifications
You must be signed in to change notification settings - Fork 26
129 lines (122 loc) · 5.99 KB
/
main.yml
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
name: Build
on:
push:
pull_request:
workflow_dispatch:
jobs:
build:
strategy:
matrix:
os: [macos-12, macos-13, macos-14]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Build
run: make
- name: Test binary
run: |
./aastuff -h
./aastuff_standalone -h
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: macOS artifacts for ${{ matrix.os }}
path: aastuff*
test-get-key:
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
runs-on: macos-latest
steps:
- name: Clean up storage
run: |
mkdir empty_dir
if [ -d "/Applications/Xcode_14.3.1.app/" ]; then
rsync -a --delete empty_dir/ /Applications/Xcode_14.3.1.app/
fi
if [ -d "/Applications/Xcode_14.1.app/" ]; then
rsync -a --delete empty_dir/ /Applications/Xcode_14.1.app/
fi
if [ -d "/Applications/Xcode_13.1.app/" ]; then
rsync -a --delete empty_dir/ /Applications/Xcode_13.1.app/
fi
rsync -a --delete empty_dir/ /Users/runner/Library/Android/sdk/
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install Python dependencies
run: pip install -r requirements.txt
- name: Cache test files
id: cache
uses: actions/cache@v4
with:
key: test-get-key-files
path: |
tests
- name: Download test files
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
run: |
brew install aria2
mkdir tests tests/macOS_15_beta_1_OTA tests/iOS_18_beta_1_IPSW/
# curl -L "https://updates.cdn-apple.com/2024SummerSeed/mobileassets/052-49061/CA7135A8-BAF6-4890-887C-35FB30C154D5/com_apple_MobileAsset_MacSoftwareUpdate/e2de87f20576b2bdc021d36f74a2f836cf42afe576178388dfd0cde875f4f979.aea" -o tests/macOS_15_beta_1_OTA/encrypted.aea
aria2c -x 16 -s 16 -j 16 --file-allocation=none "https://updates.cdn-apple.com/2024SummerSeed/mobileassets/052-49061/CA7135A8-BAF6-4890-887C-35FB30C154D5/com_apple_MobileAsset_MacSoftwareUpdate/e2de87f20576b2bdc021d36f74a2f836cf42afe576178388dfd0cde875f4f979.aea" -o tests/macOS_15_beta_1_OTA/encrypted.aea
printf "$MACOS_OTA_TEST_KEY" > tests/macOS_15_beta_1_OTA/expected.txt
# curl -L "https://updates.cdn-apple.com/2024SummerSeed/fullrestores/052-34764/D5D3D10C-E557-4A46-8EBD-290411A228AA/iPhone16,2_18.0_22A5282m_Restore.ipsw" -o tests/iPhone_15PM_18.0_22A5282m.ipsw
aria2c -x 16 -s 16 -j 16 --file-allocation=none "https://updates.cdn-apple.com/2024SummerSeed/fullrestores/052-34764/D5D3D10C-E557-4A46-8EBD-290411A228AA/iPhone16,2_18.0_22A5282m_Restore.ipsw" -o tests/iPhone_15PM_18.0_22A5282m.ipsw
unzip -p tests/iPhone_15PM_18.0_22A5282m.ipsw 090-29713-049.dmg.aea > tests/iOS_18_beta_1_IPSW/encrypted.aea
rm tests/iPhone_15PM_18.0_22A5282m.ipsw
printf "$IOS_IPSW_TEST_KEY" > tests/iOS_18_beta_1_IPSW/expected.txt
touch tests/iOS_18_beta_1_IPSW/fast_unsupported
env:
MACOS_OTA_TEST_KEY: ${{ vars.MACOS_OTA_TEST_KEY }}
IOS_IPSW_TEST_KEY: ${{ vars.IOS_IPSW_TEST_KEY }}
- name: Run tests
run: ./test_get_key.sh
test-aastuff:
runs-on: macos-latest
steps:
- name: Clean up storage
run: |
mkdir empty_dir
if [ -d "/Applications/Xcode_14.3.1.app/" ]; then
rsync -a --delete empty_dir/ /Applications/Xcode_14.3.1.app/
fi
if [ -d "/Applications/Xcode_14.1.app/" ]; then
rsync -a --delete empty_dir/ /Applications/Xcode_14.1.app/
fi
if [ -d "/Applications/Xcode_13.1.app/" ]; then
rsync -a --delete empty_dir/ /Applications/Xcode_13.1.app/
fi
rsync -a --delete empty_dir/ /Users/runner/Library/Android/sdk/
- uses: actions/checkout@v4
- name: Cache test files
id: cache
uses: actions/cache@v4
with:
key: test-aastuff-files
path: |
tests
- name: Download test files
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
run: |
brew install aria2
mkdir tests tests/small tests/large
# This file uses a compressed inner layer
# curl -L "https://updates.cdn-apple.com/2024/Iris/mobileassets/003-49672/A1233F60-3D17-491B-803A-DB26E20695AE/com_apple_MobileAsset_UAF_Siri_Understanding/6FF3BAF0-FBEF-4C01-BB0E-30CD61DAFCC4.aar" -o tests/small/encrypted.aea
aria2c -x 16 -s 16 -j 16 --file-allocation=none "https://updates.cdn-apple.com/2024/Iris/mobileassets/003-49672/A1233F60-3D17-491B-803A-DB26E20695AE/com_apple_MobileAsset_UAF_Siri_Understanding/6FF3BAF0-FBEF-4C01-BB0E-30CD61DAFCC4.aar" -o tests/small/encrypted.aea
printf "$SMALL_TEST_KEY" > tests/small/expected.txt
printf "YEC,UID,GID,MOD,SH2" > tests/small/flags.txt
# This file uses a raw inner layer
# curl -L "https://updates.cdn-apple.com/2024SummerSeed/mobileassets/052-49061/CA7135A8-BAF6-4890-887C-35FB30C154D5/com_apple_MobileAsset_MacSoftwareUpdate/e2de87f20576b2bdc021d36f74a2f836cf42afe576178388dfd0cde875f4f979.aea" -o tests/large/encrypted.aea
aria2c -x 16 -s 16 -j 16 --file-allocation=none "https://updates.cdn-apple.com/2024SummerSeed/mobileassets/052-49061/CA7135A8-BAF6-4890-887C-35FB30C154D5/com_apple_MobileAsset_MacSoftwareUpdate/e2de87f20576b2bdc021d36f74a2f836cf42afe576178388dfd0cde875f4f979.aea" -o tests/large/encrypted.aea
printf "$LARGE_TEST_KEY" > tests/large/expected.txt
printf "LNK,FLG,UID,GID,MOD,MTM,CTM" > tests/large/flags.txt
env:
SMALL_TEST_KEY: ${{ vars.SMALL_TEST_KEY }}
LARGE_TEST_KEY: ${{ vars.LARGE_TEST_KEY }}
- name: Build
run: make
- name: Run tests
run: ./test_extract.sh