Skip to content

Commit

Permalink
make gasgauge-patch also attempt to get past "invalid ticket" error
Browse files Browse the repository at this point in the history
re with patched ticket check is from testingthings (@throwaway167074)
i may or may not remove the prepatched bins later, asr patcher first, then idk about re patcher
  • Loading branch information
LukeZGD committed Feb 15, 2025
1 parent fe052d6 commit 452768e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
Binary file added resources/patch/asr
Binary file not shown.
Binary file added resources/patch/re
Binary file not shown.
30 changes: 15 additions & 15 deletions restore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ For 32-bit devices compatible with restores/downgrades (see README):
--dead-bb Disable bbupdate completely without dumping/stitching baseband
--disable-bbupdate Disable bbupdate and enable dumping/stitching baseband
--gasgauge-patch Enable multipatch to get past "gas gauge" error (aka error 29 in iTunes)
This patch also attempts to get past "invalid ticket" error
--ipsw-hacktivate Enable hacktivation for creating IPSW (iPhone 2G/3G/3GS only)
--ipsw-verbose Enable verbose boot option (3GS and powdersn0w only)
--jailbreak Enable jailbreak option
Expand Down Expand Up @@ -4241,16 +4242,20 @@ ipsw_prepare_multipatch() {
"$dir/hfsplus" RestoreRamdisk.dec grow 30000000

log "Patch ASR"
if [[ $ipsw_prepare_usepowder == 1 && $ipsw_gasgauge_patch != 1 ]]; then
rm -f asr
"$dir/hfsplus" ramdisk2.dec extract usr/sbin/asr
local asrpatch="../resources/firmware/FirmwareBundles/Down_${device_type}_${vers}_${build}.bundle/asr.patch"
if [[ -s "$asrpatch" ]]; then
cp "$asrpatch" .
ipsw_patch_file RestoreRamdisk.dec usr/sbin asr asr.patch
else
"$dir/hfsplus" RestoreRamdisk.dec rm usr/sbin/asr
"$dir/hfsplus" RestoreRamdisk.dec add asr usr/sbin/asr
"$dir/hfsplus" RestoreRamdisk.dec add ../resources/patch/asr usr/sbin/asr
"$dir/hfsplus" RestoreRamdisk.dec chmod 755 usr/sbin/asr
"$dir/hfsplus" RestoreRamdisk.dec chown 0:0 usr/sbin/asr
else
cp ../resources/firmware/FirmwareBundles/Down_${device_type}_${vers}_${build}.bundle/asr.patch .
ipsw_patch_file RestoreRamdisk.dec usr/sbin asr asr.patch
fi
if [[ $ipsw_gasgauge_patch == 1 ]]; then
log "Patch restored_external"
"$dir/hfsplus" RestoreRamdisk.dec rm usr/local/bin/restored_external
"$dir/hfsplus" RestoreRamdisk.dec add ../resources/patch/re usr/local/bin/restored_external
"$dir/hfsplus" RestoreRamdisk.dec chmod 755 usr/local/bin/restored_external
fi

if [[ $device_target_vers == "3.2"* ]]; then
Expand Down Expand Up @@ -5007,11 +5012,6 @@ restore_idevicerestore() {
case $device_target_vers in
[1234]* ) print "* For device activation, go to: Main Menu -> Attempt Activation";;
esac
if [[ $opt != 0 ]]; then
print "* If the restore failed on updating baseband:"
print " -> Try disabling baseband update: ./restore.sh --disable-bbupdate"
echo
fi
print "* Please read the \"Troubleshooting\" wiki page in GitHub before opening any issue!"
print "* Your problem may have already been addressed within the wiki page."
print "* If opening an issue in GitHub, please provide a FULL log/output. Otherwise, your issue may be dismissed."
Expand Down Expand Up @@ -8426,13 +8426,12 @@ menu_flags() {
if (( device_proc >= 7 )); then
menu_items+=("Enable skip-blob flag")
else
menu_items+=("Enable activation-records flag" "Enable jailbreak flag")
menu_items+=("Enable activation-records flag" "Enable jailbreak flag" "Enable gasgauge-patch flag")
if (( device_proc >= 5 )); then
menu_items+=("Enable skip-ibss flag")
fi
fi
case $device_type in
iPhone4,1 ) menu_items+=("Enable gasgauge-patch flag");;
iPhone3,[13] | iPad1,1 | iPod3,1 ) menu_items+=("Enable skip-first flag");;
esac
menu_items+=("Go Back")
Expand Down Expand Up @@ -8497,6 +8496,7 @@ menu_flags() {
print "* This is especially useful for iPhone 4S devices that have issues restoring due to battery replacement."
print "* This issue is called \"gas gauge\" error, also known as error 29 in iTunes."
print "* By enabling this, firmware components for 6.1.3 or lower will be used for restoring to get past the error."
print "* This also attempts to get past \"invalid ticket\" error."
local opt
select_yesno "Do you want to enable the gasgauge-patch flag?" 0
if [[ $? != 0 ]]; then
Expand Down

0 comments on commit 452768e

Please sign in to comment.