Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Linux/apfs-fuse
Binary file not shown.
Binary file modified Linux/iBoot64Patcher
Binary file not shown.
Binary file added Linux/newfs_hfs
Binary file not shown.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <iOS version for ramdisk>`, **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
Expand Down Expand Up @@ -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+
28 changes: 17 additions & 11 deletions sshrd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 '<string>' |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
Expand Down Expand Up @@ -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
Expand All @@ -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"
Expand Down