diff options
author | Nikias Bassen | 2019-01-28 01:26:54 +0100 |
---|---|---|
committer | Nikias Bassen | 2019-01-28 01:26:54 +0100 |
commit | 65572cab6baf92cbe4d43fcb0c7a44bc87d95b85 (patch) | |
tree | c8823fcd4c8d1a7c380becb79f4dcb14b5019982 /src/idevicerestore.c | |
parent | 49d5419101a1fd75674c4b5419e2bd3fae0725a9 (diff) | |
download | idevicerestore-65572cab6baf92cbe4d43fcb0c7a44bc87d95b85.tar.gz idevicerestore-65572cab6baf92cbe4d43fcb0c7a44bc87d95b85.tar.bz2 |
main: Do not download version data unless --latest command line switch is used
... or we are dealing with a really old WTF device that doesn't ship the WTF
firmware in its .ipsw
Diffstat (limited to 'src/idevicerestore.c')
-rw-r--r-- | src/idevicerestore.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/idevicerestore.c b/src/idevicerestore.c index 822601c..bdcc9b6 100644 --- a/src/idevicerestore.c +++ b/src/idevicerestore.c @@ -198,9 +198,6 @@ int idevicerestore_start(struct idevicerestore_client_t* client) idevicerestore_progress(client, RESTORE_STEP_DETECT, 0.0); - // update version data (from cache, or apple if too old) - load_version_data(client); - // check which mode the device is currently in so we know where to start if (check_mode(client) < 0) { error("ERROR: Unable to discover device mode. Please make sure a device is attached.\n"); @@ -230,6 +227,9 @@ int idevicerestore_start(struct idevicerestore_client_t* client) // Prefer to get WTF file from the restore IPSW ipsw_extract_to_memory(client->ipsw, wtfname, &wtftmp, &wtfsize); if (!wtftmp) { + // update version data (from cache, or apple if too old) + load_version_data(client); + // Download WTF IPSW char* s_wtfurl = NULL; plist_t wtfurl = plist_access_path(client->version_data, 7, "MobileDeviceSoftwareVersionsByVersion", "5", "RecoverySoftwareVersions", "WTF", "304218112", "5", "FirmwareURL"); @@ -318,6 +318,8 @@ int idevicerestore_start(struct idevicerestore_client_t* client) } if (client->flags & FLAG_LATEST) { + // update version data (from cache, or apple if too old) + load_version_data(client); char* ipsw = NULL; int res = ipsw_download_latest_fw(client->version_data, client->device->product_type, client->cache_dir, &ipsw); if (res != 0) { |