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