This repository has been archived by the owner on May 14, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
/
BUILD
executable file
·98 lines (79 loc) · 1.59 KB
/
BUILD
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
#!/bin/sh
OBJECT="iPwnder32"
ARCH=""
FLAGS=""
#FLAGS="-DHAVE_DEBUG -DHAVE_HOOKER"
#FLAGS="-DHAVE_DEBUG -DHAVE_HOOKER -DIPHONEOS_ARM"
readonly CC="clang"
readonly C_SRC="\
ipwnder32.c \
ircv.c \
checkm8.c \
payload.c \
limera1n.c \
partial.c \
boot.c\
"
readonly FRAMEWORK="\
-framework IOKit \
-framework CoreFoundation\
"
readonly INCLUDE="\
-I./include\
"
readonly DYLIB="\
-lcurl \
-lz\
"
function usage {
cat <<EOM
Usage: $(basename "$0") [option]
--intel Make for Intel Mac (x86_64)
--M1 Make for M1 Mac (arm64)
--universal Make for both x86_64 and arm64
--help Show Usage
EOM
exit 1
}
function make {
echo ""$CC" "$C_SRC" "$INCLUDE" "$FRAMEWORK" "$DYLIB" "$FLAGS" "$3" -o "$1" -arch "$2""
$CC $C_SRC $INCLUDE $FRAMEWORK $DYLIB $FLAGS $3 -o $1 -arch $2
strip $1
}
if [ $# -lt 1 ]; then
usage
fi
case "$1" in
'--intel')
ARCH="x86_64"
;;
'--M1')
ARCH="arm64"
;;
'--universal')
ARCH="universal"
;;
*)
usage
;;
esac
if [ $ARCH != "universal" ]; then
STATICLIB="static/macosx/"$ARCH"/iBoot32patcher.a"
make $OBJECT $ARCH $STATICLIB
exit
fi
if [ $ARCH == "universal" ]; then
ARCH1="x86_64"
STATICLIB1="static/macosx/"$ARCH1"/iBoot32patcher.a"
OBJECT1="iPwnder32_"$ARCH1""
ARCH2="arm64"
STATICLIB2="static/macosx/"$ARCH2"/iBoot32patcher.a"
OBJECT2="iPwnder32_"$ARCH2""
make $OBJECT1 $ARCH1 $STATICLIB1
make $OBJECT2 $ARCH2 $STATICLIB2
echo "lipo -create -output "$OBJECT" -arch "$ARCH1" "$OBJECT1" -arch "$ARCH2" "$OBJECT2""
lipo -create -output $OBJECT -arch $ARCH1 $OBJECT1 -arch $ARCH2 $OBJECT2
exit
fi
usage
exit