Skip to content
This repository was archived by the owner on Nov 7, 2024. It is now read-only.

Commit 4d0071f

Browse files
committed
updated ipatool
1 parent b546eea commit 4d0071f

File tree

1 file changed

+20
-30
lines changed

1 file changed

+20
-30
lines changed

azule

Lines changed: 20 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ while getopts Hn:i:o:c:b:x:f:p:huSewsrDHqAdRyUzgFLklv args; do
471471
n) name="${tmp[*]}" ;;
472472
o) outdir="$(expand "${tmp[*]}")" ;;
473473
p) displayname="${tmp[*]}" && run=1 ;;
474-
x) appleid="${tmp[0]}" && unset "tmp[0]" && appleid_password="${tmp[*]}" ;;
474+
x) IPATOOL_EMAIL="${tmp[0]}" && unset "tmp[0]" && IPATOOL_PASSWORD="${tmp[*]}" ;;
475475

476476
# SWITCHES
477477
e) remove_extensions=1 && run=1 ;;
@@ -673,41 +673,31 @@ if [[ ! -e "$ipadir" && "$os" == "iOS" ]]; then
673673
if [ -n "$outdated" ] || { [ -n "$latestv" ] && [[ "$latestv" != "$currentv" || -n "$thinned" ]]; }; then
674674
Announce "Update Available"
675675

676-
# VARIABLE CHECK
677-
if [ -z "$appleid" ]; then while
678-
printf '[*] Apple ID: '
679-
read -r appleid
680-
[ -z "$appleid" ] && Announce "No Apple ID Provided"
681-
do true; done; fi
682-
683-
if [ -z "$appleid_password" ]; then while
684-
printf '[*] Password for Apple ID: '
685-
read -r -s appleid_password
686-
[ -z "$appleid_password" ] && Announce "No Password Provided"
687-
do true; done; fi
688-
printf "\n"
676+
if [[ ! -e "$azule/ipatool_authenticated" || -n "$IPATOOL_EMAIL" ]]; then
677+
678+
# VARIABLE CHECK
679+
if [ -z "$IPATOOL_EMAIL" ]; then while
680+
printf '[*] Apple ID: '
681+
read -r IPATOOL_EMAIL
682+
[ -z "$IPATOOL_EMAIL" ] && Announce "No Apple ID Provided"
683+
do true; done; fi
689684

690-
# DOWNLOAD AND INSTALL UPDATES
691-
Announce "Downloading $ipadir..."
692-
ipatool-azule download -b "$ipadir" -e "$appleid" -p "$appleid_password"
693-
t_status="$?"
694-
if [ "$t_status" == "1" ]; then
695-
Announce "2FA Code Required"
696-
if [ -z "$auth_code" ]; then while
697-
printf '[*] Two Factor Authentication Code: '
698-
read -r -s auth_code
699-
[ -z "$auth_code" ] && Announce "No 2FA Code Specified"
685+
if [ -z "$IPATOOL_PASSWORD" ]; then while
686+
printf '[*] Password for Apple ID: '
687+
read -r -s IPATOOL_PASSWORD
688+
[ -z "$IPATOOL_PASSWORD" ] && Announce "No Password Provided"
700689
do true; done; fi
701690
printf "\n"
702691

703-
Announce "Attempting Download Again..."
704-
ipatool-azule download -b "$ipadir" -e "$appleid" -p "$appleid_password$auth_code"
705-
status="$?"
706-
elif [ "$t_status" != "0" ]; then
707-
status=1
692+
ipatool auth login -e "$IPATOOL_EMAIL" -p "$IPATOOL_PASSWORD" &>/dev/null
693+
Verbose "Succesfully Authenticated" "Failed Authenticating" 34
694+
echo -n > "$azule/ipatool_authenticated"
708695
fi
709696

710-
Verbose "Downloaded $ipadir" "Couldn't Download $ipadir" 28 -x
697+
# DOWNLOAD AND INSTALL UPDATES
698+
Announce "Downloading $ipadir..."
699+
ipatool download -b "$ipadir" --purchase
700+
Verbose "Downloaded $ipadir" "Couldn't Download $ipadir" 28
711701

712702
Announce "Installing $(basename "$dir"/*.ipa) ..."
713703
appinst "$dir"/*.ipa &>/dev/null

0 commit comments

Comments
 (0)