forked from BandarHL/BHInstagram
-
-
Notifications
You must be signed in to change notification settings - Fork 188
/
build.sh
executable file
·84 lines (61 loc) · 2.31 KB
/
build.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
#!/usr/bin/env bash
set -e
CMAKE_OSX_ARCHITECTURES="arm64e;arm64"
# Prerequisites
if [ -z "$(ls -A modules/libflex/FLEX)" ]; then
echo -e '\033[1m\033[0;31mFLEX 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
# 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'
# Check if building with dev mode
if [ "$2" == "--dev" ];
then
FLEXPATH='packages/libsciFLEX.dylib'
make "DEV=1"
else
FLEXPATH='.theos/obj/debug/libsciFLEX.dylib'
make "SIDELOAD=1"
fi
# Create IPA File
echo -e '\033[1m\033[32mCreating the IPA file...\033[0m'
rm -f packages/SCInsta-sideloaded.ipa
pyzule -i "packages/${ipaFile}" -o packages/SCInsta-sideloaded.ipa -f .theos/obj/debug/SCInsta.dylib .theos/obj/debug/sideloadfix.dylib $FLEXPATH -c 0 -m 15.0 -du
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