From 096e731044aed421d3dc78ad39adab56e2f75220 Mon Sep 17 00:00:00 2001 From: Sam Heinz Date: Mon, 21 Nov 2022 10:05:54 +1000 Subject: [PATCH] Fix A8X (#253) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update palera1n.sh * Update palera1n.sh * Update palera1n.sh * Update palera1n.sh * pretty sure that does what asdfugil asked * add cpid detect for a8x * add consideration for a8x cellular Signed-off-by: Sam Heinz * Revert "add consideration for a8x cellular" This reverts commit c77fe0657bbd8246f804595872f080964cc616c3. * Revert "Revert "add consideration for a8x cellular"" This reverts commit 0c777e97341a4d745bea6d449c7e645f1c5c56e9. Signed-off-by: Sam Heinz Co-authored-by: ささ <91324887+sasa8810@users.noreply.github.com> --- palera1n.sh | 36 +++++++++++++----------------------- 1 file changed, 13 insertions(+), 23 deletions(-) diff --git a/palera1n.sh b/palera1n.sh index c3e99cf..755dc8e 100755 --- a/palera1n.sh +++ b/palera1n.sh @@ -18,6 +18,7 @@ commit=$(git rev-parse --short HEAD) branch=$(git rev-parse --abbrev-ref HEAD) max_args=1 arg_count=0 +disk = 8 # ========= # Functions @@ -536,8 +537,13 @@ if [ ! -f blobs/"$deviceid"-"$version".shsh2 ]; then done echo "[*] Testing for baseband presence" - if [ "$(remote_cmd "/usr/bin/mgask HasBaseband | grep -E 'true|false'")" = "false" ]; then - no_baseband=1 + if [ "$(remote_cmd "/usr/bin/mgask HasBaseband | grep -E 'true|false'")" = "true" ] && [ "${cpid}" == *"0x7001"* ]; then + disk = 7 + elif [ "$(remote_cmd "/usr/bin/mgask HasBaseband | grep -E 'true|false'")" = "false" ]; then + if [ "${cpid}" == *"0x7001"* ]; then + disk = 6 + else + disk = 7 fi remote_cmd "/usr/bin/mount_filesystems" @@ -554,11 +560,7 @@ if [ ! -f blobs/"$deviceid"-"$version".shsh2 ]; then if [ "$restorerootfs" = "1" ]; then echo "[*] Removing Jailbreak" - if [ "$no_baseband" = "1" ]; then - remote_cmd "/sbin/apfs_deletefs disk0s1s7 > /dev/null || true" - else - remote_cmd "/sbin/apfs_deletefs disk0s1s8 > /dev/null || true" - fi + remote_cmd "/sbin/apfs_deletefs disk0s1s${disk} > /dev/null || true" remote_cmd "rm -f /mnt2/jb" remote_cmd "rm -rf /mnt2/cache /mnt2/lib" remote_cmd "rm -f /mnt6/$active/System/Library/Caches/com.apple.kernelcaches/kcache.raw /mnt6/$active/System/Library/Caches/com.apple.kernelcaches/kcache.patched /mnt6/$active/System/Library/Caches/com.apple.kernelcaches/kcache.im4p /mnt6/$active/System/Library/Caches/com.apple.kernelcaches/kernelcachd" @@ -584,11 +586,7 @@ if [ ! -f blobs/"$deviceid"-"$version".shsh2 ]; then echo "[*] Creating fakefs, this may take a while (up to 10 minutes)" remote_cmd "/sbin/newfs_apfs -A -D -o role=r -v System /dev/disk0s1" sleep 2 - if [ "$no_baseband" = "1" ]; then - remote_cmd "/sbin/mount_apfs /dev/disk0s1s7 /mnt8" - else - remote_cmd "/sbin/mount_apfs /dev/disk0s1s8 /mnt8" - fi + remote_cmd "/sbin/mount_apfs /dev/disk0s1s${disk} /mnt8" sleep 1 remote_cmd "cp -a /mnt1/. /mnt8/" @@ -742,18 +740,10 @@ if [ ! -f boot-"$deviceid"/ibot.img4 ]; then echo "[*] Patching and signing iBSS/iBoot" "$dir"/iBoot64Patcher iBSS.dec iBSS.patched if [ "$semi_tethered" = "1" ]; then - if [ "$no_baseband" = "1" ]; then - if [ "$verbose" = "1" ]; then - "$dir"/iBoot64Patcher ibot.dec ibot.patched -b '-v keepsyms=1 debug=0x2014e rd=disk0s1s7' -f - else - "$dir"/iBoot64Patcher ibot.dec ibot.patched -b 'keepsyms=1 debug=0x2014e rd=disk0s1s7' -f - fi + if [ "$verbose" = "1" ]; then + "$dir"/iBoot64Patcher ibot.dec ibot.patched -b "-v keepsyms=1 debug=0x2014e rd=disk0s1s${disk}" -f else - if [ "$verbose" = "1" ]; then - "$dir"/iBoot64Patcher ibot.dec ibot.patched -b '-v keepsyms=1 debug=0x2014e rd=disk0s1s8' -f - else - "$dir"/iBoot64Patcher ibot.dec ibot.patched -b 'keepsyms=1 debug=0x2014e rd=disk0s1s8' -f - fi + "$dir"/iBoot64Patcher ibot.dec ibot.patched -b "keepsyms=1 debug=0x2014e rd=disk0s1s${disk}" -f fi else if [ "$verbose" = "1" ]; then