-
Notifications
You must be signed in to change notification settings - Fork 1
/
create_sdk.sh
executable file
·52 lines (40 loc) · 1.3 KB
/
create_sdk.sh
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
#!/bin/sh
#mkdir -p ~/theos/sdks/iPhoneOS12.1.sdk/System/Library/PrivateFrameworks/
iOSVersion="$1"
dyldCache="$2"
generateSymbols() {
echo "\033[1;34mGenerating symbols\033[0m"
rm -rf tempTBD
jtool2 -l $dyldCache | cut -c 25- | tail +2 | grep / | awk '{print $1; }' | while read line
do
line="$line"
dir="$(dirname "$line")"
name="$(basename "$line")"
outfile="${name%*.dylib}.tbd"
echo "\033[1;34mProcessing $line\033[0m"
mkdir -p tempTBD/"$dir"
jtool2 --tbd "$dyldCache":$name > tempTBD/"$dir"/"$outfile"
done
}
extractDyldCache() {
rm -rf dyldCache
mkdir dyldCache
echo "\033[1;34mProcessing $dyldCache\033[0m"
./dsc_extractor "$dyldCache" dyldCache
}
createSDK() {
sdkPath="$(xcode-select -p)"/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS"$iOSVersion".sdk
echo "\033[1;34mTrying to copy SDK from Xcode for iOS $iOSVersion\033[0m"
rm -rf iPhoneOS"$iOSVersion".sdk
mkdir iPhoneOS"$iOSVersion".sdk
cp -R "$sdkPath"/* iPhoneOS"$iOSVersion".sdk/
echo "\033[1;34mAdding Private Frameworks to SDK for iOS $iOSVersion\033[0m"
#extractDyldCache "$dyldCache"
generateSymbols
cp -R tempTBD/* iPhoneOS"$iOSVersion".sdk/
rm -rf tempTBD
echo "\033[1;34mAdding dumped headers to SDK for iOS $iOSVersion\033[0m"
cp -R Headers/* iPhoneOS"$iOSVersion".sdk/
}
#generateSymbols
createSDK