forked from SoCuul/SCInsta
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·120 lines (91 loc) · 3.49 KB
/
build.sh
File metadata and controls
executable file
·120 lines (91 loc) · 3.49 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
#!/usr/bin/env bash
set -e
CMAKE_OSX_ARCHITECTURES="arm64e;arm64"
CMAKE_OSX_SYSROOT="iphoneos"
# Prerequisites
if [ -z "$(ls -A modules/FLEXing)" ]; then
echo -e '\033[1m\033[0;31mFLEXing submodule not found.\nPlease run the following command to checkout submodules:\n\n\033[0m git submodule update --init --recursive'
exit 1
fi
# Building modes
if [ "$1" == "sideload" ];
then
# Check if building with dev mode
if [ "$2" == "--dev" ];
then
# Cache pre-built FLEX libs
mkdir -p "packages/cache"
cp -f ".theos/obj/debug/FLEXing.dylib" "packages/cache/FLEXing.dylib" 2>/dev/null || true
cp -f ".theos/obj/debug/libflex.dylib" "packages/cache/libflex.dylib" 2>/dev/null || true
if [[ ! -f "packages/cache/FLEXing.dylib" || ! -f "packages/cache/libflex.dylib" ]]; then
echo -e '\033[1m\033[0;33mCould not find cached pre-built FLEX libs, building prerequisite binaries\033[0m'
echo
./build.sh sideload --buildonly
./build-dev.sh true
exit
fi
MAKEARGS='DEV=1'
FLEXPATH='packages/cache/FLEXing.dylib packages/cache/libflex.dylib'
COMPRESSION=0
else
# Clear cached FLEX libs
rm -rf "packages/cache"
MAKEARGS='SIDELOAD=1'
FLEXPATH='.theos/obj/debug/FLEXing.dylib .theos/obj/debug/libflex.dylib'
COMPRESSION=9
fi
# Clean build artifacts
make clean
rm -rf .theos
# Check for decrypted instagram ipa
ipaFile="$(find ./packages/*com.burbn.instagram*.ipa -type f -exec basename {} \;)"
if [ -z "${ipaFile}" ]; then
echo -e '\033[1m\033[0;31m./packages/com.burbn.instagram.ipa not found.\nPlease put a decrypted Instagram IPA in its path.\033[0m'
exit 1
fi
echo -e '\033[1m\033[32mBuilding SCInsta tweak for sideloading (as IPA)\033[0m'
make $MAKEARGS
# Only build libs (for future use in dev build mode)
if [ "$2" == "--buildonly" ];
then
exit
fi
SCINSTAPATH=".theos/obj/debug/SCInsta.dylib"
if [ "$2" == "--devquick" ];
then
# Exclude SCInsta.dylib from ipa for livecontainer quick builds
SCINSTAPATH=""
fi
# Create IPA File
echo -e '\033[1m\033[32mCreating the IPA file...\033[0m'
rm -f packages/SCInsta-sideloaded.ipa
cyan -i "packages/${ipaFile}" -o packages/SCInsta-sideloaded.ipa -f $SCINSTAPATH $FLEXPATH -c $COMPRESSION -m 15.0 -du
# Patch IPA for sideloading
ipapatch --input "packages/SCInsta-sideloaded.ipa" --inplace --noconfirm
echo -e "\033[1m\033[32mDone, we hope you enjoy SCInsta!\033[0m\n\nYou can find the ipa file at: $(pwd)/packages"
elif [ "$1" == "rootless" ];
then
# Clean build artifacts
make clean
rm -rf .theos
echo -e '\033[1m\033[32mBuilding SCInsta tweak for rootless\033[0m'
export THEOS_PACKAGE_SCHEME=rootless
make package
echo -e "\033[1m\033[32mDone, we hope you enjoy SCInsta!\033[0m\n\nYou can find the deb file at: $(pwd)/packages"
elif [ "$1" == "rootful" ];
then
# Clean build artifacts
make clean
rm -rf .theos
echo -e '\033[1m\033[32mBuilding SCInsta tweak for rootful\033[0m'
unset THEOS_PACKAGE_SCHEME
make package
echo -e "\033[1m\033[32mDone, we hope you enjoy SCInsta!\033[0m\n\nYou can find the deb file at: $(pwd)/packages"
else
echo '+--------------------+'
echo '|SCInsta Build Script|'
echo '+--------------------+'
echo
echo 'Usage: ./build.sh <sideload/rootless/rootful>'
exit 1
fi