summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar hydazz2026-11-25 23:53:54 +1100
committerGravatar hydazz2026-11-25 23:53:54 +1100
commite201b9f3d3d9fc8dd2c2b60544d9646c27a3c535 (patch)
treef108f2f6133bae75b16bee4c3b44f8b6a2c7bfb0
parent5815eed70fd14d4ca98d4a498e38d776ffff88cd (diff)
downloadidevicerestore-e201b9f3d3d9fc8dd2c2b60544d9646c27a3c535.tar.gz
idevicerestore-e201b9f3d3d9fc8dd2c2b60544d9646c27a3c535.tar.bz2
dfu: Don't require a disconnect after iBSSHEADmaster
-rw-r--r--src/dfu.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/dfu.c b/src/dfu.c
index af62e87..b7f61e0 100644
--- a/src/dfu.c
+++ b/src/dfu.c
@@ -473,15 +473,19 @@ int dfu_enter_recovery(struct idevicerestore_client_t* client, plist_t build_ide
/* reconnect */
logger(LL_DEBUG, "Waiting for device to disconnect...\n");
cond_wait_timeout(&client->device_event_cond, &client->device_event_mutex, 10000);
- if (client->mode != MODE_UNKNOWN || (client->flags & FLAG_QUIT)) {
+ /* A device in DFU over Debug USB (KIS) can keep that USB device
+ * after iBSS and present recovery mode through it instead. */
+ if ((client->mode != MODE_UNKNOWN && client->mode != MODE_RECOVERY) || (client->flags & FLAG_QUIT)) {
mutex_unlock(&client->device_event_mutex);
if (!(client->flags & FLAG_QUIT)) {
logger(LL_ERROR, "Device did not disconnect. Possibly invalid iBSS. Reset device and try again.\n");
}
return -1;
}
- logger(LL_DEBUG, "Waiting for device to reconnect...\n");
- cond_wait_timeout(&client->device_event_cond, &client->device_event_mutex, 10000);
+ if (client->mode == MODE_UNKNOWN) {
+ logger(LL_DEBUG, "Waiting for device to reconnect...\n");
+ cond_wait_timeout(&client->device_event_cond, &client->device_event_mutex, 10000);
+ }
if ((client->mode != MODE_DFU && client->mode != MODE_RECOVERY) || (client->flags & FLAG_QUIT)) {
mutex_unlock(&client->device_event_mutex);
if (!(client->flags & FLAG_QUIT)) {