forked from radareorg/radare2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathios-simulator.sh
executable file
·94 lines (76 loc) · 1.95 KB
/
ios-simulator.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
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
#!/bin/sh
if [ -z "${CPU}" ]; then
export CPU=arm64+armv7
export CPU=arm64
export CPU=armv7
fi
export CPU=arm64+armv7
export CPU=arm64+armv7
export PLGCFG=plugins.tiny.cfg
export CPU=x86_64
export SDK=iphonesimulator
#export CPU=arm64
export CPU=x86_64
export SDK=appletvsimulator
export CPU=x86_64
export SDK=watchsimulator
export CPU=armv7k
export SDK=watchos
export CPU=i386
export SDK=watchsimulator
export CPU=arm64
export SDK=appletvos
export CPU=armv7k
export SDK=watchos
##########################################
export CPU=x86_64
export SDK=iphonesimulator
export PLGCFG=plugins.ios-store.cfg
export BUILD=1
PREFIX="/usr"
# PREFIX=/var/mobile
if [ ! -d sys/ios-include ]; then
(
cd sys && \
wget http://lolcathost.org/b/ios-include.tar.gz && \
tar xzvf ios-include.tar.gz
)
fi
export PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:$PATH
export PATH=$(pwd)/sys:${PATH}
export CC="$(pwd)/sys/ios-sdk-gcc"
# set only for arm64, otherwise it is armv7
# select ios sdk version
export IOSVER=10.2
export IOSINC=/
#$(pwd)/sys/ios-include
export CFLAGS=-O2
export USE_SIMULATOR=1
export RANLIB="xcrun --sdk iphoneos ranlib"
if [ "$1" = "-s" ]; then
exec sys/ios-shell.sh
exit $?
fi
if true; then
make mrproper
cp -f ${PLGCFG} plugins.cfg
./configure --prefix=${PREFIX} --with-ostype=darwin \
--without-fork --without-pic --with-nonpic \
--disable-debugger --with-compiler=ios-sdk \
--target=arm-unknown-darwin
fi
if [ $? = 0 ]; then
time make -j4
( cd libr ; make libr.dylib )
if [ $? = 0 ]; then
( cd binr/radare2 ; make ios_sdk_sign )
rm -rf /tmp/r2ios
make install DESTDIR=/tmp/r2ios
rm -rf /tmp/r2ios/usr/share/radare2/*/www/enyo/node_modules
( cd /tmp/r2ios && tar czvf ../r2ios-${CPU}.tar.gz ./* )
rm -rf sys/cydia/radare2/root
mkdir -p sys/cydia/radare2/root
sudo tar xpzvf /tmp/r2ios-${CPU}.tar.gz -C sys/cydia/radare2/root
( cd sys/cydia/radare2 ; sudo make clean ; sudo make )
fi
fi