Skip to content

Commit 5d9bd62

Browse files
committed
Print message about USB port for macOS restores in case Port DFU fails
Depending on the model, a specific USB Port has to be used for a restore. When using a different one, Port DFU fails to switch to DFU mode. We use this fact to print a message with an official link that shows the correct USB port to use for the restore.
1 parent 75fb578 commit 5d9bd62

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/idevicerestore.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,7 @@ int idevicerestore_start(struct idevicerestore_client_t* client)
755755
plist_dict_copy_item(parameters, build_identity, "USBPortController1,SecurityDomain", NULL);
756756
plist_dict_set_item(parameters, "USBPortController1,SecurityMode", plist_new_bool(1));
757757
plist_dict_set_item(parameters, "USBPortController1,ProductionMode", plist_new_bool(1));
758+
int is_mac = plist_access_path(build_identity, 2, "Info", "MacOSVariant") != NULL;
758759
plist_t usbf = plist_access_path(build_identity, 2, "Manifest", "USBPortController1,USBFirmware");
759760
if (!usbf) {
760761
plist_free(parameters);
@@ -839,6 +840,9 @@ int idevicerestore_start(struct idevicerestore_client_t* client)
839840
mutex_unlock(&client->device_event_mutex);
840841
if (!(client->flags & FLAG_QUIT)) {
841842
logger(LL_ERROR, "Device did not reconnect in DFU mode. Port DFU failed.\n");
843+
if (is_mac) {
844+
logger(LL_ERROR, "Make sure to use the correct USB port for this model, see https://support.apple.com/120694\n");
845+
}
842846
}
843847
return -2;
844848
}

0 commit comments

Comments
 (0)