diff options
| author | 2026-11-25 23:53:54 +1100 | |
|---|---|---|
| committer | 2026-11-25 23:53:54 +1100 | |
| commit | e201b9f3d3d9fc8dd2c2b60544d9646c27a3c535 (patch) | |
| tree | f108f2f6133bae75b16bee4c3b44f8b6a2c7bfb0 /src/dfu.c | |
| parent | 5815eed70fd14d4ca98d4a498e38d776ffff88cd (diff) | |
| download | idevicerestore-e201b9f3d3d9fc8dd2c2b60544d9646c27a3c535.tar.gz idevicerestore-e201b9f3d3d9fc8dd2c2b60544d9646c27a3c535.tar.bz2 | |
dfu: Don't require a disconnect after iBSS
Diffstat (limited to 'src/dfu.c')
| -rw-r--r-- | src/dfu.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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)) { |
