From e7852d5a7249d769cfa867a480f4d3c673a0e5f7 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Tue, 27 Jan 2015 20:15:13 +0100 Subject: idevicebackup: Notify user if erroneously used with an iOS 4 or later device --- tools/idevicebackup.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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); -- cgit v1.1-32-gdbae