diff options
author | Nikias Bassen | 2015-01-27 20:15:13 +0100 |
---|---|---|
committer | Nikias Bassen | 2015-01-27 20:15:13 +0100 |
commit | e7852d5a7249d769cfa867a480f4d3c673a0e5f7 (patch) | |
tree | fa1ab136e5204953db7d74e72d8841f743ff7427 | |
parent | 2c951c8bf15e229342abfa102e4414fd67795e19 (diff) | |
download | libimobiledevice-e7852d5a7249d769cfa867a480f4d3c673a0e5f7.tar.gz libimobiledevice-e7852d5a7249d769cfa867a480f4d3c673a0e5f7.tar.bz2 |
idevicebackup: Notify user if erroneously used with an iOS 4 or later device
-rw-r--r-- | tools/idevicebackup.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tools/idevicebackup.c b/tools/idevicebackup.c index 195f837..393b714 100644 --- a/tools/idevicebackup.c +++ b/tools/idevicebackup.c @@ -793,6 +793,27 @@ int main(int argc, char *argv[]) return -1; } + node = NULL; + lockdownd_get_value(client, NULL, "ProductVersion", &node); + if (node) { + char* str = NULL; + if (plist_get_node_type(node) == PLIST_STRING) { + plist_get_string_val(node, &str); + } + plist_free(node); + node = NULL; + if (str) { + int maj = strtol(str, NULL, 10); + free(str); + if (maj > 3) { + printf("ERROR: This tool is only compatible with iOS 3 or below. For newer iOS versions please use the idevicebackup2 tool.\n"); + lockdownd_client_free(client); + idevice_free(device); + return -1; + } + } + } + /* start notification_proxy */ np_client_t np = NULL; ldret = lockdownd_start_service(client, NP_SERVICE_NAME, &service); |