Skip to content

Instantly share code, notes, and snippets.

@Lessica
Last active September 26, 2024 22:38
Show Gist options
  • Save Lessica/c2d7bfcc3b9edb364b83387ad7785302 to your computer and use it in GitHub Desktop.
Save Lessica/c2d7bfcc3b9edb364b83387ad7785302 to your computer and use it in GitHub Desktop.
Build script for idevicerestore and all its dependencies for macOS.
#!/bin/sh
# Tested on macOS 12.0 / Xcode 13.3 / Homebrew 3.4.6-60-ge1c1157
# yum install python python-devel
# echo '[group_kdesig-cmake3_EPEL]
# name=Copr repo for cmake3_EPEL owned by @kdesig
# baseurl=https://copr-be.cloud.fedoraproject.org/results/@kdesig/cmake3_EPEL/epel-7-$basearch/
# type=rpm-md
# skip_if_unavailable=True
# gpgcheck=1
# gpgkey=https://copr-be.cloud.fedoraproject.org/results/@kdesig/cmake3_EPEL/pubkey.gpg
# repo_gpgcheck=0
# enabled=1
# enabled_metadata=1' >> /etc/yum.repos.d/cmake3.repo
# yum install cmake3
mkdir BuildFutureRestore
cd BuildFutureRestore
brew install make cmake automake autoconf libtool pkg-config curl openssl readline
echo 'export PKG_CONFIG_PATH="/usr/local/opt/curl/lib/pkgconfig:$PKG_CONFIG_PATH"' >> ~/.zshrc
echo 'export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig:$PKG_CONFIG_PATH"' >> ~/.zshrc
echo 'export PKG_CONFIG_PATH="/usr/local/opt/readline/lib/pkgconfig:$PKG_CONFIG_PATH"' >> ~/.zshrc
# echo 'export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig:$PKG_CONFIG_PATH"' >> ~/.zshrc
source ~/.zshrc
git clone https://github.com/libimobiledevice/libplist.git
cd libplist
CFLAGS="-mmacosx-version-min=11.0" ./autogen.sh --enable-static --disable-shared
make -j8 && sudo make install
cd ..
git clone --recursive https://github.com/nih-at/libzip.git
cd libzip
CFLAGS="-mmacosx-version-min=11.0" cmake . # -DBUILD_SHARED_LIBS=off
# cmake3 .
# ln -s /usr/local/lib64/libzip.so.5.0 /lib64/libzip.so
# ln -s /usr/local/lib64/libzip.so.5.0 /lib64/libzip.so.5
make -j8 && sudo make install
cd ..
git clone --recursive https://github.com/tihmstar/libgeneral.git
cd libgeneral
CFLAGS="-mmacosx-version-min=11.0" ./autogen.sh --enable-static --disable-shared
make -j8 && sudo make install
cd ..
git clone --recursive https://github.com/libimobiledevice/libimobiledevice-glue.git
cd libimobiledevice-glue
CFLAGS="-mmacosx-version-min=11.0" ./autogen.sh --enable-static --disable-shared
make -j8 && sudo make install
cd ..
git clone --recursive https://github.com/tihmstar/libfragmentzip.git
cd libfragmentzip
CFLAGS="-mmacosx-version-min=11.0" ./autogen.sh --enable-static --disable-shared
make -j8 && sudo make install
cd ..
git clone --recursive https://github.com/libimobiledevice/libirecovery.git
cd libirecovery
CFLAGS="-mmacosx-version-min=11.0" ./autogen.sh --enable-static --disable-shared
make -j8 && sudo make install
cd ..
git clone --recursive https://github.com/tihmstar/tsschecker.git
cd tsschecker
CFLAGS="-mmacosx-version-min=11.0" ./autogen.sh --enable-static --disable-shared
make -j8 && sudo make install
cd ..
git clone --recursive https://github.com/tihmstar/img4tool.git
cd img4tool
CFLAGS="-mmacosx-version-min=11.0" ./autogen.sh --enable-static --disable-shared
make -j8 && sudo make install
cd ..
git clone --recursive https://github.com/libimobiledevice/libusbmuxd.git
cd libusbmuxd
CFLAGS="-mmacosx-version-min=11.0" ./autogen.sh --enable-static --disable-shared
make -j8 && sudo make install
cd ..
git clone --recursive https://github.com/libimobiledevice/libimobiledevice.git
cd libimobiledevice
CFLAGS="-mmacosx-version-min=11.0" ./autogen.sh --enable-static --disable-shared
make -j8 && sudo make install
cd ..
git clone --recursive https://github.com/libimobiledevice/usbmuxd.git
cd usbmuxd
CFLAGS="-mmacosx-version-min=11.0" ./autogen.sh --enable-static --disable-shared
make -j8 && sudo make install
cd ..
# ln -s /usr/local/lib/pkgconfig/libplist-2.0.pc /usr/local/lib/pkgconfig/libplist.pc
# ln -s /usr/local/lib/pkgconfig/libplist++-2.0.pc /usr/local/lib/pkgconfig/libplist++.pc
# ln -s /usr/local/lib/pkgconfig/libirecovery-1.0.pc /usr/local/lib/pkgconfig/libirecovery.pc
# ln -s /usr/local/lib/pkgconfig/libusbmuxd-2.0.pc /usr/local/lib/pkgconfig/libusbmuxd.pc
# ln -s /usr/local/lib/pkgconfig/libimobiledevice-glue-1.0.pc /usr/local/lib/pkgconfig/libimobiledevice-glue.pc
# ln -s /usr/local/lib/pkgconfig/libimobiledevice-1.0.pc /usr/local/lib/pkgconfig/libimobiledevice.pc
# echo 'export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH"' >> ~/.zshrc
# source ~/.zshrc
git clone --recursive https://github.com/tihmstar/idevicerestore.git
cd idevicerestore
CFLAGS="-mmacosx-version-min=11.0" ./autogen.sh --enable-static --disable-shared
make -j8 && sudo make install
cd ..
git clone --recursive https://github.com/tihmstar/futurerestore.git
cd futurerestore
CFLAGS="-mmacosx-version-min=11.0" ./autogen.sh --enable-static --disable-shared
make -j8 && sudo make install
cd ..
echo "succeed"
futurerestore
@Lessica
Copy link
Author

Lessica commented Nov 7, 2019

This bash script will install futurerestore from its source. By default, install prefix is /usr/local.

@Lessica
Copy link
Author

Lessica commented Nov 7, 2019

On CentOS 7, you need to uncomment some lines and make some changes.

@Lessica
Copy link
Author

Lessica commented Nov 7, 2019

This gist is for the lazy ones who would like to build the latest futurerestore and all its dependencies before Apple stops signing old firmwares, SEPs and BBs.

@Bios597407
Copy link

how to jailbreak 2018 macbook , please

@XboxOneSogie720
Copy link

@Bios597407 You don't jailbreak Macs

@Lessica
Copy link
Author

Lessica commented May 13, 2023

This script is deprecated. See another gist: https://gist.github.com/Lessica/97c3ee0172bf8e24820b71dfe44d53b3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment