mirror of
https://github.com/LukeZGD/Legacy-iOS-Kit.git
synced 2025-01-12 00:09:10 +01:00
Fix some issues
- Fix irecovery long timeout (still has timeout but shorter) - Removed precompiled irecovery, just compile on install like before - Change some things at Main to prevent errors on first run
This commit is contained in:
parent
4a2435c007
commit
b52c9d3c7f
Binary file not shown.
56
restore.sh
56
restore.sh
@ -43,7 +43,7 @@ function Main {
|
|||||||
ideviceenterrecovery="ideviceenterrecovery"
|
ideviceenterrecovery="ideviceenterrecovery"
|
||||||
ideviceinfo="ideviceinfo"
|
ideviceinfo="ideviceinfo"
|
||||||
iproxy="iproxy"
|
iproxy="iproxy"
|
||||||
irecovery="sudo resources/tools/irecovery_linux"
|
irecovery="env LD_LIBRARY_PATH=resources/lib irecovery"
|
||||||
python="python2"
|
python="python2"
|
||||||
futurerestore1="sudo LD_PRELOAD=resources/lib/libcurl.so.3 LD_LIBRARY_PATH=resources/lib resources/tools/futurerestore1_linux"
|
futurerestore1="sudo LD_PRELOAD=resources/lib/libcurl.so.3 LD_LIBRARY_PATH=resources/lib resources/tools/futurerestore1_linux"
|
||||||
futurerestore2="sudo LD_LIBRARY_PATH=resources/lib resources/tools/futurerestore2_linux"
|
futurerestore2="sudo LD_LIBRARY_PATH=resources/lib resources/tools/futurerestore2_linux"
|
||||||
@ -63,22 +63,26 @@ function Main {
|
|||||||
tsschecker="resources/tools/tsschecker_$platform"
|
tsschecker="resources/tools/tsschecker_$platform"
|
||||||
fi
|
fi
|
||||||
partialzip="resources/tools/partialzip_$platform"
|
partialzip="resources/tools/partialzip_$platform"
|
||||||
|
chmod +x resources/tools/*
|
||||||
|
|
||||||
[[ ! $platform ]] && Error "Platform unknown/not supported."
|
[[ ! $platform ]] && Error "Platform unknown/not supported."
|
||||||
[[ ! $(ping -c1 google.com 2>/dev/null) ]] && Error "Please check your Internet connection before proceeding."
|
[[ ! $(ping -c1 google.com 2>/dev/null) ]] && Error "Please check your Internet connection before proceeding."
|
||||||
[[ $(uname -m) != 'x86_64' ]] && Error "Only x86_64 distributions are supported. Use a 64-bit distro and try again"
|
[[ $(uname -m) != 'x86_64' ]] && Error "Only x86_64 distributions are supported. Use a 64-bit distro and try again"
|
||||||
|
|
||||||
SaveExternal iOS-OTA-Downgrader-Keys
|
|
||||||
SaveExternal ipwndfu
|
|
||||||
|
|
||||||
[[ $($irecovery -q | grep 'MODE' | cut -c 7-) == "DFU" ]] && DFUDevice=1
|
|
||||||
[[ $($irecovery -q | grep 'MODE' | cut -c 7-) == "Recovery" ]] && RecoveryDevice=1
|
|
||||||
|
|
||||||
if [[ $1 == Install ]] || [ ! $(which $bspatch) ] || [ ! $(which $ideviceinfo) ] ||
|
if [[ $1 == Install ]] || [ ! $(which $bspatch) ] || [ ! $(which $ideviceinfo) ] ||
|
||||||
[ ! $(which git) ] || [ ! $(which ssh) ] || [ ! $(which $python) ]; then
|
[ ! $(which git) ] || [ ! $(which ssh) ] || [ ! $(which $python) ]; then
|
||||||
rm -rf resources/firmware resources/ipwndfu
|
rm -rf resources/firmware resources/ipwndfu
|
||||||
InstallDependencies
|
InstallDependencies
|
||||||
elif [[ $DFUDevice == 1 ]] || [[ $RecoveryDevice == 1 ]]; then
|
fi
|
||||||
|
|
||||||
|
SaveExternal iOS-OTA-Downgrader-Keys
|
||||||
|
SaveExternal ipwndfu
|
||||||
|
|
||||||
|
irecovery2=$($irecovery -q 2>/dev/null | grep 'MODE' | cut -c 7-)
|
||||||
|
[[ $irecovery2 == "DFU" ]] && DFUDevice=1
|
||||||
|
[[ $irecovery2 == "Recovery" ]] && RecoveryDevice=1
|
||||||
|
|
||||||
|
if [[ $DFUDevice == 1 ]] || [[ $RecoveryDevice == 1 ]]; then
|
||||||
ProductType=$($irecovery -q | grep 'PTYP' | cut -c 7-)
|
ProductType=$($irecovery -q | grep 'PTYP' | cut -c 7-)
|
||||||
[ ! $ProductType ] && read -p "[Input] Enter ProductType (eg. iPad2,1): " ProductType
|
[ ! $ProductType ] && read -p "[Input] Enter ProductType (eg. iPad2,1): " ProductType
|
||||||
UniqueChipID=$((16#$(echo $($irecovery -q | grep 'ECID' | cut -c 7-) | cut -c 3-)))
|
UniqueChipID=$((16#$(echo $($irecovery -q | grep 'ECID' | cut -c 7-) | cut -c 3-)))
|
||||||
@ -96,7 +100,6 @@ function Main {
|
|||||||
BasebandDetect
|
BasebandDetect
|
||||||
Clean
|
Clean
|
||||||
mkdir tmp
|
mkdir tmp
|
||||||
chmod +x resources/tools/*
|
|
||||||
|
|
||||||
Echo "* Platform: $platform"
|
Echo "* Platform: $platform"
|
||||||
Echo "* HardwareModel: ${HWModel}ap"
|
Echo "* HardwareModel: ${HWModel}ap"
|
||||||
@ -265,21 +268,19 @@ function kDFU {
|
|||||||
|
|
||||||
Log "Finding device in DFU mode..."
|
Log "Finding device in DFU mode..."
|
||||||
while [[ $DFUDevice != 1 ]]; do
|
while [[ $DFUDevice != 1 ]]; do
|
||||||
[[ $($irecovery -q | grep 'MODE' | cut -c 7-) == "DFU" ]] && DFUDevice=1
|
[[ $($irecovery -q 2>/dev/null | grep 'MODE' | cut -c 7-) == "DFU" ]] && DFUDevice=1
|
||||||
sleep 2
|
|
||||||
done
|
done
|
||||||
Log "Found device in DFU mode."
|
Log "Found device in DFU mode."
|
||||||
kill $iproxyPID
|
kill $iproxyPID
|
||||||
}
|
}
|
||||||
|
|
||||||
function Recovery {
|
function Recovery {
|
||||||
[[ $($irecovery -q | grep 'MODE' | cut -c 7-) == "Recovery" ]] && RecoveryDevice=1
|
[[ $($irecovery -q 2>/dev/null | grep 'MODE' | cut -c 7-) == "Recovery" ]] && RecoveryDevice=1
|
||||||
if [[ $RecoveryDevice != 1 ]]; then
|
if [[ $RecoveryDevice != 1 ]]; then
|
||||||
Log "Entering recovery mode..."
|
Log "Entering recovery mode..."
|
||||||
$ideviceenterrecovery $UniqueDeviceID >/dev/null
|
$ideviceenterrecovery $UniqueDeviceID >/dev/null
|
||||||
while [[ $RecoveryDevice != 1 ]]; do
|
while [[ $RecoveryDevice != 1 ]]; do
|
||||||
[[ $($irecovery -q | grep 'MODE' | cut -c 7-) == "Recovery" ]] && RecoveryDevice=1
|
[[ $($irecovery -q 2>/dev/null | grep 'MODE' | cut -c 7-) == "Recovery" ]] && RecoveryDevice=1
|
||||||
sleep 2
|
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
Log "Device in recovery mode detected. Get ready to enter DFU mode"
|
Log "Device in recovery mode detected. Get ready to enter DFU mode"
|
||||||
@ -299,7 +300,8 @@ function Recovery {
|
|||||||
echo -n "$i "
|
echo -n "$i "
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
[[ $($irecovery -q | grep 'MODE' | cut -c 7-) == "DFU" ]] && DFUDevice=1
|
sleep 2
|
||||||
|
[[ $($irecovery -q 2>/dev/null | grep 'MODE' | cut -c 7-) == "DFU" ]] && DFUDevice=1
|
||||||
[[ $DFUDevice == 1 ]] && CheckM8
|
[[ $DFUDevice == 1 ]] && CheckM8
|
||||||
Error "Failed to detect device in DFU mode. Please run the script again"
|
Error "Failed to detect device in DFU mode. Please run the script again"
|
||||||
}
|
}
|
||||||
@ -391,7 +393,7 @@ function Downgrade {
|
|||||||
$irecovery -f $iBSS.im4p
|
$irecovery -f $iBSS.im4p
|
||||||
$irecovery -f $iBEC.im4p
|
$irecovery -f $iBEC.im4p
|
||||||
sleep 5
|
sleep 5
|
||||||
[[ $($irecovery -q | grep 'MODE' | cut -c 7-) == "Recovery" ]] && RecoveryDevice=1
|
[[ $($irecovery -q 2>/dev/null | grep 'MODE' | cut -c 7-) == "Recovery" ]] && RecoveryDevice=1
|
||||||
if [[ $RecoveryDevice != 1 ]]; then
|
if [[ $RecoveryDevice != 1 ]]; then
|
||||||
echo -e "\n$(Log 'Failed to detect device in pwnREC mode.')"
|
echo -e "\n$(Log 'Failed to detect device in pwnREC mode.')"
|
||||||
Echo "* If you device has backlight turned on, you may try re-plugging in your device and attempt to continue"
|
Echo "* If you device has backlight turned on, you may try re-plugging in your device and attempt to continue"
|
||||||
@ -399,8 +401,7 @@ function Downgrade {
|
|||||||
read -s
|
read -s
|
||||||
Log "Finding device in pwnREC mode..."
|
Log "Finding device in pwnREC mode..."
|
||||||
while [[ $RecoveryDevice != 1 ]]; do
|
while [[ $RecoveryDevice != 1 ]]; do
|
||||||
[[ $($irecovery -q | grep 'MODE' | cut -c 7-) == "Recovery" ]] && RecoveryDevice=1
|
[[ $($irecovery -q 2>/dev/null | grep 'MODE' | cut -c 7-) == "Recovery" ]] && RecoveryDevice=1
|
||||||
sleep 2
|
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
Log "Found device in pwnREC mode."
|
Log "Found device in pwnREC mode."
|
||||||
@ -477,7 +478,8 @@ function InstallDependencies {
|
|||||||
# Ubuntu
|
# Ubuntu
|
||||||
sudo add-apt-repository universe
|
sudo add-apt-repository universe
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install -y bsdiff curl git libimobiledevice-utils libusbmuxd-tools openssh-client usbmuxd usbutils
|
sudo apt install -y autoconf automake bsdiff build-essential checkinstall curl git libglib2.0-dev libimobiledevice-utils libreadline-dev libtool-bin libusb-1.0-0-dev libusbmuxd-tools openssh-client usbmuxd usbutils
|
||||||
|
|
||||||
SavePkg
|
SavePkg
|
||||||
cp libcurl.so.4.5.0 ../resources/lib/libcurl.so.3
|
cp libcurl.so.4.5.0 ../resources/lib/libcurl.so.3
|
||||||
if [[ $UBUNTU_CODENAME == "bionic" ]]; then
|
if [[ $UBUNTU_CODENAME == "bionic" ]]; then
|
||||||
@ -497,7 +499,7 @@ function InstallDependencies {
|
|||||||
|
|
||||||
elif [[ $ID == "fedora" ]]; then
|
elif [[ $ID == "fedora" ]]; then
|
||||||
# Fedora
|
# Fedora
|
||||||
sudo dnf install -y binutils bsdiff git libimobiledevice-utils libpng12 libusbmuxd-utils libzip perl-Digest-SHA python2
|
sudo dnf install -y automake binutils bsdiff git libimobiledevice-utils libpng12 libtool libusb-devel libusbmuxd-utils make libzip perl-Digest-SHA python2 readline-devel
|
||||||
SavePkg
|
SavePkg
|
||||||
ar x libssl1.0.0.deb data.tar.xz
|
ar x libssl1.0.0.deb data.tar.xz
|
||||||
tar xf data.tar.xz
|
tar xf data.tar.xz
|
||||||
@ -518,7 +520,10 @@ function InstallDependencies {
|
|||||||
Error "Distro not detected/supported by the install script." "See the repo README for supported OS versions/distros"
|
Error "Distro not detected/supported by the install script." "See the repo README for supported OS versions/distros"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $platform != linux ]]; then
|
if [[ $platform == linux ]]; then
|
||||||
|
Compile LukeZGD libirecovery
|
||||||
|
ln -sf /usr/local/lib/libirecovery-1.0.so.3 ../resources/lib/libirecovery-1.0.so.3
|
||||||
|
else
|
||||||
rm -rf ../resources/libimobiledevice_$platform
|
rm -rf ../resources/libimobiledevice_$platform
|
||||||
mkdir ../resources/libimobiledevice_$platform
|
mkdir ../resources/libimobiledevice_$platform
|
||||||
unzip libimobiledevice.zip -d ../resources/libimobiledevice_$platform
|
unzip libimobiledevice.zip -d ../resources/libimobiledevice_$platform
|
||||||
@ -529,6 +534,15 @@ function InstallDependencies {
|
|||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function Compile {
|
||||||
|
git clone --depth 1 https://github.com/$1/$2.git
|
||||||
|
cd $2
|
||||||
|
./autogen.sh
|
||||||
|
sudo make install
|
||||||
|
cd ..
|
||||||
|
sudo rm -rf $2
|
||||||
|
}
|
||||||
|
|
||||||
function SaveExternal {
|
function SaveExternal {
|
||||||
ExternalURL="https://github.com/LukeZGD/$1.git"
|
ExternalURL="https://github.com/LukeZGD/$1.git"
|
||||||
External=$1
|
External=$1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user