summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2019-10-11 00:06:07 +0200
committerGravatar Nikias Bassen2019-10-11 00:06:07 +0200
commit75a61508bd3c2013492744fb5aea755e19b01086 (patch)
tree8a7a72bd9ea3511a47f5118b6e6ecfedec16a4d0 /src
parent49a2d7a05633d1d87c51307e31f8d34fbd1f4451 (diff)
downloadidevicerestore-75a61508bd3c2013492744fb5aea755e19b01086.tar.gz
idevicerestore-75a61508bd3c2013492744fb5aea755e19b01086.tar.bz2
dfu: Fix DFU loading of iBSS -> iBEC on newer devices
Diffstat (limited to 'src')
-rw-r--r--src/dfu.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/dfu.c b/src/dfu.c
index f147cde..167b374 100644
--- a/src/dfu.c
+++ b/src/dfu.c
@@ -342,10 +342,10 @@ int dfu_enter_recovery(struct idevicerestore_client_t* client, plist_t build_ide
client->dfu->client = NULL;
return -1;
}
+ dfu_client_free(client);
if (client->build_major > 8) {
/* reconnect */
- dfu_client_free(client);
debug("Waiting for device to disconnect...\n");
WAIT_FOR(client->mode == &idevicerestore_modes[MODE_UNKNOWN] || (client->flags & FLAG_QUIT), 10);
if (client->mode != &idevicerestore_modes[MODE_UNKNOWN] || (client->flags & FLAG_QUIT)) {
@@ -354,11 +354,11 @@ int dfu_enter_recovery(struct idevicerestore_client_t* client, plist_t build_ide
}
return -1;
}
- debug("Waiting for device to reconnect in DFU mode...\n");
- WAIT_FOR(client->mode == &idevicerestore_modes[MODE_DFU] || (client->flags & FLAG_QUIT), 10);
- if (client->mode != &idevicerestore_modes[MODE_DFU] || (client->flags & FLAG_QUIT)) {
+ debug("Waiting for device to reconnect...\n");
+ WAIT_FOR(client->mode == &idevicerestore_modes[MODE_DFU] || client->mode == &idevicerestore_modes[MODE_RECOVERY] || (client->flags & FLAG_QUIT), 10);
+ if ((client->mode != &idevicerestore_modes[MODE_DFU] && client->mode != &idevicerestore_modes[MODE_RECOVERY]) || (client->flags & FLAG_QUIT)) {
if (!(client->flags & FLAG_QUIT)) {
- error("ERROR: Device did not reconnect in DFU mode. Possibly invalid iBSS. Reset device and try again.\n");
+ error("ERROR: Device did not reconnect in DFU or recovery mode. Possibly invalid iBSS. Reset device and try again.\n");
}
return -1;
}
@@ -416,8 +416,16 @@ int dfu_enter_recovery(struct idevicerestore_client_t* client, plist_t build_ide
client->dfu->client = NULL;
return -1;
}
+
+ if (client->mode == &idevicerestore_modes[MODE_RECOVERY]) {
+ if (irecv_send_command(client->dfu->client, "go") != IRECV_E_SUCCESS) {
+ error("ERROR: Unable to execute iBEC\n");
+ return -1;
+ }
+ irecv_usb_control_transfer(client->dfu->client, 0x21, 1, 0, 0, 0, 0, 5000);
+ }
+ dfu_client_free(client);
}
- dfu_client_free(client);
debug("Waiting for device to disconnect...\n");
WAIT_FOR(client->mode == &idevicerestore_modes[MODE_UNKNOWN] || (client->flags & FLAG_QUIT), 10);