Commit Graph

105 Commits

Author SHA1 Message Date
Lakr
048f4c7cc1 docs: fix outdated patch counts, remove process investigation notes
- Update firmware variant table (CLAUDE.md, AGENTS.md): correct patch
  totals to 51/64/126, add VPhoneMenuBattery.swift, setup_venv_linux.sh,
  tail_jb_patch_logs.sh to architecture tree
- kernel_patcher_verification.md: 25→26 patches (patch_apfs_get_dev_by_role)
- kernel_patch_sandbox.py: docstring 16-25→17-26
- kernel_patch_sandbox_hooks: consolidate to single 17-26 validation file
- txm_jb_patches.md: fix txm_jb.py references → txm_dev.py
- 0_binary_patch_comparison.md: split kernel counts (28 base + 59 JB methods)
- kernel_jb_patch_notes.md: add 2026-03-06 retarget notes for bsd_init_auth,
  io_secure_bsd_root, vm_fault_enter_prepare
- Remove 7 boot investigation process notes (boot_*.md)
2026-03-07 18:23:34 +08:00
Lakr
b3ed19232b Update resources 2026-03-07 18:07:46 +08:00
Lakr
b9b462d23f JB install: use external insert_dylib, preserve launchd entitlements, deploy pre-built dylibs
- Replace Python cfw_inject_dylib.py with tyilo/insert_dylib (built by setup_tools)
- Use --weak flag for LC_LOAD_WEAK_DYLIB injection (avoids crash on missing dylib)
- Preserve original launchd entitlements on re-sign (fixes "operation not permitted")
- Deploy dylibs from pre-built basebin payload instead of building from source
- Remove launchdhook, systemhook, treblehook sources (no longer needed)
- Print GDB debug stub port after VM starts
- Cleanup: remove test scripts, rename patch comparison doc
2026-03-07 18:07:27 +08:00
Lakr
6c4165c7fe docs: fix formatting in kernel_patch_jb MD files
Apply whitespace and formatting cleanups across research/kernel_patch_jb/*.md: add missing blank lines for readability, remove extraneous trailing blank lines, and adjust a small inline spacing/punctuation in patch_vm_map_protect.md. No semantic changes to content.
2026-03-06 23:11:14 +08:00
Lakr
73bc732349 Squash JB patch retarget and matcher cleanup 2026-03-06 23:06:32 +08:00
Lakr
fd8e8d184c Squash merge iunctqwiocmfxhigkcunamxoi into main
Included commits:

- f8a54b8 Update JB kernel patch research notes
  Refresh and revalidate jailbreak kernel-patcher documentation and runtime-verification notes. Key updates: re-analyzed B13 (patch_bsd_init_auth) and retargeted recommended site to the FSIOC_KERNEL_ROOTAUTH return check in bsd_init rather than the old ldr/cbz/bl heuristic; clarified preferred NOP-of-CBNZ vs forcing ioctl return. Reworked C21 (patch_cred_label_update_execve) to preserve AMFI exec-time flow and instead clear restrictive csflags in a success-tail trampoline; disabled in default schedule until boot validation. Documented that C23 (patch_hook_cred_label_update_execve) was mis-targeting the wrapper (sub_FFFFFE00093D2CE4) instead of the real hook body (_hook_cred_label_update_execve), explaining boot failures and recommending retargeting. Noted syscallmask and vm_fault matcher problems (patch_syscallmask_apply_to_proc historical hit targeted _profile_syscallmask_destroy; patch_vm_fault_enter_prepare matcher resolves to pmap_lock_phys_page path), and updated the runtime-verification summary with follow-up findings and which methods are temporarily commented out/disabled in the default KernelJBPatcher schedule pending staged re-validation.
- 6ebac65 fix: patch_bsd_init_auth
- 5b224d3 fix: patch_io_secure_bsd_root
- e6806bf docs: update patch notes
- 0d89c5c Retarget vm_fault_enter_prepare jailbreak patch
- 6b9d79b Rework C21 late-exit cred_label patch
- ece8cc0 Clean C21 mov matcher encodings
- ad2ea7c enabled fixed patch_cred_label_update_execve
- c37b6b1 Rebuild syscallmask C22 patch
- 363dd7a Rebuild JB C23 as faithful upstream trampoline
- 129e648 Disable IOUC MACF; rebuild kcall10 & C22 docs
  Re-evaluate and rework several JB kernel patches and docs: mark patch_iouc_failed_macf as reverted/disabled (repo-local, over-broad early-return) and replace its patcher with a no-op implementation to emit zero writes by default; update research notes to explain the reanalysis and rationale. Rebuild patch_kcall10: replace the historical 10-arg design with an ABI-correct syscall-439 cave (target + 7 args -> uint64 return), add a new cave builder and munge32 reuse logic in the kcall10 patcher, and enable the method in KernelJBPatcher group. Clarify syscallmask (C22) semantics in docs: upstream C22 is an all-ones-mask retarget (not a NULL install) and keep the rebuilt all-ones wrapper as the authoritative baseline. Misc: minor refactors and helper additions (chained-pointer helpers, cave size/constants, validation and dry-run safeguards) to improve correctness and alignment with IDA/runtime verification.
- e1b2365 Rebuild kcall10 as ABI-correct syscall cave
- 23090d0 fix patch_iouc_failed_macf
- 0056be2 Normalize formatting in research docs
  Apply whitespace and formatting cleanup across research markdown files for consistency and readability. Adjust table alignment and spacing in 00_patch_comparison_all_variants.md, normalize list/indentation spacing in patch_bsd_init_auth.md and patch_syscallmask_apply_to_proc.md, and add/clean blank lines and minor spacing in patch_kcall10.md. These are non-functional documentation changes only.
2026-03-06 19:08:16 +08:00
Lakr
956642b8ad Update kernel_jb.py 2026-03-06 13:50:25 +08:00
Lakr
d9c93ec703 Harden ramdisk mounts and enforce strict iproxy UDID isolation 2026-03-06 13:38:42 +08:00
Lakr
4c18166be5 Automate JB patch testing workflow and update patch schedules 2026-03-06 13:31:22 +08:00
Lakr
239476ee38 Use auto kernel debug port by default and tighten manual range 2026-03-06 13:23:51 +08:00
Lakr
69282a897a Wait for USBMux enumeration before iproxy target resolution 2026-03-06 13:12:26 +08:00
Lakr
9c6983ba9c Merge branch 'machine-isolation'
# Conflicts:
#	Makefile
#	scripts/ramdisk_send.sh
#	scripts/setup_machine.sh
2026-03-06 13:05:11 +08:00
Lakr
40599d461d Fix ramdisk identity mismatch and add USBMux UDID patching 2026-03-06 13:02:25 +08:00
Lakr
e08850a45e Isolate multi-VM setup with deterministic device targeting (#119) 2026-03-06 12:47:30 +08:00
Lakr
b50b630d19 Isolate multi-VM setup with deterministic device targeting 2026-03-06 12:46:12 +08:00
TastyHeadphones
5c2bce03dd build: preserve swift build failures in make target (#115) 2026-03-06 10:50:21 +08:00
Lakr
e3391d9ea2 Update kernel_jb.py 2026-03-06 03:26:11 +08:00
Lakr
4111b74d7a Refactor patch comparison doc; remove unused import
Reflow and standardize research/00_patch_comparison_all_variants.md: reorganized and simplified tables, normalized headings, clarified Kernel vs JB patch lists, updated ramdisk and CFW matrices, and refreshed aggregate counts (e.g. grand totals and kernel/JB method summaries). Minor formatting and wording improvements throughout the document for readability and consistency. Also removed an unused import (os) from scripts/patchers/kernel_jb.py to clean up the code.
2026-03-06 03:15:42 +08:00
Lakr
4c0430f63e Update .gitignore 2026-03-06 02:50:33 +08:00
Lakr
5388e0c9c5 Squash merge startup-hang-fix into main
Prefix research patch comparison doc and normalize root markdown names

Rename research root markdown files to scoped topic names
2026-03-06 02:42:12 +08:00
zqxwce
4cdff73e8c Merge pull request #112 from zqxwce/bugfix/debugserver-already-resigned
dev_mode: Fix exit if debugserver already patched
2026-03-06 00:01:58 +08:00
zqxwce
8e9aba1224 Merge pull request #111 from zqxwce/feature/amfidont_readme
readme: Add `amfidont` as an option
2026-03-06 00:01:32 +08:00
TastyHeadphones
018b54fb94 Merge pull request #110 from TastyHeadphones/codex/control-request-timeout-cancel
Add request timeout and cancellation handling in VPhoneControl
2026-03-06 00:00:21 +08:00
Lakr
84cc863b5d Merge pull request #108 from zqxwce/feature/entitlements-debugserver
dev_mode: Patch entitlements for debugserver
2026-03-05 18:24:01 +08:00
zqxwce
95a457ce30 dev_mode: Patch entitlements for debugserver 2026-03-05 11:59:46 +02:00
Lakr
7d161d25fc Merge pull request #106 from TastyHeadphones/codex/location-presets-route-replay
Add location presets and route replay controls
2026-03-05 10:24:30 +08:00
Lakr
cb7754334f Merge pull request #105 from McNight/fix/file-transfer-error-alert
fix: show alert on file transfer failure in File Browser
2026-03-05 10:24:19 +08:00
tastyheadphones
fc96e4439d research: drop unrelated patch comparison note from PR 2026-03-05 09:34:19 +09:00
tastyheadphones
596083f30f location: add presets and route replay controls 2026-03-05 09:31:06 +09:00
McNight
e8cb15fa72 fix: show alert on file transfer failure in File Browser
- Upload errors were silently cleared by refresh() before the alert
  could fire; fix by setting self.error after refresh()
- Unreadable local files were skipped silently; now surfaces an error
- Upload loop continued past failures unlike downloads; now breaks early
- Drag-and-drop with no resolvable URLs was silent; now shows an error

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-05 00:32:26 +01:00
Lakr
203d1a1e1e Merge branch 'startup-hang-fix' 2026-03-05 03:08:10 +08:00
Lakr
d62174755f Update testing_exec.sh 2026-03-05 03:07:47 +08:00
Lakr
2c65c9e109 Update boot-hang_b19_mount_dounmount_strategy_compare.md 2026-03-05 03:06:39 +08:00
Lakr
6d3331ef37 Merge pull request #104 from Lakr233/startup-hang-fix
Startup hang fix
2026-03-05 03:01:42 +08:00
Lakr
560423e391 Create boot-hang_b19_mount_dounmount_strategy_compare.md 2026-03-05 02:57:54 +08:00
Lakr
4669bfbd17 Update testing_exec.sh
Update testing_exec.sh

Update Makefile
2026-03-05 02:57:49 +08:00
Lakr
ba52c2274f skip C22 2026-03-05 02:08:19 +08:00
Lakr
f16a1eed37 squash: merge work-jb-next into main 2026-03-05 01:58:35 +08:00
Lakr
6d0c2c5261 Merge pull request #103 from Lakr233/work-jb-next
Add kernel GDB debug stub option and validation
2026-03-05 01:08:51 +08:00
Lakr
8545dbd9bb Add kernel GDB debug stub option and validation
Introduce a kernel debug port option and wire it through the CLI and VM configuration. Adds a --kernelDebugPort CLI option (default 5909), a kernelDebugPort field in VPhoneVirtualMachine.Options, and validation (1..65535) that throws VPhoneError.invalidKernelDebugPort on invalid values. Configure the VM to use a fixed host GDB debug stub port when possible (with system-assigned fallback) and print the chosen stub info from the AppDelegate. Also include a small menu styling tweak (comma-style) in VPhoneMenuBattery.
2026-03-05 01:05:14 +08:00
Lakr
fdc3e28ae3 Squash merge JB kernel runtime optimizations and testing workflow 2026-03-05 00:33:18 +08:00
Lakr
89f0f698af Merge pull request #100 from TastyHeadphones/codex/setup-machine-ramdisk-panic-detect
setup_machine: fail early on ramdisk panic while waiting for SSH
2026-03-04 23:19:19 +08:00
Lakr
ce0dfff9c6 Merge pull request #102 from xcxmiku/feature/battery-simulation
Add synthetic battery simulation via Virtualization.framework private…
2026-03-04 23:18:47 +08:00
Lakr
964c7d9cd8 docs: add JB mount failure investigation and link from patch comparison 2026-03-04 22:34:36 +08:00
Lakr
8575bef264 Support ramdisk kernel split and snapshot
Add ramdisk-specific kernel snapshot and build logic so the installer ramdisk can boot with a conservative kernel while the restore target keeps the fully JB-patched kernel. Changes:

- research/patch_comparison_all_variants.md: document the Ramdisk Kernel Split and intent.
- scripts/fw_patch_jb.py: snapshot the base/dev-patched kernel before applying JB extensions (new helper and constants).
- scripts/ramdisk_build.py: build krnl.ramdisk.img4 from the snapshot and krnl.img4 from the restore kernel when a snapshot exists; factor kernel IMG4 creation into build_kernel_img4.
- scripts/ramdisk_send.sh: prefer krnl.ramdisk.img4 when present, falling back to krnl.img4; fail early if no kernel image found.

This improves /dev/disk1s1 remount reliability during CFW/install by keeping the restore kernel JB-patched but booting the installer ramdisk with a more conservative kernel variant.
2026-03-04 22:26:06 +08:00
xcxmiku
872bc98c3a Add synthetic battery simulation via Virtualization.framework private API
Use _VZMacSyntheticBatterySource to inject a virtual power source into the
guest VM. The guest kernel's AppleVirtualPlatformPowerSource driver picks it
up automatically via VirtIO, giving iOS a real battery indicator without any
guest-side changes.

- Default: 100% charge, charging state
- Runtime-adjustable via setBattery(charge:connectivity:)
- Battery menu in menu bar with level presets and charging toggle
2026-03-04 22:25:23 +08:00
Lakr
db5a2886fa Enable A2/C23/C24 JB kernel patches in runtime dispatcher 2026-03-04 22:09:12 +08:00
Lakr
adbb3ec085 Improve remote_mount checks and snapshot selection
Ensure target mountpoint exists and verify mounts succeed in remote_mount across cfw_install scripts: create the directory with mkdir -p, short-circuit if already mounted, attempt mount_apfs, and fail with a clear error if the mount did not occur. Also replace the grep|head pipeline with an awk extraction to safely pick the first com.apple.os.update snapshot when renaming to orig-fs.
2026-03-04 22:06:20 +08:00
Lakr
cb63ffa3b2 Remove temporary testing scripts and Makefile targets
These were used for per-patch kernel JB debugging (C23 bisect,
single-patch boot test, batch testing). No longer needed now that
A2, C23, and C24 are all boot-tested and fixed.
2026-03-04 21:43:02 +08:00
Lakr
abaa039496 Merge branch 'kcp_pt_jb' 2026-03-04 21:41:56 +08:00