| Age | Commit message (Collapse) | Author | Files | Lines |
|
The device can reboot while idevicerestore is busy with slow steps such
as downloading the IPSW (-l) or extracting the filesystem. E.g. a device
in Recovery mode may time out and reboot to Normal mode. client->mode
then ends up as MODE_UNKNOWN, and later calls like get_ap_nonce() fail
with the unhelpful "Device is in an invalid state" error.
Add resync_device_mode(), which waits up to 60 seconds for the device to
reappear and logs when the mode changed. Call it after the on-demand
IPSW download and after the filesystem extraction. If the device
returned in Normal mode, refresh the cached product/build version, which
is factored out into refresh_device_version().
|
|
The loop that reads gzip compressed data grew its buffer with
bin = realloc(bin, bufsize), so on out-of-memory the buffer was
leaked and the next gzread() wrote through a NULL pointer.
Check the result and fail the same way as the gzread() error just
above.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
fls_parse_elements() assigned the result of realloc() directly to
fls->elements, so on out-of-memory the array was leaked and the next
store wrote through a NULL pointer.
Grow the array before allocating the next element and stop parsing if
that fails. Doing it first means there is nothing to clean up on the
error path (a 0x0c element is also referenced by fls->c_element), and
the elements parsed so far stay valid for fls_free().
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
download_write_buffer_callback() and _curl_write_callback() assigned
the result of realloc() directly to response->content, so on
out-of-memory the data received so far was leaked and the following
memcpy() wrote through a NULL pointer.
Keep the existing buffer on failure and return 0 so that curl aborts
the transfer with CURLE_WRITE_ERROR.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Replace the single-line progress bar with a terminal renderer that
shows one row per active progress tag. The overall restore step
(Uploading/Verifying filesystem, Flashing firmware) is a reserved
"global" bar that is always drawn first. Per-component bars (e.g.
SEP, RestoreRamDisk) appear below it and disappear when finalized.
- Redraw in place with ANSI cursor movement; clamp line width to the
terminal width (ioctl on Unix, console API on Windows, with virtual
terminal mode enabled)
- Erase and redraw the bars around logger() output so log lines no
longer corrupt the display
- Remove the global bar once a different restore step starts
- When stdout is not a TTY, skip escape codes and print only the
changed bar, once per 1% step
- Fix progress throttling: lastprog was an int and was compared after
being overwritten, so granularity was never applied
- RESTORE_STEP_UPLOAD_IMG no longer drives the global bar; it already
has per-component bars
|
|
If the device does not report an EUICCChipID in its firmware preflight
info, plist_dict_copy_uint() leaves the eUICC,ChipID value from the
BuildManifest in place. The subsequent ">= 5" check would then still
pass and tss_request_add_vinyl_tags() was called without the required
eUICC,EID, eUICC,RootKeyIdentifier and Gold/Main nonce values, causing
the TSS server to respond with STATUS=168.
Only copy the eUICC parameters and add the vinyl tags if the device
actually provided an EUICCChipID.
Fixes #812
|
|
handler
|
|
|
|
|
|
on ipsw zip.
|
|
YonkersIR1
|
|
|
|
|
|
During Port DFU-to-DFU re-enumeration, macOS deviceinterfaced daemon can
acquire the USB interface first, making idevicerestore time out waiting
for DFU reconnection.
Add experimental flag: --exclusive-usb that keeps deviceinterfaced from
claiming the USB device for the duration of the restore, by booting it
out or repeatedly terminating it when bootout is denied (SIP on), then
reloading and starting it again on exit.
idevicerestore itself does not need to run as root for this. Only the
launchctl subcommands that manage the system-domain deviceinterfaced
daemon (bootout, bootstrap, kickstart, kill) are elevated individually
via sudo, which may prompt for a password on the controlling terminal.
Read-only queries (print) are run unprivileged. Document how to allow
these specific commands via a scoped sudoers(5) NOPASSWD rule for
unattended use.
Co-authored-by: Nikias Bassen <nikias@gmx.li>
|
|
SourceBootObjectV4 ignored GlobalManifestPrefix and
GlobalManifestSuffix and always selected apticket.<DeviceClass>.im4m,
supplying the AP manifest when another manifest family was requested.
Use the requested path components and send FileDataDone when an
optional manifest is absent. Requests without these fields retain the
existing AP-ticket path.
|
|
|
|
|
|
Add support for new data types and message types required by the macOS 27
(build 26A5353q) restore protocol when restoring via DFU mode:
- BootabilityBundleV2 (required): Updated bootability bundle handler
to recognize both V1 and V2 IPSW directory prefixes. The V2 handler
reuses the existing V1 cpio-over-connection wire protocol.
- SourceBootObjectV5 (optional): Routes to the existing V4 handler
which uses the same ImageName-based extract/personalize/stream flow.
- DeviceRestoreInfoPreflight (optional): Handled as an empty-dict
preflight acknowledgement, same as FirmwareUpdaterPreflight.
- RestoreProtocol (optional, message type): Logged and acknowledged
in the main message loop.
Without BootabilityBundleV2 in SupportedDataTypes, the device's restored
daemon fails the is_host_compatible check during DFU restore with:
host/device compatibility check found that a message is missing
or is not supported (required): BootabilityBundleV2
CHECKPOINT FAILURE: This host version is unsupported.
Tested: Erase restore of macOS 27.0 (26A5353q) via DFU on Macmini9,1
(j274ap, M1) completes successfully.
|
|
e.g. emulated ones via ChefKiss Inferno
|
|
buffers
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Co-authored-by: Nikias Bassen <nikias@gmx.li>
|
|
|
|
Also Vinyl shows up with some devices, so we handle this too.
|
|
|
|
Newer iOS version would cause an Error message despite being able to
continue, so we just ignore it.
|
|
|
|
The logging refactoring introduced a spelling error in the boot-args string.
This commit fixes that, and also changes the boot-args handling code to priotize
Apple Silicon/MacOS recovery path before the generic iOS path.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|