Path A (checkm8):
- Re-enumerate USB handle between exploit retries; prior code reused the
stale handle after the device reset on a failed attempt, causing
LIBUSB_ERROR_NO_DEVICE on attempts 2 and 3
- Add USB_RECONNECT_DELAY_USEC (2 s) constant; allocate exploit_ctx_t
fresh per attempt so cleanup is symmetric with init
Path B (A12+ bypass):
- Replace broken SET_DESCRIPTOR serial write with libirecovery setenv;
Apple A12+ BootROM always STALLs SET_DESCRIPTOR (LIBUSB_ERROR_PIPE)
- Add step_reboot_to_recovery(): DFU_ABORT -> poll for PID 0x1281
- Add step_reboot_to_normal(): irecv reboot -> poll idevice_get_device_list
- step_session_handshake() now runs after normal-mode reconnect so
dev->handle is valid; previously called with NULL handle (DFU mode)
- Expand path_b_execute() from 9 to 10 steps
Device / DFU:
- usb_dfu_read_info(): emit specific diagnostic when serial is the bare
Apple DFU string (CPID=0); includes per-model button-sequence guidance
start.sh:
- DFU branch: derive support status from binary output instead of
hardcoding SUPPORTED; gate_support() now reachable from DFU path
- parse_device_info(): guard against empty output (binary crash / no
lockdownd); print actionable advice, set DEV_STATUS=UNSUPPORTED
- WSL: detect missing usbipd and print passthrough guidance after first
poll timeout
- Arch Linux: replace exit-1 with AUR install instructions
Tests / build:
- Add tests/test_sections.c: DFU serial parsing, chip DB lookup,
bypass probe logic, retry/reconnect constants (26 tests, no hardware)
- Add `make test` target; test build excludes USB/lockdown modules
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Resolves#2: start.sh fails with "Is a directory" error
Added pre-exec validation to check the binary exists, is a regular file,
and is executable. Improved build failure handling so the script stops
with a clear message instead of trying to exec a missing/invalid binary.
Files modified:
- start.sh
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Resolves#5: LIBUSB_ERROR_PIPE
Root cause: USB control transfers had zero retry logic. LIBUSB_ERROR_PIPE
(-9) is a transient STALL that commonly occurs on A12+ devices during DFU
operations and typically clears on retry. Additionally, path_b_identity.c
called libusb_control_transfer directly, bypassing the usb_helpers wrapper
entirely.
Changes:
- usb_ctrl_transfer/usb_ctrl_transfer_no_data now retry up to 3 times on
PIPE and TIMEOUT errors with 50ms delay between attempts
- usb_print_error provides actionable troubleshooting steps for PIPE errors
- path_b_identity.c now uses usb_ctrl_transfer (retry-aware) instead of
calling libusb_control_transfer directly
- usb_dfu_read_info adds retry logic for serial descriptor reads
- start.sh: handle_dfu_requirement now guides A12+ Path B devices into DFU
(previously only guided checkm8 Path A devices)
- start.sh: DFU-mode detection now queries CPID to correctly identify
Path A vs Path B (previously assumed all DFU devices were Path A)
Files modified:
- src/util/usb_helpers.c
- src/bypass/path_b_identity.c
- src/device/usb_dfu.c
- start.sh
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Resolves#3: [ERROR] No compatible bypass module for this device
Two bugs caused iPhone 15 (A12+, Path B) to get a generic "No compatible
bypass module" error despite being fully supported:
Bug A: select_module() in main.c printed a single unhelpful error line
when bypass_select() returned NULL, with no indication of WHY the device
was rejected. Added print_module_diagnostics() that reports DFU mode
status, CPID, chip name, checkm8 status, product type, and a specific
explanation (not in DFU, CPID unread, chip not in DB).
Bug B: handle_dfu_requirement() in start.sh only guided checkm8 (Path A)
devices into DFU mode. A12+ Path B devices were never prompted for DFU
entry, so the binary was launched with is_dfu_mode=0 and both path probes
rejected the device. Refactored to a shared wait_for_dfu_entry() helper
that is called for ALL supported devices not already in DFU mode.
Files modified:
- src/main.c
- start.sh
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Resolves#1: Unable to locate package libirecovery-dev
The Debian/Ubuntu package is libirecovery-1.0-dev, not libirecovery-dev.
Updated the apt package list in start.sh and README.md.
Files modified:
- start.sh
- README.md
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Cross-platform OS detection (macOS/Linux/WSL), automatic dependency
installation via Homebrew or apt/dnf, auto-build, device connection
polling with timeout, device spec display, supported/unsupported
gating, and DFU mode guidance for Home button vs Face ID devices.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
CLI entry point with --verbose, --dry-run, --detect-only, and
--force-path-a/b flags. Detects DFU mode via libusb first, falls
back to libimobiledevice. Registers Path A and Path B bypass
modules. start.sh guides user through DFU mode entry.
Files created:
- src/main.c
- start.sh
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>