diff options
author | Martin Szulecki | 2012-07-17 17:32:14 +0200 |
---|---|---|
committer | Nikias Bassen | 2012-07-17 17:32:14 +0200 |
commit | 89c630f0d75e65498bfd6268c715e8b1b92b793b (patch) | |
tree | 90f8297ef9b2dffc596450016fba00b355b6b03a | |
parent | a096545aaab6fb55c058c983a67336b80053f5af (diff) | |
download | idevicerestore-89c630f0d75e65498bfd6268c715e8b1b92b793b.tar.gz idevicerestore-89c630f0d75e65498bfd6268c715e8b1b92b793b.tar.bz2 |
main: Switch device from normal into recovery before extracting filesystem
The filesystem extraction process takes a while on WIN32.
In order to quickly determine connection/mode switch issues, we move
the quicker logic before the slower one.
-rw-r--r-- | src/idevicerestore.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/src/idevicerestore.c b/src/idevicerestore.c index 4d1d8d5..cb95e7d 100644 --- a/src/idevicerestore.c +++ b/src/idevicerestore.c @@ -646,30 +646,28 @@ int main(int argc, char* argv[]) { fixup_tss(client->tss); } - // Extract filesystem from IPSW and return its name - char* filesystem = NULL; - if (ipsw_extract_filesystem(client->ipsw, build_identity, &filesystem) < 0) { - error("ERROR: Unable to extract filesystem from IPSW\n"); - if (client->tss) - plist_free(client->tss); - plist_free(buildmanifest); - return -1; - } - // if the device is in normal mode, place device into recovery mode if (client->mode->index == MODE_NORMAL) { info("Entering recovery mode...\n"); if (normal_enter_recovery(client) < 0) { - error("ERROR: Unable to place device into recovery mode\n"); + error("ERROR: Unable to place device into recovery mode from %s mode\n", client->mode->string); if (client->tss) plist_free(client->tss); plist_free(buildmanifest); - if (filesystem) - unlink(filesystem); - return -1; + return -2; } } + // Extract filesystem from IPSW and return its name + char* filesystem = NULL; + if (ipsw_extract_filesystem(client->ipsw, build_identity, &filesystem) < 0) { + error("ERROR: Unable to extract filesystem from IPSW\n"); + if (client->tss) + plist_free(client->tss); + plist_free(buildmanifest); + return -1; + } + // if the device is in DFU mode, place device into recovery mode if (client->mode->index == MODE_DFU) { recovery_client_free(client); |