mirror of
https://github.com/LukeZGD/Legacy-iOS-Kit.git
synced 2025-01-12 08:19:13 +01:00
Move option selections at the start
also add better messages
This commit is contained in:
parent
74ebb9c63e
commit
987902ad90
@ -67,7 +67,8 @@ GetDeviceValues() {
|
|||||||
|
|
||||||
if [[ ! $DeviceState ]]; then
|
if [[ ! $DeviceState ]]; then
|
||||||
echo -e "\n${Color_R}[Error] No device detected. Please put the device in normal mode before proceeding. ${Color_N}"
|
echo -e "\n${Color_R}[Error] No device detected. Please put the device in normal mode before proceeding. ${Color_N}"
|
||||||
echo "${Color_Y}* Make sure to also trust this computer by selecting \"Trust\" at the pop-up. For Windows/macOS users, double-check if the device is being detected by iTunes/Finder. ${Color_N}"
|
echo "${Color_Y}* Make sure to also trust this computer by selecting \"Trust\" at the pop-up. ${Color_N}"
|
||||||
|
echo "${Color_Y}* For Windows/macOS users, double-check if the device is being detected by iTunes/Finder. ${Color_N}"
|
||||||
echo "${Color_Y}* Recovery or DFU mode is also applicable. For more details regarding alternative methods, read the \"Troubleshooting\" wiki page in GitHub ${Color_N}"
|
echo "${Color_Y}* Recovery or DFU mode is also applicable. For more details regarding alternative methods, read the \"Troubleshooting\" wiki page in GitHub ${Color_N}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@ -156,6 +157,7 @@ GetDeviceValues() {
|
|||||||
SEP="sep-firmware.$HWModel.RELEASE.im4p"
|
SEP="sep-firmware.$HWModel.RELEASE.im4p"
|
||||||
|
|
||||||
Log "Found $ProductType in $DeviceState mode."
|
Log "Found $ProductType in $DeviceState mode."
|
||||||
|
Log "Device ECID: $UniqueChipID"
|
||||||
}
|
}
|
||||||
|
|
||||||
CheckM8() {
|
CheckM8() {
|
||||||
@ -296,7 +298,8 @@ kDFU() {
|
|||||||
Echo "* To make sure that SSH is successful, try these steps:"
|
Echo "* To make sure that SSH is successful, try these steps:"
|
||||||
Echo "* Reinstall OpenSSH/Dropbear, reboot and rejailbreak, then reinstall them again"
|
Echo "* Reinstall OpenSSH/Dropbear, reboot and rejailbreak, then reinstall them again"
|
||||||
echo
|
echo
|
||||||
Input "Enter the root password of your iOS device when prompted"
|
Input "Enter the root password of your iOS device when prompted."
|
||||||
|
Echo "* Note that you will be prompted twice. Do not worry that your input is not visible, it is still being entered."
|
||||||
Echo "* The default password is \"alpine\""
|
Echo "* The default password is \"alpine\""
|
||||||
$SCP -P 2222 resources/tools/$kloader tmp/pwnediBSS root@127.0.0.1:/tmp
|
$SCP -P 2222 resources/tools/$kloader tmp/pwnediBSS root@127.0.0.1:/tmp
|
||||||
if [[ $? == 0 ]]; then
|
if [[ $? == 0 ]]; then
|
||||||
@ -304,7 +307,7 @@ kDFU() {
|
|||||||
else
|
else
|
||||||
Log "Cannot connect to device via USB SSH."
|
Log "Cannot connect to device via USB SSH."
|
||||||
Echo "* Please try the steps above to make sure that SSH is successful"
|
Echo "* Please try the steps above to make sure that SSH is successful"
|
||||||
Echo "* Alternatively, you may use kDFUApp by tihmstar (from my repo, see README)"
|
Echo "* Alternatively, you may use kDFUApp by tihmstar (from my repo, see \"Troubleshooting\" wiki page)"
|
||||||
Input "Press Enter/Return to continue anyway (or press Ctrl+C to cancel and try again)"
|
Input "Press Enter/Return to continue anyway (or press Ctrl+C to cancel and try again)"
|
||||||
read -s
|
read -s
|
||||||
Log "Will try again with Wi-Fi SSH..."
|
Log "Will try again with Wi-Fi SSH..."
|
||||||
@ -321,7 +324,7 @@ kDFU() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
Log "Entering kDFU mode..."
|
Log "Entering kDFU mode..."
|
||||||
Echo "* Press POWER or HOME button when screen goes black on the device"
|
Echo "* Press POWER or HOME button when the device disconnects and its screen goes black"
|
||||||
FindDevice "DFU"
|
FindDevice "DFU"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,26 +72,36 @@ Downgrade() {
|
|||||||
local IPSWSHA1
|
local IPSWSHA1
|
||||||
local IPSWSHA1L
|
local IPSWSHA1L
|
||||||
local Jailbreak
|
local Jailbreak
|
||||||
|
local JBName
|
||||||
local Verify
|
local Verify
|
||||||
|
|
||||||
|
Log "Select your options when asked. If unsure, go for the defaults (press Enter/Return)."
|
||||||
|
echo
|
||||||
|
|
||||||
if [[ $OSVer == "Other" ]]; then
|
if [[ $OSVer == "Other" ]]; then
|
||||||
if [[ $platform == "linux" ]]; then
|
if [[ $platform == "linux" ]]; then
|
||||||
|
Input "Select your IPSW file in the file selection window."
|
||||||
IPSW="$(zenity --file-selection --file-filter='IPSW | *.ipsw' --title="Select IPSW file")"
|
IPSW="$(zenity --file-selection --file-filter='IPSW | *.ipsw' --title="Select IPSW file")"
|
||||||
IPSW="${IPSW%?????}"
|
IPSW="${IPSW%?????}"
|
||||||
Log "Selected IPSW file: $IPSW"
|
Log "Selected IPSW file: $IPSW.ipsw"
|
||||||
|
Input "Select your SHSH file in the file selection window."
|
||||||
SHSH="$(zenity --file-selection --file-filter='SHSH | *.shsh *.shsh2' --title="Select SHSH file")"
|
SHSH="$(zenity --file-selection --file-filter='SHSH | *.shsh *.shsh2' --title="Select SHSH file")"
|
||||||
Log "Selected SHSH file: $SHSH"
|
Log "Selected SHSH file: $SHSH"
|
||||||
else
|
else
|
||||||
|
Input "Enter the names of your IPSW and SHSH files below."
|
||||||
Echo "* Move/copy the IPSW and SHSH files to the directory where the script is located"
|
Echo "* Move/copy the IPSW and SHSH files to the directory where the script is located"
|
||||||
Echo "* When entering the names of IPSW and SHSH, enter the full name including the file extension"
|
Echo "* When entering the names of IPSW and SHSH, enter the full name including the file extension"
|
||||||
Echo "* Remember to create a backup of the SHSH"
|
Echo "* Make sure to create a backup of the SHSH"
|
||||||
read -p "$(Input 'Enter name of IPSW file:')" IPSW
|
read -p "$(Input 'Enter name of IPSW file:')" IPSW
|
||||||
IPSW="$(basename $IPSW .ipsw)"
|
IPSW="$(basename "$IPSW" .ipsw)"
|
||||||
read -p "$(Input 'Enter name of SHSH file:')" SHSH
|
read -p "$(Input 'Enter name of SHSH file:')" SHSH
|
||||||
fi
|
fi
|
||||||
|
|
||||||
elif [[ $Mode == "Downgrade" && $DeviceProc != 7 ]]; then
|
elif [[ $Mode == "Downgrade" && $DeviceProc != 7 ]]; then
|
||||||
read -p "$(Input 'Jailbreak the selected iOS version? (Y/n):')" Jailbreak
|
Input "Jailbreak Option"
|
||||||
|
Echo "* When this option is enabled, your device will be jailbroken on restore."
|
||||||
|
Echo "* This option is enabled by default (Y)."
|
||||||
|
read -p "$(Input 'Enable this option? (Y/n):')" Jailbreak
|
||||||
|
|
||||||
if [[ $Jailbreak != 'N' && $Jailbreak != 'n' ]]; then
|
if [[ $Jailbreak != 'N' && $Jailbreak != 'n' ]]; then
|
||||||
Jailbreak=1
|
Jailbreak=1
|
||||||
@ -99,19 +109,28 @@ Downgrade() {
|
|||||||
$ProductType == "iPad2,5" || $ProductType == "iPad2,6" ||
|
$ProductType == "iPad2,5" || $ProductType == "iPad2,6" ||
|
||||||
$ProductType == "iPad2,7" || $ProductType == "iPod5,1" ]] ||
|
$ProductType == "iPad2,7" || $ProductType == "iPod5,1" ]] ||
|
||||||
[[ $ProductType == "iPad3"* && $DeviceProc == 5 ]]; then
|
[[ $ProductType == "iPad3"* && $DeviceProc == 5 ]]; then
|
||||||
if [[ $OSVer == "8.4.1" ]]; then
|
[[ $OSVer == "8.4.1" ]] && JBDaibutsu=1
|
||||||
Log "Using daibutsu jailbreak"
|
|
||||||
JBDaibutsu=1
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ $JBDaibutsu == 1 ]]; then
|
||||||
|
JBName="daibutsu"
|
||||||
|
elif [[ $OSVer == "8.4.1" ]]; then
|
||||||
|
JBName="EtasonJB"
|
||||||
|
elif [[ $OSVer == "6.1.3" ]]; then
|
||||||
|
JBName="p0sixspwn"
|
||||||
|
fi
|
||||||
|
|
||||||
|
Log "Jailbreak option enabled. Using $JBName for the jailbreak"
|
||||||
fi
|
fi
|
||||||
|
echo
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $Mode == "Downgrade" && $ProductType == "iPhone5,1" && $Jailbreak != 1 ]]; then
|
if [[ $Mode == "Downgrade" && $ProductType == "iPhone5,1" && $Jailbreak != 1 ]]; then
|
||||||
Echo "* By default, iOS-OTA-Downgrader now flashes the iOS 8.4.1 baseband to iPhone5,1"
|
Input "Latest Baseband Option"
|
||||||
Echo "* Flashing the latest baseband is still available as an option but beware of problems it may cause"
|
Echo "* iOS-OTA-Downgrader flashes the iOS 8.4.1 baseband to iPhone5,1."
|
||||||
Echo "* There are potential network issues that with the latest baseband when used on iOS 8.4.1"
|
Echo "* When this option is enabled, the latest baseband will be flashed instead, but beware of problems it may cause."
|
||||||
read -p "$(Input 'Flash the latest baseband? (y/N) (press Enter/Return if unsure):')" Baseband5
|
Echo "* This option is disabled by default (N)."
|
||||||
|
read -p "$(Input 'Enable this option? (y/N):')" Baseband5
|
||||||
if [[ $Baseband5 == 'Y' || $Baseband5 == 'y' ]]; then
|
if [[ $Baseband5 == 'Y' || $Baseband5 == 'y' ]]; then
|
||||||
Baseband5=0
|
Baseband5=0
|
||||||
else
|
else
|
||||||
@ -119,36 +138,27 @@ Downgrade() {
|
|||||||
Baseband="Mav5-8.02.00.Release.bbfw"
|
Baseband="Mav5-8.02.00.Release.bbfw"
|
||||||
BasebandSHA1="db71823841ffab5bb41341576e7adaaeceddef1c"
|
BasebandSHA1="db71823841ffab5bb41341576e7adaaeceddef1c"
|
||||||
fi
|
fi
|
||||||
|
echo
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $OSVer != "Other" ]]; then
|
if [[ $OSVer != "Other" ]]; then
|
||||||
[[ $DeviceProc != 7 ]] && SaveOTABlobs
|
|
||||||
|
|
||||||
IPSW="${IPSWType}_${OSVer}_${BuildVer}_Restore"
|
IPSW="${IPSWType}_${OSVer}_${BuildVer}_Restore"
|
||||||
IPSWCustom="${IPSWType}_${OSVer}_${BuildVer}_Custom"
|
IPSWCustom="${IPSWType}_${OSVer}_${BuildVer}_Custom"
|
||||||
|
|
||||||
if [[ $Jailbreak != 1 && $DeviceProc != 7 && $platform == "win" ]]; then
|
if [[ $Jailbreak != 1 && $DeviceProc != 7 && $platform == "win" ]]; then
|
||||||
IPSWCustom="${IPSWCustom}W"
|
IPSWCustom="${IPSWCustom}W"
|
||||||
IPSWCustomW=1
|
IPSWCustomW=1
|
||||||
elif [[ $Jailbreak != 1 && $DeviceProc != 7 ]]; then
|
elif [[ $Jailbreak != 1 && $DeviceProc != 7 ]]; then
|
||||||
Selection=("futurerestore" "idevicerestore")
|
local opt
|
||||||
Echo "* Select 1 (futurerestore) if unsure"
|
Input "Restore Tool Option"
|
||||||
Echo "* Select 2 (idevicerestore) if you experience issues with futurerestore"
|
Echo "* This option is set to futurerestore (Y) by default."
|
||||||
Input "Select restore tool to use:"
|
Echo "* You may select idevicerestore (N) later if you experience issues with futurerestore."
|
||||||
select opt in "${Selection[@]}"; do
|
read -p "$(Input 'Enable this option? (Y/n):')" opt
|
||||||
case $opt in
|
if [[ $opt == 'N' || $opt == 'n' ]]; then
|
||||||
"idevicerestore" ) IPSWCustom="${IPSWCustom}W"; IPSWCustomW=1; break;;
|
IPSWCustom="${IPSWCustom}W"
|
||||||
*) break;;
|
IPSWCustomW=1
|
||||||
esac
|
fi
|
||||||
done
|
echo
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ! -e "$IPSW.ipsw" && ! -e "$IPSWCustom.ipsw" ]]; then
|
|
||||||
Log "iOS $OSVer IPSW cannot be found."
|
|
||||||
Echo "* If you already downloaded the IPSW, did you put it in the same directory as the script?"
|
|
||||||
Echo "* Do NOT rename the IPSW as the script will fail to detect it"
|
|
||||||
Log "Downloading IPSW... (Press Ctrl+C to cancel)"
|
|
||||||
curl -L $(cat $Firmware/$BuildVer/url) -o tmp/$IPSW.ipsw
|
|
||||||
mv tmp/$IPSW.ipsw .
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! -e "$IPSWCustom.ipsw" && $IPSWCustomW == 1 ]]; then
|
if [[ ! -e "$IPSWCustom.ipsw" && $IPSWCustomW == 1 ]]; then
|
||||||
@ -159,6 +169,26 @@ Downgrade() {
|
|||||||
Verify=1
|
Verify=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ $Jailbreak == 1 || $IPSWCustomW == 1 ]] &&
|
||||||
|
[[ $Verify == 1 && $platform != "win" ]]; then
|
||||||
|
Input "Memory Option for creating custom IPSW"
|
||||||
|
Echo "* This option makes creating the custom IPSW faster, but it requires at least 8GB of RAM."
|
||||||
|
Echo "* If you do not have enough RAM, disable this option and make sure that you have enough storage space."
|
||||||
|
Echo "* This option is enabled by default (Y)."
|
||||||
|
read -p "$(Input 'Enable this option? (Y/n):')" JBMemory
|
||||||
|
echo
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! -e "$IPSW.ipsw" && ! -e "$IPSWCustom.ipsw" ]]; then
|
||||||
|
Log "iOS $OSVer IPSW for $ProductType cannot be found."
|
||||||
|
Echo "* If you already downloaded the IPSW, move/copy it to the directory where the script is located."
|
||||||
|
Echo "* Do NOT rename the IPSW as the script will fail to detect it."
|
||||||
|
Echo "* The script will now proceed to download it for you. If you want to download it yourself, here is the link: $(cat $Firmware/$BuildVer/url)"
|
||||||
|
Log "Downloading IPSW... (Press Ctrl+C to cancel)"
|
||||||
|
curl -L $(cat $Firmware/$BuildVer/url) -o tmp/$IPSW.ipsw
|
||||||
|
mv tmp/$IPSW.ipsw .
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ $Verify == 1 ]]; then
|
if [[ $Verify == 1 ]]; then
|
||||||
Log "Verifying IPSW..."
|
Log "Verifying IPSW..."
|
||||||
IPSWSHA1=$(cat $Firmware/$BuildVer/sha1sum)
|
IPSWSHA1=$(cat $Firmware/$BuildVer/sha1sum)
|
||||||
@ -176,19 +206,21 @@ Downgrade() {
|
|||||||
IPSWRestore=$IPSWCustom
|
IPSWRestore=$IPSWCustom
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $DeviceState == "Normal" && $iBSSBuildVer == $BuildVer ]]; then
|
if [[ $DeviceState == "Normal" && $iBSSBuildVer == $BuildVer && -e "$IPSW.ipsw" ]]; then
|
||||||
Log "Extracting iBSS from IPSW..."
|
Log "Extracting iBSS from IPSW..."
|
||||||
mkdir -p saved/$ProductType 2>/dev/null
|
mkdir -p saved/$ProductType 2>/dev/null
|
||||||
unzip -o -j $IPSW.ipsw Firmware/dfu/$iBSS.dfu -d saved/$ProductType
|
unzip -o -j $IPSW.ipsw Firmware/dfu/$iBSS.dfu -d saved/$ProductType
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
[[ $DeviceProc != 7 ]] && SaveOTABlobs
|
||||||
else
|
else
|
||||||
IPSWCustom=0
|
IPSWCustom=0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[[ $DeviceState == "Normal" ]] && kDFU
|
[[ $DeviceState == "Normal" ]] && kDFU
|
||||||
|
|
||||||
if [[ $Jailbreak == 1 || $IPSWRestore == $IPSWCustom || $IPSWCustomW == 1 ]]; then
|
if [[ $Jailbreak == 1 || $IPSWCustomW == 1 ]]; then
|
||||||
[[ $Jailbreak == 1 || $IPSWCustomW == 1 ]] && IPSW32
|
IPSW32
|
||||||
IPSWExtract="$IPSWCustom"
|
IPSWExtract="$IPSWCustom"
|
||||||
else
|
else
|
||||||
IPSWExtract="$IPSW"
|
IPSWExtract="$IPSW"
|
||||||
|
@ -70,14 +70,7 @@ IPSW32() {
|
|||||||
ExtraArgs+="-bbupdate"
|
ExtraArgs+="-bbupdate"
|
||||||
|
|
||||||
if [[ ! -e $IPSWCustom.ipsw ]]; then
|
if [[ ! -e $IPSWCustom.ipsw ]]; then
|
||||||
if [[ $platform != "win" ]]; then
|
[[ $JBMemory != 'N' && $JBMemory != 'n' ]] && ExtraArgs+=" -memory"
|
||||||
Echo "* By default, memory option is set to Y."
|
|
||||||
Echo "* Make sure that you have at least 8GB of RAM for it to work!"
|
|
||||||
Echo "* If it freezes or fails, this may mean that you do not have enough RAM."
|
|
||||||
Echo "* You may select N if this happens, but make sure that you have enough storage space."
|
|
||||||
read -p "$(Input 'Memory option? (press Enter/Return if unsure) (Y/n):')" JBMemory
|
|
||||||
[[ $JBMemory != 'N' && $JBMemory != 'n' ]] && ExtraArgs+=" -memory"
|
|
||||||
fi
|
|
||||||
Log "Preparing custom IPSW..."
|
Log "Preparing custom IPSW..."
|
||||||
cd resources
|
cd resources
|
||||||
rm -rf FirmwareBundles
|
rm -rf FirmwareBundles
|
||||||
|
@ -87,6 +87,7 @@ Main() {
|
|||||||
Log "Warning - An error occurred in chmod. This might cause problems..."
|
Log "Warning - An error occurred in chmod. This might cause problems..."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Log "Checking Internet connection..."
|
||||||
if [[ ! $(ping -c1 1.1.1.1 2>/dev/null) ]]; then
|
if [[ ! $(ping -c1 1.1.1.1 2>/dev/null) ]]; then
|
||||||
Error "Please check your Internet connection before proceeding."
|
Error "Please check your Internet connection before proceeding."
|
||||||
fi
|
fi
|
||||||
@ -205,6 +206,7 @@ Main() {
|
|||||||
|
|
||||||
SelectVersion
|
SelectVersion
|
||||||
|
|
||||||
|
echo
|
||||||
Log "Option: $Mode"
|
Log "Option: $Mode"
|
||||||
$Mode
|
$Mode
|
||||||
|
|
||||||
@ -238,6 +240,7 @@ SelectVersion() {
|
|||||||
[[ $Mode == "Downgrade" && $platform != "win" ]] && Selection+=("Other (use SHSH blobs)")
|
[[ $Mode == "Downgrade" && $platform != "win" ]] && Selection+=("Other (use SHSH blobs)")
|
||||||
Selection+=("(Any other key to exit)")
|
Selection+=("(Any other key to exit)")
|
||||||
|
|
||||||
|
echo
|
||||||
Input "Select iOS version:"
|
Input "Select iOS version:"
|
||||||
select opt in "${Selection[@]}"; do
|
select opt in "${Selection[@]}"; do
|
||||||
case $opt in
|
case $opt in
|
||||||
|
Loading…
x
Reference in New Issue
Block a user