From a58627b102efe232ae4ac3b2bd404c3769bfd75f Mon Sep 17 00:00:00 2001 From: Nebula Date: Sat, 17 Sep 2022 12:26:09 -0400 Subject: [PATCH] further --- palera1n.sh | 48 +++++++++++++++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/palera1n.sh b/palera1n.sh index f57081c..fbf4101 100755 --- a/palera1n.sh +++ b/palera1n.sh @@ -20,6 +20,13 @@ step() { ERR_HANDLER () { [ $? -eq 0 ] && exit echo "[-] An error occurred" + if [ "$os" = 'Darwin' ]; then + if [ ! "$2" = '--dfu' ]; then + defaults write -g ignore-devices -bool false + defaults write com.apple.AMPDevicesAgent dontAutomaticallySyncIPods -bool false + killall Finder + fi + fi } trap ERR_HANDLER EXIT @@ -176,11 +183,13 @@ if [ ! -e boot ]; then $dir/pzb -g Firmware/"$($dir/PlistBuddy BuildManifest.plist -c "Print BuildIdentities:0:Manifest:RestoreRamDisk:Info:Path" | sed 's/"//g')".trustcache $ipswurl > /dev/null fi - echo "[*] Downloading ramdisk" - if [ "$os" = 'Darwin' ]; then - $dir/pzb -g "$(/usr/bin/plutil -extract "BuildIdentities".0."Manifest"."RestoreRamDisk"."Info"."Path" xml1 -o - BuildManifest.plist | grep '' | cut -d\> -f2 | cut -d\< -f1 | head -1)" $ipswurl > /dev/null - else - $dir/pzb -g "$($dir/PlistBuddy BuildManifest.plist -c "Print BuildIdentities:0:Manifest:RestoreRamDisk:Info:Path" | sed 's/"//g')" $ipswurl > /dev/null + if [[ "$@" == *"install"* ]]; then + echo "[*] Downloading ramdisk" + if [ "$os" = 'Darwin' ]; then + $dir/pzb -g "$(/usr/bin/plutil -extract "BuildIdentities".0."Manifest"."RestoreRamDisk"."Info"."Path" xml1 -o - BuildManifest.plist | grep '' | cut -d\> -f2 | cut -d\< -f1 | head -1)" $ipswurl > /dev/null + else + $dir/pzb -g "$($dir/PlistBuddy BuildManifest.plist -c "Print BuildIdentities:0:Manifest:RestoreRamDisk:Info:Path" | sed 's/"//g')" $ipswurl > /dev/null + fi fi echo "[*] Downloading kernelcache" @@ -188,13 +197,16 @@ if [ ! -e boot ]; then echo "[*] Patching and repacking iBSS/iBEC" $dir/iBoot64Patcher iBSS.dec iBSS.patched > /dev/null - $dir/iBoot64Patcher iBEC.dec iBEC.patched -b "-v keepsyms=1 debug=0xfffffffe panic-wait-forever=1 wdt=-1" > /dev/null - # make restore_ibec - $dir/iBoot64Patcher iBEC.patched restore_ibec.patched -b "rd=md0 debug=0x2014e -v wdt=-1" > /dev/null + $dir/iBoot64Patcher iBEC.dec iBEC.patched -b -v "keepsyms=1 debug=0xfffffffe panic-wait-forever=1 wdt=-1" > /dev/null + if [[ "$@" == *"install"* ]]; then + $dir/iBoot64Patcher iBEC.patched restore_ibec.patched -b rd=md0 debug=0x2014e -v "wdt=-1" > /dev/null + fi cd .. $dir/img4 -i work/iBSS.patched -o boot/iBSS.img4 -M work/IM4M -A -T ibss > /dev/null $dir/img4 -i work/iBEC.patched -o boot/iBEC.img4 -M work/IM4M -A -T ibec > /dev/null - $dir/img4 -i work/restore_ibec.patched -o boot/restore_ibec.img4 -M work/IM4M -A -T ibec > /dev/null + if [[ "$@" == *"install"* ]]; then + $dir/img4 -i work/restore_ibec.patched -o boot/restore_ibec.img4 -M work/IM4M -A -T ibec > /dev/null + fi echo "[*] Patching and converting kernelcache" $dir/img4 -i work/"$(awk "/""$model""/{x=1}x&&/kernelcache.release/{print;exit}" work/BuildManifest.plist | grep '' | cut -d\> -f2 | cut -d\< -f1)" -o work/kcache.raw > /dev/null @@ -212,15 +224,17 @@ if [ ! -e boot ]; then $dir/img4 -i work/"$(Linux/PlistBuddy work/BuildManifest.plist -c "Print BuildIdentities:0:Manifest:RestoreRamDisk:Info:Path" | sed 's/"//g')".trustcache -o boot/trustcache.img4 -M work/IM4M -T rtsc > /dev/null fi - echo "[*] Making ramdisk... this may take awhile" - if [ "$os" = 'Darwin' ]; then - $dir/img4 -i work/"$(/usr/bin/plutil -extract "BuildIdentities".0."Manifest"."RestoreRamDisk"."Info"."Path" xml1 -o - work/BuildManifest.plist | grep '' | cut -d\> -f2 | cut -d\< -f1 | head -1)" -o work/ramdisk.dmg > /dev/null - else - $dir/img4 -i work/"$(Linux/PlistBuddy work/BuildManifest.plist -c "Print BuildIdentities:0:Manifest:RestoreRamDisk:Info:Path" | sed 's/"//g')" -o work/ramdisk.dmg > /dev/null + if [[ "$@" == *"install"* ]]; then + echo "[*] Making ramdisk... this may take awhile" + if [ "$os" = 'Darwin' ]; then + $dir/img4 -i work/"$(/usr/bin/plutil -extract "BuildIdentities".0."Manifest"."RestoreRamDisk"."Info"."Path" xml1 -o - work/BuildManifest.plist | grep '' | cut -d\> -f2 | cut -d\< -f1 | head -1)" -o work/ramdisk.dmg > /dev/null + else + $dir/img4 -i work/"$(Linux/PlistBuddy work/BuildManifest.plist -c "Print BuildIdentities:0:Manifest:RestoreRamDisk:Info:Path" | sed 's/"//g')" -o work/ramdisk.dmg > /dev/null + fi + $dir/hfsplus work/ramdisk.dmg grow 300000000 > /dev/null + $dir/hfsplus work/ramdisk.dmg untar installer/ramdisk.tar.gz > /dev/null + $dir/img4 -i work/ramdisk.dmg -o boot/ramdisk.img4 -M work/IM4M -A -T rdsk > /dev/null fi - $dir/hfsplus work/ramdisk.dmg grow 300000000 > /dev/null - $dir/hfsplus work/ramdisk.dmg untar installer/ramdisk.tar.gz > /dev/null - $dir/img4 -i work/ramdisk.dmg -o boot/ramdisk.img4 -M work/IM4M -A -T rdsk > /dev/null fi echo "[*] Booting device"