From 4b8cf66c74578c2c84efa446b9e336e3a20e3cb5 Mon Sep 17 00:00:00 2001 From: "Frank Chiarulli Jr." Date: Mon, 16 Nov 2026 18:02:00 -0400 Subject: [PATCH] Send AppleTCON firmware when the request has no ResponseTags A Mac16,5 asks for the AppleTCON updater data without listing any ResponseTags. Since upstream only adds FirmwareData when that list asks for it, the Mac got just the Baobab ticket and failed checkpoint 0x1332 ("failed to copy response for AppleTCON"). Treat a missing list as wanting the firmware, like before, and keep the ticket-only reply if the firmware can't be extracted. --- crates/restorekit-sys/patches/README.md | 7 +++ ...etcon-firmware-without-response-tags.patch | 43 +++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 crates/restorekit-sys/patches/idevicerestore/0008-send-appletcon-firmware-without-response-tags.patch diff --git a/crates/restorekit-sys/patches/README.md b/crates/restorekit-sys/patches/README.md index 9e8b41e..92404b9 100644 --- a/crates/restorekit-sys/patches/README.md +++ b/crates/restorekit-sys/patches/README.md @@ -29,6 +29,13 @@ compiles the patched copy. off USB as it reboots or re-enumerating once it's back. It then bailed with "Unable to discover device mode" while the Mac was still on its way back. Loop until the mode is known or the minute is up. +- `0008-send-appletcon-firmware-without-response-tags.patch` — since upstream + started honoring `ResponseTags`, the AppleTCON updater only gets + `FirmwareData` when the request lists it. A Mac16,5 sends its request with + no `ResponseTags` at all, gets just the Baobab ticket, and fails checkpoint + 0x1332 ("failed to copy response for AppleTCON") while the restore carries + on. When `ResponseTags` is missing, send the firmware like before, falling + back to the ticket-only reply if it can't be extracted. ## Updating a patch diff --git a/crates/restorekit-sys/patches/idevicerestore/0008-send-appletcon-firmware-without-response-tags.patch b/crates/restorekit-sys/patches/idevicerestore/0008-send-appletcon-firmware-without-response-tags.patch new file mode 100644 index 0000000..f84a118 --- /dev/null +++ b/crates/restorekit-sys/patches/idevicerestore/0008-send-appletcon-firmware-without-response-tags.patch @@ -0,0 +1,43 @@ +diff --git a/src/restore.c b/src/restore.c +index 7ffe876..0fc2c08 100644 +--- a/src/restore.c ++++ b/src/restore.c +@@ -3343,14 +3343,26 @@ static plist_t restore_get_tcon_firmware_data(struct idevicerestore_client_t* cl + logger(LL_ERROR, "No 'Baobab,Ticket' in TSS response, this might not work\n"); + } + +- /* don't add FirmwareData if not requested via ResponseTags */ +- if (!_wants_firmware_data(arguments)) { ++ /* don't add FirmwareData if not requested via ResponseTags. A request ++ * with no ResponseTags at all (seen from a Mac16,5) doesn't say what it ++ * wants, and a ticket-only reply fails the updater with "failed to copy ++ * response for AppleTCON", so send the firmware there like we did before ++ * ResponseTags were honored. */ ++ int has_response_tags = plist_access_path(arguments, 2, "DeviceGeneratedTags", "ResponseTags") != NULL; ++ if (has_response_tags && !_wants_firmware_data(arguments)) { + logger(LL_DEBUG, "Not adding FirmwareData as it was not requested\n"); + return response; + } ++ if (!has_response_tags) { ++ logger(LL_INFO, "AppleTCON: request has no ResponseTags, adding FirmwareData\n"); ++ } + + if (build_identity_get_component_path(client->restore->build_identity, comp_name, &comp_path) < 0) { + logger(LL_ERROR, "Unable to get path for '%s' component\n", comp_name); ++ if (!has_response_tags) { ++ /* Keep the previous ticket-only reply rather than fail the restore. */ ++ return response; ++ } + plist_free(response); + return NULL; + } +@@ -3361,6 +3373,9 @@ static plist_t restore_get_tcon_firmware_data(struct idevicerestore_client_t* cl + comp_path = NULL; + if (ret < 0) { + logger(LL_ERROR, "Unable to extract '%s' component\n", comp_name); ++ if (!has_response_tags) { ++ return response; ++ } + plist_free(response); + return NULL; + }