

# Always Apple FTD Passra1n Setup Script
# Prepare for iCloud Bypass

# Change to the current dir
cd "`dirname "$0"`"

echo ""

# Check if Homebrew is installed and install if not
#if test ! $(which brew); then
    #echo "Installing Homebrew..."
    #/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    #echo ""
#fi

# Check if sshpass is installed and install if not
if test ! $(which sshpass); then
    echo "Installing sshpass..."
    /usr/local/bin/brew install esolitos/ipa/sshpass
    /usr/local/bin/brew link --overwrite sshpass
    echo ""
fi

# Check if iproxy is installed and install if not
if test ! $(which iproxy); then
    echo "Installing iproxy..."
    /usr/local/bin/brew install libusbmuxd
    /usr/local/bin/brew link --overwrite libusbmuxd
    echo ""
fi

# Move the libraries to /usr/local/lib

rm -rf /usr/local/lib/libcrypto.1.1.dylib
rm -rf /usr/local/lib/libcrypto.3.dylib
rm -rf /usr/local/lib/libgeneral.0.dylib
rm -rf /usr/local/lib/libideviceactivation-1.0.2.dylib
rm -rf /usr/local/lib/libimobiledevice-1.0.6.dylib
rm -rf /usr/local/lib/libimobiledevice-glue-1.0.0.dylib
rm -rf /usr/local/lib/libplist-2.0.3.dylib
rm -rf /usr/local/lib/libplist.3.dylib
rm -rf /usr/local/lib/libplist++-2.0.3.dylib
rm -rf /usr/local/lib/libssl.1.1.dylib
rm -rf /usr/local/lib/libssl.3.dylib
rm -rf /usr/local/lib/libusbmuxd-2.0.6.dylib
rm -rf /usr/local/lib/libusbmuxd.4.dylib

cp -R move/* /usr/local/lib

cp -R tools/idevicepair /usr/local/lib
cp -R tools/sshpass /usr/local/lib
cp -R tools/ideviceactivation /usr/local/lib

echo "Setup Script Ran!"

echo ""