Skip to content

Add debug mode to patchless#1

Open
retsl wants to merge 11 commits into
mpass99:mainfrom
retsl:main
Open

Add debug mode to patchless#1
retsl wants to merge 11 commits into
mpass99:mainfrom
retsl:main

Conversation

@retsl
Copy link
Copy Markdown

@retsl retsl commented Apr 2, 2026

No description provided.

Copy link
Copy Markdown
Owner

@mpass99 mpass99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome additions to the vphone and especially the patchless variant so people can consciously choose which patches they would like without directly having to disable major parts of iOS security!

I added a few minor comments, just to leave my thoughts 👾

| grep -o 'Allow Research Guests status:.*' || true)
if [[ -n "$_result" ]]; then
echo "(auto-selected: Macintosh HD) $_result"
echo "(auto-selected: ${_boot_vol}) $_result"
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice that you are fixing multi boot! Maybe it would be nice to extract this into a separate PR directly at Lakr233/vphone-cli

Comment thread scripts/setup_machine.sh
JB_MODE=0
DEV_MODE=0
LESS_MODE=0
DEBUG_MODE=0
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With "Debug" I'm mainly associating more verbose output of the tool.
Personally, I would understand it faster if you would rename it to the individual added features (like "DEBUGSERVER_PATCH", "SSH_PATCH", etc)

Comment thread scripts/setup_machine.sh
run_make_sudo "Firmware patch" "$fw_patch_target" "DEBUG=1"
else
run_make_sudo "Firmware patch" "$fw_patch_target"
fi
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

patch_make_runner=run_make
[[ "$LESS_MODE" -ne 0 ]] && patch_make_runner=run_make_sudo
patch_make_args=("Firmware patch" "$fw_patch_target")
if [[ "$DEBUG_MODE" -eq 1 ]]; then
  patch_make_args+=("DEBUG=1")
fi
"$patch_make_runner" "${patch_make_args[@]}"

Comment thread scripts/setup_machine.sh
--jb Use jailbreak firmware patching + jailbreak CFW install.
--dev Use dev firmware patching + dev CFW install.
--less Use patchless firmware patching + CFW install.
--debug Add debug tooling to less variant (SRD, devmode, debugserver, SSH).
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about making this more flexible - not bound to the "less" variant, but rather as general options to ensure specific patches? Etc. the regular mode might also want to have the SRD patch etc.. We could also split this into multiple flags.. This PR should not contain everything, but if it's not much more than changing the description that might be more maintainable..

Comment thread scripts/setup_tools.sh
echo "[1/5] Checking brew packages..."

BREW_PACKAGES=(aria2 gnu-tar openssl@3 ldid-procursus sshpass)
BREW_PACKAGES=(aria2 gnu-tar openssl@3 ldid-procursus sshpass dropbear)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need the dropbrear brew package (when you install dropbear via the cfw_input)?

try patchDebugserver(targetMount: targetMount, cfwInput: cfwInputPath)

print("- Add dropbear (SSH)")
try addDropbear(targetMount: targetMount, cfwInput: cfwInputPath)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super nice features. Maybe it would be nice to add them with two different flags (best, in two different commits)

try FileManager.default.createDirectory(at: launchDaemonsPath, withIntermediateDirectories: false)
try FileManager.default.moveItem(at: launchdOgPath, to: launchdPath)
try FileManager.default.copyItem(at: vphonedLaunchdPlist, to: launchDaemonsPath.appending(path: vphonedLaunchdPlist.lastPathComponent))
// Include SSH daemon plists so inject-daemons registers them in launchd
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not expect this in the "addVphone" function. Maybe you can extract the "inject-daemons" patch into a new function next to the "patchLaunchdCacheLoader" call.

https://github.com/Lakr233/vphone-cli/blob/981f2cfcc9d704beba8ae6add69b8b3cc9c5b2ed/scripts/cfw_install.sh#L494-L500

"-convert", "xml1", "-o", researchEntPath.path, stockEntPath.path
])

// Merge SRD entitlements on top of stock (matching Apple's SRD tooling approach).
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see, the debugserver patch depends on the SRD patch for the less variant.. Maybe it still makes sense to have the SRD patch controlled with a different flag and just automatically apply the SRD patch for the debugserver patch (+ documentation) 🤷

Comment on lines +418 to +424
for name in ["dropbear.plist", "bash.plist"] {
let src = daemonPlistsDir.appending(path: name)
let dst = launchDaemonsDir.appending(path: name)
if fm.fileExists(atPath: src.path) && !fm.fileExists(atPath: dst.path) {
try fm.copyItem(at: src, to: dst)
}
}
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate with lines 217-223?

Comment thread Makefile
exit 1; \
fi; \
"$(CURDIR)/$(PATCHER_BINARY)" patch-firmware --vm-directory "$(CURDIR)/$(VM_DIR)" --variant less'
"$(CURDIR)/$(PATCHER_BINARY)" patch-firmware --vm-directory "$(CURDIR)/$(VM_DIR)" --variant less $(if $(filter 1 true yes YES TRUE,$(DEBUG)),--debug,)'
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When we split the functionality into multiple flags, some of the flags might also be valid for the other variants

@mpass99 mpass99 force-pushed the main branch 4 times, most recently from 3658f13 to 1d67b35 Compare April 8, 2026 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants