summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Clément Decoodt2022-06-20 12:04:02 +0200
committerGravatar Clément Decoodt2022-06-20 12:04:02 +0200
commitf6c3d53006733e1f5bae4b073d4e7f19cefd0870 (patch)
tree6cd87b7aea1442fab24fa7a499ece5b561b1e2b3 /src
parent3525150ba4a45e4ee9327c75cb984e30fa179ba3 (diff)
downloadidevicerestore-f6c3d53006733e1f5bae4b073d4e7f19cefd0870.tar.gz
idevicerestore-f6c3d53006733e1f5bae4b073d4e7f19cefd0870.tar.bz2
Add support for FirmwareUpdaterPreflight message
This message seems mandatory on the new versions of MacOS (12+), but it seems an empty response is what's expected.
Diffstat (limited to 'src')
-rw-r--r--src/restore.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/restore.c b/src/restore.c
index 5423bb9..76194bf 100644
--- a/src/restore.c
+++ b/src/restore.c
@@ -2917,6 +2917,30 @@ static plist_t restore_get_cryptex1_firmware_data(restored_client_t restore, str
return response;
}
+static int restore_send_firmware_updater_preflight(restored_client_t restore, struct idevicerestore_client_t* client, plist_t build_identity, plist_t message)
+{
+ plist_t dict = NULL;
+ int restore_error;
+
+ if (idevicerestore_debug) {
+ debug("DEBUG: %s: Got FirmwareUpdaterPreflight request:\n", __func__);
+ debug_plist(message);
+ }
+
+ dict = plist_new_dict();
+
+ info("Sending FirmwareResponsePreflight now...\n");
+ restore_error = restored_send(restore, dict);
+ plist_free(dict);
+ if (restore_error != RESTORE_E_SUCCESS) {
+ error("ERROR: Couldn't send FirmwareResponsePreflight data (%d)\n", restore_error);
+ return -1;
+ }
+
+ info("Done sending FirmwareUpdaterPreflight response\n");
+ return 0;
+}
+
static int restore_send_firmware_updater_data(restored_client_t restore, struct idevicerestore_client_t* client, plist_t build_identity, plist_t message)
{
plist_t arguments;
@@ -3758,6 +3782,13 @@ int restore_handle_data_request_msg(struct idevicerestore_client_t* client, idev
}
}
+ else if (!strcmp(type, "FirmwareUpdaterPreflight")) {
+ if(restore_send_firmware_updater_preflight(restore, client, build_identity, message) < 0) {
+ error("ERROR: Unable to send FirmwareUpdaterPreflight\n");
+ return -1;
+ }
+ }
+
else if (!strcmp(type, "FirmwareUpdaterData")) {
if(restore_send_firmware_updater_data(restore, client, build_identity, message) < 0) {
error("ERROR: Unable to send FirmwareUpdater data\n");