summaryrefslogtreecommitdiffstats
path: root/src/ipsw.c
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2012-07-17 01:17:25 +0200
committerGravatar Nikias Bassen2012-07-17 01:17:25 +0200
commitc960398317b2bba90d59612edee5cc95ca81e1f9 (patch)
tree4a730dc2b05d279dcacc0f59bd2385af55422eb3 /src/ipsw.c
parent38de3e73bf0be64590af95cf785c3e5f2d62128a (diff)
downloadidevicerestore-c960398317b2bba90d59612edee5cc95ca81e1f9.tar.gz
idevicerestore-c960398317b2bba90d59612edee5cc95ca81e1f9.tar.bz2
ipsw: add workaround for iPhone1,1 version parsing
Diffstat (limited to 'src/ipsw.c')
-rw-r--r--src/ipsw.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/ipsw.c b/src/ipsw.c
index 8e3d598..7052e8c 100644
--- a/src/ipsw.c
+++ b/src/ipsw.c
@@ -289,8 +289,14 @@ static int get_latest_fw(plist_t version_data, const char* product, char** fwurl
sprintf(majstr, FMT_qu, (long long unsigned int)major);
n1 = plist_access_path(version_data, 7, "MobileDeviceSoftwareVersionsByVersion", majstr, "MobileDeviceSoftwareVersions", product, "Unknown", "Universal", "Restore");
if (!n1) {
- error("%s: ERROR: Can't get Unknown/Universal/Restore node?!\n", __func__);
- return -1;
+ // if not found, increase major version number by one and try again
+ major++;
+ sprintf(majstr, FMT_qu, (long long unsigned int)major);
+ n1 = plist_access_path(version_data, 7, "MobileDeviceSoftwareVersionsByVersion", majstr, "MobileDeviceSoftwareVersions", product, "Unknown", "Universal", "Restore");
+ if (!n1) {
+ error("%s: ERROR: Can't get Unknown/Universal/Restore node?!\n", __func__);
+ return -1;
+ }
}
n2 = plist_dict_get_item(n1, "BuildVersion");