fix: USB re-enum on retry, Path B iRecovery rewrite, DFU diagnostic, tests
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>
This commit is contained in:
parent
ee4e7c56fd
commit
5b758931ac
13 changed files with 1388 additions and 178 deletions
20
Makefile
20
Makefile
|
|
@ -4,7 +4,7 @@ LDFLAGS =
|
|||
|
||||
# Library discovery via pkg-config (warn but do not fail if missing)
|
||||
PKG_LIBS = libimobiledevice-1.0 libirecovery-1.0 libusb-1.0 \
|
||||
libplist-2.0 openssl
|
||||
libplist-2.0 openssl libcurl
|
||||
|
||||
CFLAGS += $(shell pkg-config --cflags $(PKG_LIBS) 2>/dev/null)
|
||||
LDFLAGS += $(shell pkg-config --libs $(PKG_LIBS) 2>/dev/null)
|
||||
|
|
@ -26,6 +26,20 @@ $(TARGET): $(OBJS)
|
|||
|
||||
clean:
|
||||
find src -name '*.o' -delete
|
||||
rm -f $(TARGET)
|
||||
rm -f $(TARGET) $(TEST_TARGET)
|
||||
|
||||
.PHONY: all clean
|
||||
# ------------------------------------------------------------------ #
|
||||
# Test target: compile only hardware-independent units #
|
||||
# ------------------------------------------------------------------ #
|
||||
|
||||
TEST_UNITS = src/device/chip_db.c src/bypass/bypass.c src/util/log.c
|
||||
TEST_TARGET = tests/run_tests
|
||||
TEST_CFLAGS = $(CFLAGS) -Iinclude -DUNIT_TEST
|
||||
|
||||
test: $(TEST_TARGET)
|
||||
./$(TEST_TARGET)
|
||||
|
||||
$(TEST_TARGET): tests/test_sections.c $(TEST_UNITS)
|
||||
$(CC) $(TEST_CFLAGS) -o $@ $^
|
||||
|
||||
.PHONY: all clean test
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue