forked from AppInstalleriOSGH/KFD-Offsets
-
Notifications
You must be signed in to change notification settings - Fork 5
/
lpfinstaller.sh
executable file
·96 lines (93 loc) · 2.57 KB
/
lpfinstaller.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
95
96
clear
echo "LibPatchFinderInstaller v0.2 - made by c22dev\nThis should help you install libpatchfinder. Please make sure brew and Xcode Command Line tools are installed.\nThis script needs sudo to work. Please enter your mac password."
sudo echo "Sudoed successfuly !"
echo "Installing autoconf, automake, libtool, pkg-config, openssl"
# Brew some packages (those available)
brew install autoconf
brew install automake
brew install libtool
brew install pkg-config
brew install openssl
read -p "Do you want to uninstall your current Python installation ? The script will install python back. (RECOMMENDED, y or n)" confirm
if [[ "$confirm" == "y" ]]; then
echo "Deleting python install..."
sudo rm -rf /Library/Frameworks/Python.framework/
sudo rm -rf /usr/local/bin/python3
brew uninstall python --force && brew uninstall python3 --force
echo "Installing python again..."
brew install python
fi
# pyimg4
echo "Installing python dependencies..."
pip3 install pyimg4
mkdir workingLPFI
cd workingLPFI
echo "Cloning libpatchfinder and dependencies..."
# clone all git repos
git clone --recursive https://github.com/tihmstar/libpatchfinder
git clone --recursive https://github.com/tihmstar/img4tool
git clone --recursive https://github.com/tihmstar/img3tool
git clone --recursive https://github.com/libimobiledevice/libplist
git clone --recursive https://github.com/tihmstar/libgeneral
git clone --recursive https://github.com/tihmstar/libinsn
git clone --recursive https://github.com/tihmstar/libfragmentzip
git clone --recursive https://github.com/tihmstar/partialZipBrowser
# Libgeneral
cd libgeneral
./autogen.sh
sudo make
sudo make install
cd ..
# Libinsn
cd libinsn
./autogen.sh
sudo make
sudo make install
cd ..
# Libplist
cd libplist
./autogen.sh
sudo make
sudo make install
cd ..
# Img4Tool
cd img4tool
./autogen.sh
sudo make
sudo make install
cd ..
# Img3Tool
cd img3tool
./autogen.sh
sudo make
sudo make install
cd ..
# libfragmentzip
cd libfragmentzip
./autogen.sh
sudo make
sudo make install
cd ..
# pzb
cd partialZipBrowser
./autogen.sh
sudo make
sudo make install
cd ..
# libpatchfinder
cd libpatchfinder
./autogen.sh
./configure --with-offsetexporter
sudo make
sudo make install
cd ..
# Is it installed ?
if command -v offsetexporter &> /dev/null; then
# Clean folder
rm -rf workingLPFI
echo "Success ! offsetexporter was successfully installed. Please try running run.sh now."
echo "you might need to add your Python bin to PATH."
else
echo "offsetexporter wasn't installed properly. Please contact c22dev on Discord, or try updating script."
fi
echo "Job done !"