diff --git a/Linux/apfs-fuse b/Linux/apfs-fuse new file mode 100755 index 0000000..9f355bf Binary files /dev/null and b/Linux/apfs-fuse differ diff --git a/Linux/iBoot64Patcher b/Linux/iBoot64Patcher index 6dbd321..dae40c7 100755 Binary files a/Linux/iBoot64Patcher and b/Linux/iBoot64Patcher differ diff --git a/Linux/newfs_hfs b/Linux/newfs_hfs new file mode 100755 index 0000000..f22f70a Binary files /dev/null and b/Linux/newfs_hfs differ diff --git a/README.md b/README.md index 5ac6322..f6feb7a 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,6 @@ Create and boot a SSH ramdisk on checkm8 devices - If you have cloned this before, run `cd SSHRD_Script && git pull` to pull new changes 2. Run `./sshrd.sh `, **without** the `<>`. - The iOS version doesn't have to be the version you're currently on, but it should be close enough, and SEP has to be compatible - - If you're on Linux, you will not be able to make a ramdisk for 16.1+, please use something lower instead, like 16.0 - - This is due to ramdisks switching to APFS over HFS+, and another dmg library would have to be used 3. Place your device into DFU mode - A11 users, go to recovery first, then DFU. 4. Run `./sshrd.sh boot` to boot the ramdisk @@ -65,3 +63,4 @@ sudo usbmuxd -p -f - [Nebula](https://github.com/itsnebulalol) for a bunch of QOL fixes to this script - [OpenAI](https://chat.openai.com/chat) for converting [kerneldiff](https://github.com/mcg29/kerneldiff) into [C](https://github.com/verygenericname/kerneldiff_C) - [Ploosh](https://github.com/plooshi) for KPlooshFinder +- [hiylx](https://github.com/hiylx) for linux APFS support on iOS 16.1+ diff --git a/sshrd.sh b/sshrd.sh index f70c507..a684f6b 100755 --- a/sshrd.sh +++ b/sshrd.sh @@ -273,7 +273,6 @@ fi "$oscheck"/img4 -i work/iBSS.patched -o sshramdisk/iBSS.img4 -M work/IM4M -A -T ibss "$oscheck"/iBoot64Patcher work/iBEC.dec work/iBEC.patched -b "rd=md0 debug=0x2014e -v wdt=-1 `if [ -z "$2" ]; then :; else echo "$2=$3"; fi` `if [ "$check" = '0x8960' ] || [ "$check" = '0x7000' ] || [ "$check" = '0x7001' ]; then echo "nand-enable-reformat=1 -restore"; fi`" -n "$oscheck"/img4 -i work/iBEC.patched -o sshramdisk/iBEC.img4 -M work/IM4M -A -T ibec - "$oscheck"/img4 -i work/"$(awk "/""${replace}""/{x=1}x&&/kernelcache.release/{print;exit}" work/BuildManifest.plist | grep '' |cut -d\> -f2 |cut -d\< -f1)" -o work/kcache.raw "$oscheck"/KPlooshFinder work/kcache.raw work/kcache.patched "$oscheck"/kerneldiff work/kcache.raw work/kcache.patched work/kc.bpatch @@ -351,12 +350,21 @@ if [ "$oscheck" = 'Darwin' ]; then fi else if [ "$darwin_major" -gt 22 ] || ([ "$darwin_major" -eq 22 ] && ([ "$minor" -gt 1 ] || [ "$minor" -eq 1 ] && [ "$patch" -ge 0 ])); then - echo "Sorry, 16.1 and above doesn't work on Linux at the moment!" - exit - else - : - fi - if [ "$check" = "0x8012" ]; then + echo iOS 16.1+ used, converting APFS ramdisk to HFS+ + mkdir -p /tmp/SSHRD_APFS + mkdir -p /tmp/SSHRD_HFS + "$oscheck"/apfs-fuse -o allow_other work/ramdisk.dmg /tmp/SSHRD_APFS + dd if=/dev/zero of=work/ramdisk1.dmg bs=1M count=400 + "$oscheck"/newfs_hfs -v SSHRD work/ramdisk1.dmg + mount -o loop work/ramdisk1.dmg /tmp/SSHRD_HFS + rsync -a /tmp/SSHRD_APFS/root/ /tmp/SSHRD_HFS/ + tar -xf sshtars/ssh.tar -C /tmp/SSHRD_HFS/ + umount /tmp/SSHRD_HFS + umount /tmp/SSHRD_APFS + rm -rf /temp/SSHRD_HFS + rm -rf /temp/SSHRD_APFS + echo APFS Converted to HFS Successfully + elif [ "$check" = "0x8012" ]; then "$oscheck"/hfsplus work/ramdisk.dmg grow 133169152 > /dev/null else "$oscheck"/hfsplus work/ramdisk.dmg grow 210000000 > /dev/null @@ -383,18 +391,16 @@ else else : fi + if [ "$darwin_major" -lt 22 ] || ([ "$darwin_major" -eq 22 ] && ([ "$minor" -lt 1 ])); then "$oscheck"/hfsplus work/ramdisk.dmg untar sshtars/ssh.tar > /dev/null + fi fi fi -if [ "$oscheck" = 'Darwin' ]; then if [ "$darwin_major" -gt 22 ] || ([ "$darwin_major" -eq 22 ] && ([ "$minor" -gt 1 ] || [ "$minor" -eq 1 ] && [ "$patch" -ge 0 ])); then "$oscheck"/img4 -i work/ramdisk1.dmg -o sshramdisk/ramdisk.img4 -M work/IM4M -A -T rdsk else "$oscheck"/img4 -i work/ramdisk.dmg -o sshramdisk/ramdisk.img4 -M work/IM4M -A -T rdsk fi -else -"$oscheck"/img4 -i work/ramdisk.dmg -o sshramdisk/ramdisk.img4 -M work/IM4M -A -T rdsk -fi "$oscheck"/img4 -i other/bootlogo.im4p -o sshramdisk/logo.img4 -M work/IM4M -A -T rlgo echo "" echo "[*] Cleaning up work directory"