Skip to content

Commit

Permalink
idevicebackup: Notify user if erroneously used with an iOS 4 or later…
Browse files Browse the repository at this point in the history
… device
  • Loading branch information
nikias committed Jan 27, 2015
1 parent 2c951c8 commit e7852d5
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tools/idevicebackup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e7852d5

Please sign in to comment.