fix file picker for "other (custom ipsw)"

This commit is contained in:
LukeeGD 2024-12-06 06:49:45 +08:00
parent 4a346b9c24
commit ce48f7509d

View File

@ -7808,7 +7808,9 @@ menu_ipsw_browse() {
fi fi
menu_items+=("Open File Picker" "Enter Path" "Go Back") menu_items+=("Open File Picker" "Enter Path" "Go Back")
if [[ "${menu_items[0]}" == *".ipsw" ]]; then if [[ $1 == "custom" ]]; then
picker=1
elif [[ "${menu_items[0]}" == *".ipsw" ]]; then
print "* Select $text IPSW Menu" print "* Select $text IPSW Menu"
while true; do while true; do
input "Select an option:" input "Select an option:"
@ -7831,6 +7833,9 @@ menu_ipsw_browse() {
input "Select your $text IPSW file in the file selection window." input "Select your $text IPSW file in the file selection window."
if [[ $mac_cocoa == 1 ]]; then if [[ $mac_cocoa == 1 ]]; then
newpath="$($cocoadialog fileselect --with-extensions ipsw)" newpath="$($cocoadialog fileselect --with-extensions ipsw)"
elif [[ $1 == "custom" ]]; then
menu_zenity_check
newpath="$($zenity --file-selection --file-filter='IPSW | *.ipsw' --title="Select $text IPSW file")"
else else
menu_zenity_check menu_zenity_check
newpath="$($zenity --file-selection --file-filter='IPSW | *Restore.ipsw' --title="Select $text IPSW file")" newpath="$($zenity --file-selection --file-filter='IPSW | *Restore.ipsw' --title="Select $text IPSW file")"
@ -8801,7 +8806,7 @@ restore_customipsw() {
print "* You can exit recovery mode after by going to: Main Menu -> Exit Recovery Mode" print "* You can exit recovery mode after by going to: Main Menu -> Exit Recovery Mode"
fi fi
pause pause
menu_ipsw_browse custom menu_ipsw_browse "custom"
if [[ -z $ipsw_path ]]; then if [[ -z $ipsw_path ]]; then
error "No IPSW selected, cannot continue." error "No IPSW selected, cannot continue."
fi fi