diff options
| author | 2012-03-22 16:07:07 +0100 | |
|---|---|---|
| committer | 2012-03-22 16:07:07 +0100 | |
| commit | 7457346a7ad7dddc0188cd1cd6fc5920aabfe39a (patch) | |
| tree | 4d9aa158fc2fb1e05d3349ca8a5ec22207a9a7e4 /tools | |
| parent | 0331050438d1bd5824237d13240a766a9b503b55 (diff) | |
| download | libimobiledevice-7457346a7ad7dddc0188cd1cd6fc5920aabfe39a.tar.gz libimobiledevice-7457346a7ad7dddc0188cd1cd6fc5920aabfe39a.tar.bz2 | |
Mass replace UUID by UDID, which is the correct term for it
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/idevice_id.c | 18 | ||||
| -rw-r--r-- | tools/idevicebackup.c | 34 | ||||
| -rw-r--r-- | tools/idevicebackup2.c | 66 | ||||
| -rw-r--r-- | tools/idevicedate.c | 16 | ||||
| -rw-r--r-- | tools/ideviceenterrecovery.c | 16 | ||||
| -rw-r--r-- | tools/ideviceimagemounter.c | 12 | ||||
| -rw-r--r-- | tools/ideviceinfo.c | 16 | ||||
| -rw-r--r-- | tools/idevicepair.c | 60 | ||||
| -rw-r--r-- | tools/idevicescreenshot.c | 18 | ||||
| -rw-r--r-- | tools/idevicesyslog.c | 16 |
10 files changed, 136 insertions, 136 deletions
diff --git a/tools/idevice_id.c b/tools/idevice_id.c index 1facb60..44a542a 100644 --- a/tools/idevice_id.c +++ b/tools/idevice_id.c | |||
| @@ -13,11 +13,11 @@ static void print_usage(int argc, char **argv) | |||
| 13 | char *name = NULL; | 13 | char *name = NULL; |
| 14 | 14 | ||
| 15 | name = strrchr(argv[0], '/'); | 15 | name = strrchr(argv[0], '/'); |
| 16 | printf("Usage: %s [OPTIONS] [UUID]\n", (name ? name + 1: argv[0])); | 16 | printf("Usage: %s [OPTIONS] [UDID]\n", (name ? name + 1: argv[0])); |
| 17 | printf("Prints device name or a list of attached iPhone/iPod Touch devices.\n\n"); | 17 | printf("Prints device name or a list of attached iPhone/iPod Touch devices.\n\n"); |
| 18 | printf(" The UUID is a 40-digit hexadecimal number of the device\n"); | 18 | printf(" The UDID is a 40-digit hexadecimal number of the device\n"); |
| 19 | printf(" for which the name should be retrieved.\n\n"); | 19 | printf(" for which the name should be retrieved.\n\n"); |
| 20 | printf(" -l, --list\t\tlist UUID of all attached devices\n"); | 20 | printf(" -l, --list\t\tlist UDID of all attached devices\n"); |
| 21 | printf(" -d, --debug\t\tenable communication debugging\n"); | 21 | printf(" -d, --debug\t\tenable communication debugging\n"); |
| 22 | printf(" -h, --help\t\tprints usage information\n"); | 22 | printf(" -h, --help\t\tprints usage information\n"); |
| 23 | printf("\n"); | 23 | printf("\n"); |
| @@ -32,8 +32,8 @@ int main(int argc, char **argv) | |||
| 32 | int ret = 0; | 32 | int ret = 0; |
| 33 | int i; | 33 | int i; |
| 34 | int mode = MODE_SHOW_ID; | 34 | int mode = MODE_SHOW_ID; |
| 35 | char uuid[41]; | 35 | char udid[41]; |
| 36 | uuid[0] = 0; | 36 | udid[0] = 0; |
| 37 | 37 | ||
| 38 | /* parse cmdline args */ | 38 | /* parse cmdline args */ |
| 39 | for (i = 1; i < argc; i++) { | 39 | for (i = 1; i < argc; i++) { |
| @@ -51,21 +51,21 @@ int main(int argc, char **argv) | |||
| 51 | } | 51 | } |
| 52 | } | 52 | } |
| 53 | 53 | ||
| 54 | /* check if uuid was passed */ | 54 | /* check if udid was passed */ |
| 55 | if (mode == MODE_SHOW_ID) { | 55 | if (mode == MODE_SHOW_ID) { |
| 56 | i--; | 56 | i--; |
| 57 | if (!argv[i] || (strlen(argv[i]) != 40)) { | 57 | if (!argv[i] || (strlen(argv[i]) != 40)) { |
| 58 | print_usage(argc, argv); | 58 | print_usage(argc, argv); |
| 59 | return 0; | 59 | return 0; |
| 60 | } | 60 | } |
| 61 | strcpy(uuid, argv[i]); | 61 | strcpy(udid, argv[i]); |
| 62 | } | 62 | } |
| 63 | 63 | ||
| 64 | switch (mode) { | 64 | switch (mode) { |
| 65 | case MODE_SHOW_ID: | 65 | case MODE_SHOW_ID: |
| 66 | idevice_new(&phone, uuid); | 66 | idevice_new(&phone, udid); |
| 67 | if (!phone) { | 67 | if (!phone) { |
| 68 | fprintf(stderr, "ERROR: No device with UUID=%s attached.\n", uuid); | 68 | fprintf(stderr, "ERROR: No device with UDID=%s attached.\n", udid); |
| 69 | return -2; | 69 | return -2; |
| 70 | } | 70 | } |
| 71 | 71 | ||
diff --git a/tools/idevicebackup.c b/tools/idevicebackup.c index 26771f8..7935477 100644 --- a/tools/idevicebackup.c +++ b/tools/idevicebackup.c | |||
| @@ -288,8 +288,8 @@ static plist_t mobilebackup_factory_info_plist_new() | |||
| 288 | /* gather data from lockdown */ | 288 | /* gather data from lockdown */ |
| 289 | plist_t value_node = NULL; | 289 | plist_t value_node = NULL; |
| 290 | plist_t root_node = NULL; | 290 | plist_t root_node = NULL; |
| 291 | char *uuid = NULL; | 291 | char *udid = NULL; |
| 292 | char *uuid_uppercase = NULL; | 292 | char *udid_uppercase = NULL; |
| 293 | 293 | ||
| 294 | plist_t ret = plist_new_dict(); | 294 | plist_t ret = plist_new_dict(); |
| 295 | 295 | ||
| @@ -323,14 +323,14 @@ static plist_t mobilebackup_factory_info_plist_new() | |||
| 323 | plist_dict_insert_item(ret, "Serial Number", plist_copy(value_node)); | 323 | plist_dict_insert_item(ret, "Serial Number", plist_copy(value_node)); |
| 324 | 324 | ||
| 325 | value_node = plist_dict_get_item(root_node, "UniqueDeviceID"); | 325 | value_node = plist_dict_get_item(root_node, "UniqueDeviceID"); |
| 326 | idevice_get_uuid(phone, &uuid); | 326 | idevice_get_udid(phone, &udid); |
| 327 | plist_dict_insert_item(ret, "Target Identifier", plist_new_string(uuid)); | 327 | plist_dict_insert_item(ret, "Target Identifier", plist_new_string(udid)); |
| 328 | 328 | ||
| 329 | /* uppercase */ | 329 | /* uppercase */ |
| 330 | uuid_uppercase = str_toupper(uuid); | 330 | udid_uppercase = str_toupper(udid); |
| 331 | plist_dict_insert_item(ret, "Unique Identifier", plist_new_string(uuid_uppercase)); | 331 | plist_dict_insert_item(ret, "Unique Identifier", plist_new_string(udid_uppercase)); |
| 332 | free(uuid_uppercase); | 332 | free(udid_uppercase); |
| 333 | free(uuid); | 333 | free(udid); |
| 334 | 334 | ||
| 335 | /* FIXME: Embed files as <data> nodes */ | 335 | /* FIXME: Embed files as <data> nodes */ |
| 336 | plist_t files = plist_new_dict(); | 336 | plist_t files = plist_new_dict(); |
| @@ -521,7 +521,7 @@ static int mobilebackup_info_is_current_device(plist_t info) | |||
| 521 | /* get basic device information in one go */ | 521 | /* get basic device information in one go */ |
| 522 | lockdownd_get_value(client, NULL, NULL, &root_node); | 522 | lockdownd_get_value(client, NULL, NULL, &root_node); |
| 523 | 523 | ||
| 524 | /* verify UUID */ | 524 | /* verify UDID */ |
| 525 | value_node = plist_dict_get_item(root_node, "UniqueDeviceID"); | 525 | value_node = plist_dict_get_item(root_node, "UniqueDeviceID"); |
| 526 | node = plist_dict_get_item(info, "Target Identifier"); | 526 | node = plist_dict_get_item(info, "Target Identifier"); |
| 527 | 527 | ||
| @@ -810,7 +810,7 @@ static void print_usage(int argc, char **argv) | |||
| 810 | printf(" restore\tRestores a device backup from DIRECTORY.\n\n"); | 810 | printf(" restore\tRestores a device backup from DIRECTORY.\n\n"); |
| 811 | printf("options:\n"); | 811 | printf("options:\n"); |
| 812 | printf(" -d, --debug\t\tenable communication debugging\n"); | 812 | printf(" -d, --debug\t\tenable communication debugging\n"); |
| 813 | printf(" -u, --uuid UUID\ttarget specific device by its 40-digit device UUID\n"); | 813 | printf(" -u, --udid UDID\ttarget specific device by its 40-digit device UDID\n"); |
| 814 | printf(" -h, --help\t\tprints usage information\n"); | 814 | printf(" -h, --help\t\tprints usage information\n"); |
| 815 | printf("\n"); | 815 | printf("\n"); |
| 816 | } | 816 | } |
| @@ -819,9 +819,9 @@ int main(int argc, char *argv[]) | |||
| 819 | { | 819 | { |
| 820 | idevice_error_t ret = IDEVICE_E_UNKNOWN_ERROR; | 820 | idevice_error_t ret = IDEVICE_E_UNKNOWN_ERROR; |
| 821 | int i; | 821 | int i; |
| 822 | char uuid[41]; | 822 | char udid[41]; |
| 823 | uint16_t port = 0; | 823 | uint16_t port = 0; |
| 824 | uuid[0] = 0; | 824 | udid[0] = 0; |
| 825 | int cmd = -1; | 825 | int cmd = -1; |
| 826 | int is_full_backup = 0; | 826 | int is_full_backup = 0; |
| 827 | char *backup_directory = NULL; | 827 | char *backup_directory = NULL; |
| @@ -851,13 +851,13 @@ int main(int argc, char *argv[]) | |||
| 851 | idevice_set_debug_level(1); | 851 | idevice_set_debug_level(1); |
| 852 | continue; | 852 | continue; |
| 853 | } | 853 | } |
| 854 | else if (!strcmp(argv[i], "-u") || !strcmp(argv[i], "--uuid")) { | 854 | else if (!strcmp(argv[i], "-u") || !strcmp(argv[i], "--udid")) { |
| 855 | i++; | 855 | i++; |
| 856 | if (!argv[i] || (strlen(argv[i]) != 40)) { | 856 | if (!argv[i] || (strlen(argv[i]) != 40)) { |
| 857 | print_usage(argc, argv); | 857 | print_usage(argc, argv); |
| 858 | return 0; | 858 | return 0; |
| 859 | } | 859 | } |
| 860 | strcpy(uuid, argv[i]); | 860 | strcpy(udid, argv[i]); |
| 861 | continue; | 861 | continue; |
| 862 | } | 862 | } |
| 863 | else if (!strcmp(argv[i], "-h") || !strcmp(argv[i], "--help")) { | 863 | else if (!strcmp(argv[i], "-h") || !strcmp(argv[i], "--help")) { |
| @@ -910,10 +910,10 @@ int main(int argc, char *argv[]) | |||
| 910 | 910 | ||
| 911 | printf("Backup directory is \"%s\"\n", backup_directory); | 911 | printf("Backup directory is \"%s\"\n", backup_directory); |
| 912 | 912 | ||
| 913 | if (uuid[0] != 0) { | 913 | if (udid[0] != 0) { |
| 914 | ret = idevice_new(&phone, uuid); | 914 | ret = idevice_new(&phone, udid); |
| 915 | if (ret != IDEVICE_E_SUCCESS) { | 915 | if (ret != IDEVICE_E_SUCCESS) { |
| 916 | printf("No device found with uuid %s, is it plugged in?\n", uuid); | 916 | printf("No device found with udid %s, is it plugged in?\n", udid); |
| 917 | return -1; | 917 | return -1; |
| 918 | } | 918 | } |
| 919 | } | 919 | } |
diff --git a/tools/idevicebackup2.c b/tools/idevicebackup2.c index b0f9d55..4b7e79e 100644 --- a/tools/idevicebackup2.c +++ b/tools/idevicebackup2.c | |||
| @@ -253,8 +253,8 @@ static plist_t mobilebackup_factory_info_plist_new() | |||
| 253 | /* gather data from lockdown */ | 253 | /* gather data from lockdown */ |
| 254 | plist_t value_node = NULL; | 254 | plist_t value_node = NULL; |
| 255 | plist_t root_node = NULL; | 255 | plist_t root_node = NULL; |
| 256 | char *uuid = NULL; | 256 | char *udid = NULL; |
| 257 | char *uuid_uppercase = NULL; | 257 | char *udid_uppercase = NULL; |
| 258 | 258 | ||
| 259 | plist_t ret = plist_new_dict(); | 259 | plist_t ret = plist_new_dict(); |
| 260 | 260 | ||
| @@ -299,16 +299,16 @@ static plist_t mobilebackup_factory_info_plist_new() | |||
| 299 | /* FIXME Sync Settings? */ | 299 | /* FIXME Sync Settings? */ |
| 300 | 300 | ||
| 301 | value_node = plist_dict_get_item(root_node, "UniqueDeviceID"); | 301 | value_node = plist_dict_get_item(root_node, "UniqueDeviceID"); |
| 302 | idevice_get_uuid(phone, &uuid); | 302 | idevice_get_udid(phone, &udid); |
| 303 | plist_dict_insert_item(ret, "Target Identifier", plist_new_string(uuid)); | 303 | plist_dict_insert_item(ret, "Target Identifier", plist_new_string(udid)); |
| 304 | 304 | ||
| 305 | plist_dict_insert_item(ret, "Target Type", plist_new_string("Device")); | 305 | plist_dict_insert_item(ret, "Target Type", plist_new_string("Device")); |
| 306 | 306 | ||
| 307 | /* uppercase */ | 307 | /* uppercase */ |
| 308 | uuid_uppercase = str_toupper(uuid); | 308 | udid_uppercase = str_toupper(udid); |
| 309 | plist_dict_insert_item(ret, "Unique Identifier", plist_new_string(uuid_uppercase)); | 309 | plist_dict_insert_item(ret, "Unique Identifier", plist_new_string(udid_uppercase)); |
| 310 | free(uuid_uppercase); | 310 | free(udid_uppercase); |
| 311 | free(uuid); | 311 | free(udid); |
| 312 | 312 | ||
| 313 | char *data_buf = NULL; | 313 | char *data_buf = NULL; |
| 314 | uint64_t data_size = 0; | 314 | uint64_t data_size = 0; |
| @@ -446,11 +446,11 @@ static int plist_write_to_filename(plist_t plist, const char *filename, enum pli | |||
| 446 | return 1; | 446 | return 1; |
| 447 | } | 447 | } |
| 448 | 448 | ||
| 449 | static int mb2_status_check_snapshot_state(const char *path, const char *uuid, const char *matches) | 449 | static int mb2_status_check_snapshot_state(const char *path, const char *udid, const char *matches) |
| 450 | { | 450 | { |
| 451 | int ret = -1; | 451 | int ret = -1; |
| 452 | plist_t status_plist = NULL; | 452 | plist_t status_plist = NULL; |
| 453 | char *file_path = build_path(path, uuid, "Status.plist", NULL); | 453 | char *file_path = build_path(path, udid, "Status.plist", NULL); |
| 454 | 454 | ||
| 455 | plist_read_from_filename(&status_plist, file_path); | 455 | plist_read_from_filename(&status_plist, file_path); |
| 456 | free(file_path); | 456 | free(file_path); |
| @@ -488,7 +488,7 @@ static int mobilebackup_info_is_current_device(plist_t info) | |||
| 488 | /* get basic device information in one go */ | 488 | /* get basic device information in one go */ |
| 489 | lockdownd_get_value(client, NULL, NULL, &root_node); | 489 | lockdownd_get_value(client, NULL, NULL, &root_node); |
| 490 | 490 | ||
| 491 | /* verify UUID */ | 491 | /* verify UDID */ |
| 492 | value_node = plist_dict_get_item(root_node, "UniqueDeviceID"); | 492 | value_node = plist_dict_get_item(root_node, "UniqueDeviceID"); |
| 493 | node = plist_dict_get_item(info, "Target Identifier"); | 493 | node = plist_dict_get_item(info, "Target Identifier"); |
| 494 | 494 | ||
| @@ -1171,7 +1171,7 @@ static void print_usage(int argc, char **argv) | |||
| 1171 | printf(" unback\tunpack a completed backup in DIRECTORY/_unback_/\n\n"); | 1171 | printf(" unback\tunpack a completed backup in DIRECTORY/_unback_/\n\n"); |
| 1172 | printf("options:\n"); | 1172 | printf("options:\n"); |
| 1173 | printf(" -d, --debug\t\tenable communication debugging\n"); | 1173 | printf(" -d, --debug\t\tenable communication debugging\n"); |
| 1174 | printf(" -u, --uuid UUID\ttarget specific device by its 40-digit device UUID\n"); | 1174 | printf(" -u, --udid UDID\ttarget specific device by its 40-digit device UDID\n"); |
| 1175 | printf(" -h, --help\t\tprints usage information\n"); | 1175 | printf(" -h, --help\t\tprints usage information\n"); |
| 1176 | printf("\n"); | 1176 | printf("\n"); |
| 1177 | } | 1177 | } |
| @@ -1180,9 +1180,9 @@ int main(int argc, char *argv[]) | |||
| 1180 | { | 1180 | { |
| 1181 | idevice_error_t ret = IDEVICE_E_UNKNOWN_ERROR; | 1181 | idevice_error_t ret = IDEVICE_E_UNKNOWN_ERROR; |
| 1182 | int i; | 1182 | int i; |
| 1183 | char uuid[41]; | 1183 | char udid[41]; |
| 1184 | uint16_t port = 0; | 1184 | uint16_t port = 0; |
| 1185 | uuid[0] = 0; | 1185 | udid[0] = 0; |
| 1186 | int cmd = -1; | 1186 | int cmd = -1; |
| 1187 | int cmd_flags = 0; | 1187 | int cmd_flags = 0; |
| 1188 | int is_full_backup = 0; | 1188 | int is_full_backup = 0; |
| @@ -1207,13 +1207,13 @@ int main(int argc, char *argv[]) | |||
| 1207 | idevice_set_debug_level(1); | 1207 | idevice_set_debug_level(1); |
| 1208 | continue; | 1208 | continue; |
| 1209 | } | 1209 | } |
| 1210 | else if (!strcmp(argv[i], "-u") || !strcmp(argv[i], "--uuid")) { | 1210 | else if (!strcmp(argv[i], "-u") || !strcmp(argv[i], "--udid")) { |
| 1211 | i++; | 1211 | i++; |
| 1212 | if (!argv[i] || (strlen(argv[i]) != 40)) { | 1212 | if (!argv[i] || (strlen(argv[i]) != 40)) { |
| 1213 | print_usage(argc, argv); | 1213 | print_usage(argc, argv); |
| 1214 | return 0; | 1214 | return 0; |
| 1215 | } | 1215 | } |
| 1216 | strcpy(uuid, argv[i]); | 1216 | strcpy(udid, argv[i]); |
| 1217 | continue; | 1217 | continue; |
| 1218 | } | 1218 | } |
| 1219 | else if (!strcmp(argv[i], "-h") || !strcmp(argv[i], "--help")) { | 1219 | else if (!strcmp(argv[i], "-h") || !strcmp(argv[i], "--help")) { |
| @@ -1277,10 +1277,10 @@ int main(int argc, char *argv[]) | |||
| 1277 | return -1; | 1277 | return -1; |
| 1278 | } | 1278 | } |
| 1279 | 1279 | ||
| 1280 | if (uuid[0] != 0) { | 1280 | if (udid[0] != 0) { |
| 1281 | ret = idevice_new(&phone, uuid); | 1281 | ret = idevice_new(&phone, udid); |
| 1282 | if (ret != IDEVICE_E_SUCCESS) { | 1282 | if (ret != IDEVICE_E_SUCCESS) { |
| 1283 | printf("No device found with uuid %s, is it plugged in?\n", uuid); | 1283 | printf("No device found with udid %s, is it plugged in?\n", udid); |
| 1284 | return -1; | 1284 | return -1; |
| 1285 | } | 1285 | } |
| 1286 | } | 1286 | } |
| @@ -1291,18 +1291,18 @@ int main(int argc, char *argv[]) | |||
| 1291 | printf("No device found, is it plugged in?\n"); | 1291 | printf("No device found, is it plugged in?\n"); |
| 1292 | return -1; | 1292 | return -1; |
| 1293 | } | 1293 | } |
| 1294 | char *newuuid = NULL; | 1294 | char *newudid = NULL; |
| 1295 | idevice_get_uuid(phone, &newuuid); | 1295 | idevice_get_udid(phone, &newudid); |
| 1296 | strcpy(uuid, newuuid); | 1296 | strcpy(udid, newudid); |
| 1297 | free(newuuid); | 1297 | free(newudid); |
| 1298 | } | 1298 | } |
| 1299 | 1299 | ||
| 1300 | /* backup directory must contain an Info.plist */ | 1300 | /* backup directory must contain an Info.plist */ |
| 1301 | char *info_path = build_path(backup_directory, uuid, "Info.plist", NULL); | 1301 | char *info_path = build_path(backup_directory, udid, "Info.plist", NULL); |
| 1302 | if (cmd == CMD_RESTORE) { | 1302 | if (cmd == CMD_RESTORE) { |
| 1303 | if (stat(info_path, &st) != 0) { | 1303 | if (stat(info_path, &st) != 0) { |
| 1304 | free(info_path); | 1304 | free(info_path); |
| 1305 | printf("ERROR: Backup directory \"%s\" is invalid. No Info.plist found for UUID %s.\n", backup_directory, uuid); | 1305 | printf("ERROR: Backup directory \"%s\" is invalid. No Info.plist found for UDID %s.\n", backup_directory, udid); |
| 1306 | return -1; | 1306 | return -1; |
| 1307 | } | 1307 | } |
| 1308 | } | 1308 | } |
| @@ -1430,7 +1430,7 @@ checkpoint: | |||
| 1430 | PRINT_VERBOSE(1, "Starting backup...\n"); | 1430 | PRINT_VERBOSE(1, "Starting backup...\n"); |
| 1431 | 1431 | ||
| 1432 | /* make sure backup device sub-directory exists */ | 1432 | /* make sure backup device sub-directory exists */ |
| 1433 | char *devbackupdir = build_path(backup_directory, uuid, NULL); | 1433 | char *devbackupdir = build_path(backup_directory, udid, NULL); |
| 1434 | __mkdir(devbackupdir, 0755); | 1434 | __mkdir(devbackupdir, 0755); |
| 1435 | free(devbackupdir); | 1435 | free(devbackupdir); |
| 1436 | 1436 | ||
| @@ -1453,7 +1453,7 @@ checkpoint: | |||
| 1453 | /* request backup from device with manifest from last backup */ | 1453 | /* request backup from device with manifest from last backup */ |
| 1454 | PRINT_VERBOSE(1, "Requesting backup from device...\n"); | 1454 | PRINT_VERBOSE(1, "Requesting backup from device...\n"); |
| 1455 | 1455 | ||
| 1456 | err = mobilebackup2_send_request(mobilebackup2, "Backup", uuid, NULL, NULL); | 1456 | err = mobilebackup2_send_request(mobilebackup2, "Backup", udid, NULL, NULL); |
| 1457 | if (err == MOBILEBACKUP2_E_SUCCESS) { | 1457 | if (err == MOBILEBACKUP2_E_SUCCESS) { |
| 1458 | if (is_full_backup) { | 1458 | if (is_full_backup) { |
| 1459 | PRINT_VERBOSE(1, "Full backup mode.\n"); | 1459 | PRINT_VERBOSE(1, "Full backup mode.\n"); |
| @@ -1475,7 +1475,7 @@ checkpoint: | |||
| 1475 | /* TODO: verify battery on AC enough battery remaining */ | 1475 | /* TODO: verify battery on AC enough battery remaining */ |
| 1476 | 1476 | ||
| 1477 | /* verify if Status.plist says we read from an successful backup */ | 1477 | /* verify if Status.plist says we read from an successful backup */ |
| 1478 | if (!mb2_status_check_snapshot_state(backup_directory, uuid, "finished")) { | 1478 | if (!mb2_status_check_snapshot_state(backup_directory, udid, "finished")) { |
| 1479 | printf("ERROR: Cannot ensure we restore from a successful backup. Aborting.\n"); | 1479 | printf("ERROR: Cannot ensure we restore from a successful backup. Aborting.\n"); |
| 1480 | cmd = CMD_LEAVE; | 1480 | cmd = CMD_LEAVE; |
| 1481 | break; | 1481 | break; |
| @@ -1495,7 +1495,7 @@ checkpoint: | |||
| 1495 | plist_dict_insert_item(opts, "RestorePreserveSettings", plist_new_bool((cmd_flags & CMD_FLAG_RESTORE_SETTINGS) == 0)); | 1495 | plist_dict_insert_item(opts, "RestorePreserveSettings", plist_new_bool((cmd_flags & CMD_FLAG_RESTORE_SETTINGS) == 0)); |
| 1496 | PRINT_VERBOSE(1, "Preserve settings of device: %s\n", ((cmd_flags & CMD_FLAG_RESTORE_SETTINGS) == 0 ? "Yes":"No")); | 1496 | PRINT_VERBOSE(1, "Preserve settings of device: %s\n", ((cmd_flags & CMD_FLAG_RESTORE_SETTINGS) == 0 ? "Yes":"No")); |
| 1497 | 1497 | ||
| 1498 | err = mobilebackup2_send_request(mobilebackup2, "Restore", uuid, uuid, opts); | 1498 | err = mobilebackup2_send_request(mobilebackup2, "Restore", udid, udid, opts); |
| 1499 | plist_free(opts); | 1499 | plist_free(opts); |
| 1500 | if (err != MOBILEBACKUP2_E_SUCCESS) { | 1500 | if (err != MOBILEBACKUP2_E_SUCCESS) { |
| 1501 | if (err == MOBILEBACKUP2_E_BAD_VERSION) { | 1501 | if (err == MOBILEBACKUP2_E_BAD_VERSION) { |
| @@ -1510,7 +1510,7 @@ checkpoint: | |||
| 1510 | break; | 1510 | break; |
| 1511 | case CMD_INFO: | 1511 | case CMD_INFO: |
| 1512 | PRINT_VERBOSE(1, "Requesting backup info from device...\n"); | 1512 | PRINT_VERBOSE(1, "Requesting backup info from device...\n"); |
| 1513 | err = mobilebackup2_send_request(mobilebackup2, "Info", uuid, NULL, NULL); | 1513 | err = mobilebackup2_send_request(mobilebackup2, "Info", udid, NULL, NULL); |
| 1514 | if (err != MOBILEBACKUP2_E_SUCCESS) { | 1514 | if (err != MOBILEBACKUP2_E_SUCCESS) { |
| 1515 | printf("Error requesting backup info from device, error code %d\n", err); | 1515 | printf("Error requesting backup info from device, error code %d\n", err); |
| 1516 | cmd = CMD_LEAVE; | 1516 | cmd = CMD_LEAVE; |
| @@ -1518,7 +1518,7 @@ checkpoint: | |||
| 1518 | break; | 1518 | break; |
| 1519 | case CMD_LIST: | 1519 | case CMD_LIST: |
| 1520 | PRINT_VERBOSE(1, "Requesting backup list from device...\n"); | 1520 | PRINT_VERBOSE(1, "Requesting backup list from device...\n"); |
| 1521 | err = mobilebackup2_send_request(mobilebackup2, "List", uuid, NULL, NULL); | 1521 | err = mobilebackup2_send_request(mobilebackup2, "List", udid, NULL, NULL); |
| 1522 | if (err != MOBILEBACKUP2_E_SUCCESS) { | 1522 | if (err != MOBILEBACKUP2_E_SUCCESS) { |
| 1523 | printf("Error requesting backup list from device, error code %d\n", err); | 1523 | printf("Error requesting backup list from device, error code %d\n", err); |
| 1524 | cmd = CMD_LEAVE; | 1524 | cmd = CMD_LEAVE; |
| @@ -1526,7 +1526,7 @@ checkpoint: | |||
| 1526 | break; | 1526 | break; |
| 1527 | case CMD_UNBACK: | 1527 | case CMD_UNBACK: |
| 1528 | PRINT_VERBOSE(1, "Starting to unpack backup...\n"); | 1528 | PRINT_VERBOSE(1, "Starting to unpack backup...\n"); |
| 1529 | err = mobilebackup2_send_request(mobilebackup2, "Unback", uuid, NULL, NULL); | 1529 | err = mobilebackup2_send_request(mobilebackup2, "Unback", udid, NULL, NULL); |
| 1530 | if (err != MOBILEBACKUP2_E_SUCCESS) { | 1530 | if (err != MOBILEBACKUP2_E_SUCCESS) { |
| 1531 | printf("Error requesting unback operation from device, error code %d\n", err); | 1531 | printf("Error requesting unback operation from device, error code %d\n", err); |
| 1532 | cmd = CMD_LEAVE; | 1532 | cmd = CMD_LEAVE; |
| @@ -1765,7 +1765,7 @@ files_out: | |||
| 1765 | switch (cmd) { | 1765 | switch (cmd) { |
| 1766 | case CMD_BACKUP: | 1766 | case CMD_BACKUP: |
| 1767 | PRINT_VERBOSE(1, "Received %d files from device.\n", file_count); | 1767 | PRINT_VERBOSE(1, "Received %d files from device.\n", file_count); |
| 1768 | if (mb2_status_check_snapshot_state(backup_directory, uuid, "finished")) { | 1768 | if (mb2_status_check_snapshot_state(backup_directory, udid, "finished")) { |
| 1769 | PRINT_VERBOSE(1, "Backup Successful.\n"); | 1769 | PRINT_VERBOSE(1, "Backup Successful.\n"); |
| 1770 | } else { | 1770 | } else { |
| 1771 | if (quit_flag) { | 1771 | if (quit_flag) { |
diff --git a/tools/idevicedate.c b/tools/idevicedate.c index e4e0a33..43a4aee 100644 --- a/tools/idevicedate.c +++ b/tools/idevicedate.c | |||
| @@ -44,7 +44,7 @@ static void print_usage(int argc, char **argv) | |||
| 44 | printf("Usage: %s [OPTIONS]\n", (name ? name + 1: argv[0])); | 44 | printf("Usage: %s [OPTIONS]\n", (name ? name + 1: argv[0])); |
| 45 | printf("Display the current date or set it on an iDevice.\n\n"); | 45 | printf("Display the current date or set it on an iDevice.\n\n"); |
| 46 | printf(" -d, --debug\t\tenable communication debugging\n"); | 46 | printf(" -d, --debug\t\tenable communication debugging\n"); |
| 47 | printf(" -u, --uuid UUID\ttarget specific device by its 40-digit device UUID\n"); | 47 | printf(" -u, --udid UDID\ttarget specific device by its 40-digit device UDID\n"); |
| 48 | printf(" -s, --set TIMESTAMP\tset UTC time described by TIMESTAMP\n"); | 48 | printf(" -s, --set TIMESTAMP\tset UTC time described by TIMESTAMP\n"); |
| 49 | printf(" -c, --sync\t\tset time of device to current system time\n"); | 49 | printf(" -c, --sync\t\tset time of device to current system time\n"); |
| 50 | printf(" -h, --help\t\tprints usage information\n"); | 50 | printf(" -h, --help\t\tprints usage information\n"); |
| @@ -57,10 +57,10 @@ int main(int argc, char *argv[]) | |||
| 57 | idevice_t phone = NULL; | 57 | idevice_t phone = NULL; |
| 58 | idevice_error_t ret = IDEVICE_E_UNKNOWN_ERROR; | 58 | idevice_error_t ret = IDEVICE_E_UNKNOWN_ERROR; |
| 59 | int i; | 59 | int i; |
| 60 | char uuid[41]; | 60 | char udid[41]; |
| 61 | time_t setdate = 0; | 61 | time_t setdate = 0; |
| 62 | plist_t node = NULL; | 62 | plist_t node = NULL; |
| 63 | uuid[0] = 0; | 63 | udid[0] = 0; |
| 64 | uint64_t datetime = 0; | 64 | uint64_t datetime = 0; |
| 65 | time_t rawtime; | 65 | time_t rawtime; |
| 66 | struct tm * tmp; | 66 | struct tm * tmp; |
| @@ -73,13 +73,13 @@ int main(int argc, char *argv[]) | |||
| 73 | idevice_set_debug_level(1); | 73 | idevice_set_debug_level(1); |
| 74 | continue; | 74 | continue; |
| 75 | } | 75 | } |
| 76 | else if (!strcmp(argv[i], "-u") || !strcmp(argv[i], "--uuid")) { | 76 | else if (!strcmp(argv[i], "-u") || !strcmp(argv[i], "--udid")) { |
| 77 | i++; | 77 | i++; |
| 78 | if (!argv[i] || (strlen(argv[i]) != 40)) { | 78 | if (!argv[i] || (strlen(argv[i]) != 40)) { |
| 79 | print_usage(argc, argv); | 79 | print_usage(argc, argv); |
| 80 | return 0; | 80 | return 0; |
| 81 | } | 81 | } |
| 82 | strcpy(uuid, argv[i]); | 82 | strcpy(udid, argv[i]); |
| 83 | continue; | 83 | continue; |
| 84 | } | 84 | } |
| 85 | else if (!strcmp(argv[i], "-s") || !strcmp(argv[i], "--set")) { | 85 | else if (!strcmp(argv[i], "-s") || !strcmp(argv[i], "--set")) { |
| @@ -124,10 +124,10 @@ int main(int argc, char *argv[]) | |||
| 124 | } | 124 | } |
| 125 | } | 125 | } |
| 126 | 126 | ||
| 127 | if (uuid[0] != 0) { | 127 | if (udid[0] != 0) { |
| 128 | ret = idevice_new(&phone, uuid); | 128 | ret = idevice_new(&phone, udid); |
| 129 | if (ret != IDEVICE_E_SUCCESS) { | 129 | if (ret != IDEVICE_E_SUCCESS) { |
| 130 | printf("No device found with uuid %s, is it plugged in?\n", uuid); | 130 | printf("No device found with udid %s, is it plugged in?\n", udid); |
| 131 | return -1; | 131 | return -1; |
| 132 | } | 132 | } |
| 133 | } | 133 | } |
diff --git a/tools/ideviceenterrecovery.c b/tools/ideviceenterrecovery.c index 827946b..fc46e75 100644 --- a/tools/ideviceenterrecovery.c +++ b/tools/ideviceenterrecovery.c | |||
| @@ -32,8 +32,8 @@ static void print_usage(int argc, char **argv) | |||
| 32 | char *name = NULL; | 32 | char *name = NULL; |
| 33 | 33 | ||
| 34 | name = strrchr(argv[0], '/'); | 34 | name = strrchr(argv[0], '/'); |
| 35 | printf("Usage: %s [OPTIONS] UUID\n", (name ? name + 1: argv[0])); | 35 | printf("Usage: %s [OPTIONS] UDID\n", (name ? name + 1: argv[0])); |
| 36 | printf("Makes a device with the supplied 40-digit UUID enter recovery mode immediately.\n\n"); | 36 | printf("Makes a device with the supplied 40-digit UDID enter recovery mode immediately.\n\n"); |
| 37 | printf(" -d, --debug\t\tenable communication debugging\n"); | 37 | printf(" -d, --debug\t\tenable communication debugging\n"); |
| 38 | printf(" -h, --help\t\tprints usage information\n"); | 38 | printf(" -h, --help\t\tprints usage information\n"); |
| 39 | printf("\n"); | 39 | printf("\n"); |
| @@ -45,8 +45,8 @@ int main(int argc, char *argv[]) | |||
| 45 | idevice_t phone = NULL; | 45 | idevice_t phone = NULL; |
| 46 | idevice_error_t ret = IDEVICE_E_UNKNOWN_ERROR; | 46 | idevice_error_t ret = IDEVICE_E_UNKNOWN_ERROR; |
| 47 | int i; | 47 | int i; |
| 48 | char uuid[41]; | 48 | char udid[41]; |
| 49 | uuid[0] = 0; | 49 | udid[0] = 0; |
| 50 | 50 | ||
| 51 | /* parse cmdline args */ | 51 | /* parse cmdline args */ |
| 52 | for (i = 1; i < argc; i++) { | 52 | for (i = 1; i < argc; i++) { |
| @@ -65,11 +65,11 @@ int main(int argc, char *argv[]) | |||
| 65 | print_usage(argc, argv); | 65 | print_usage(argc, argv); |
| 66 | return 0; | 66 | return 0; |
| 67 | } | 67 | } |
| 68 | strcpy(uuid, argv[i]); | 68 | strcpy(udid, argv[i]); |
| 69 | 69 | ||
| 70 | ret = idevice_new(&phone, uuid); | 70 | ret = idevice_new(&phone, udid); |
| 71 | if (ret != IDEVICE_E_SUCCESS) { | 71 | if (ret != IDEVICE_E_SUCCESS) { |
| 72 | printf("No device found with uuid %s, is it plugged in?\n", uuid); | 72 | printf("No device found with udid %s, is it plugged in?\n", udid); |
| 73 | return -1; | 73 | return -1; |
| 74 | } | 74 | } |
| 75 | 75 | ||
| @@ -79,7 +79,7 @@ int main(int argc, char *argv[]) | |||
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | /* run query and output information */ | 81 | /* run query and output information */ |
| 82 | printf("Telling device with uuid %s to enter recovery mode.\n", uuid); | 82 | printf("Telling device with udid %s to enter recovery mode.\n", udid); |
| 83 | if(lockdownd_enter_recovery(client) != LOCKDOWN_E_SUCCESS) | 83 | if(lockdownd_enter_recovery(client) != LOCKDOWN_E_SUCCESS) |
| 84 | { | 84 | { |
| 85 | printf("Failed to enter recovery mode.\n"); | 85 | printf("Failed to enter recovery mode.\n"); |
diff --git a/tools/ideviceimagemounter.c b/tools/ideviceimagemounter.c index 4a650ee..a9f6142 100644 --- a/tools/ideviceimagemounter.c +++ b/tools/ideviceimagemounter.c | |||
| @@ -43,7 +43,7 @@ static int indent_level = 0; | |||
| 43 | 43 | ||
| 44 | static int list_mode = 0; | 44 | static int list_mode = 0; |
| 45 | static int xml_mode = 0; | 45 | static int xml_mode = 0; |
| 46 | static char *uuid = NULL; | 46 | static char *udid = NULL; |
| 47 | static char *imagetype = NULL; | 47 | static char *imagetype = NULL; |
| 48 | 48 | ||
| 49 | static const char PKG_PATH[] = "PublicStaging"; | 49 | static const char PKG_PATH[] = "PublicStaging"; |
| @@ -56,7 +56,7 @@ static void print_usage(int argc, char **argv) | |||
| 56 | name = strrchr(argv[0], '/'); | 56 | name = strrchr(argv[0], '/'); |
| 57 | printf("Usage: %s [OPTIONS] IMAGE_FILE IMAGE_SIGNATURE_FILE\n\n", (name ? name + 1: argv[0])); | 57 | printf("Usage: %s [OPTIONS] IMAGE_FILE IMAGE_SIGNATURE_FILE\n\n", (name ? name + 1: argv[0])); |
| 58 | printf("Mounts the specified disk image on the device.\n\n"); | 58 | printf("Mounts the specified disk image on the device.\n\n"); |
| 59 | printf(" -u, --uuid UUID\ttarget specific device by its 40-digit device UUID\n"); | 59 | printf(" -u, --udid UDID\ttarget specific device by its 40-digit device UDID\n"); |
| 60 | printf(" -l, --list\t\tList mount information\n"); | 60 | printf(" -l, --list\t\tList mount information\n"); |
| 61 | printf(" -t, --imagetype\tImage type to use, default is 'Developer'\n"); | 61 | printf(" -t, --imagetype\tImage type to use, default is 'Developer'\n"); |
| 62 | printf(" -x, --xml\t\tUse XML output\n"); | 62 | printf(" -x, --xml\t\tUse XML output\n"); |
| @@ -69,7 +69,7 @@ static void parse_opts(int argc, char **argv) | |||
| 69 | { | 69 | { |
| 70 | static struct option longopts[] = { | 70 | static struct option longopts[] = { |
| 71 | {"help", 0, NULL, 'h'}, | 71 | {"help", 0, NULL, 'h'}, |
| 72 | {"uuid", 0, NULL, 'u'}, | 72 | {"udid", 0, NULL, 'u'}, |
| 73 | {"list", 0, NULL, 'l'}, | 73 | {"list", 0, NULL, 'l'}, |
| 74 | {"imagetype", 0, NULL, 't'}, | 74 | {"imagetype", 0, NULL, 't'}, |
| 75 | {"xml", 0, NULL, 'x'}, | 75 | {"xml", 0, NULL, 'x'}, |
| @@ -91,12 +91,12 @@ static void parse_opts(int argc, char **argv) | |||
| 91 | exit(0); | 91 | exit(0); |
| 92 | case 'u': | 92 | case 'u': |
| 93 | if (strlen(optarg) != 40) { | 93 | if (strlen(optarg) != 40) { |
| 94 | printf("%s: invalid UUID specified (length != 40)\n", | 94 | printf("%s: invalid UDID specified (length != 40)\n", |
| 95 | argv[0]); | 95 | argv[0]); |
| 96 | print_usage(argc, argv); | 96 | print_usage(argc, argv); |
| 97 | exit(2); | 97 | exit(2); |
| 98 | } | 98 | } |
| 99 | uuid = strdup(optarg); | 99 | udid = strdup(optarg); |
| 100 | break; | 100 | break; |
| 101 | case 'l': | 101 | case 'l': |
| 102 | list_mode = 1; | 102 | list_mode = 1; |
| @@ -295,7 +295,7 @@ int main(int argc, char **argv) | |||
| 295 | } | 295 | } |
| 296 | } | 296 | } |
| 297 | 297 | ||
| 298 | if (IDEVICE_E_SUCCESS != idevice_new(&device, uuid)) { | 298 | if (IDEVICE_E_SUCCESS != idevice_new(&device, udid)) { |
| 299 | printf("No device found, is it plugged in?\n"); | 299 | printf("No device found, is it plugged in?\n"); |
| 300 | return -1; | 300 | return -1; |
| 301 | } | 301 | } |
diff --git a/tools/ideviceinfo.c b/tools/ideviceinfo.c index 6633459..ca4b246 100644 --- a/tools/ideviceinfo.c +++ b/tools/ideviceinfo.c | |||
| @@ -256,7 +256,7 @@ static void print_usage(int argc, char **argv) | |||
| 256 | printf("Show information about a connected iPhone/iPod Touch.\n\n"); | 256 | printf("Show information about a connected iPhone/iPod Touch.\n\n"); |
| 257 | printf(" -d, --debug\t\tenable communication debugging\n"); | 257 | printf(" -d, --debug\t\tenable communication debugging\n"); |
| 258 | printf(" -s, --simple\t\tuse a simple connection to avoid auto-pairing with the device\n"); | 258 | printf(" -s, --simple\t\tuse a simple connection to avoid auto-pairing with the device\n"); |
| 259 | printf(" -u, --uuid UUID\ttarget specific device by its 40-digit device UUID\n"); | 259 | printf(" -u, --udid UDID\ttarget specific device by its 40-digit device UDID\n"); |
| 260 | printf(" -q, --domain NAME\tset domain of query to NAME. Default: None\n"); | 260 | printf(" -q, --domain NAME\tset domain of query to NAME. Default: None\n"); |
| 261 | printf(" -k, --key NAME\tonly query key specified by NAME. Default: All keys.\n"); | 261 | printf(" -k, --key NAME\tonly query key specified by NAME. Default: All keys.\n"); |
| 262 | printf(" -x, --xml\t\toutput information as xml plist instead of key/value pairs\n"); | 262 | printf(" -x, --xml\t\toutput information as xml plist instead of key/value pairs\n"); |
| @@ -277,14 +277,14 @@ int main(int argc, char *argv[]) | |||
| 277 | int i; | 277 | int i; |
| 278 | int simple = 0; | 278 | int simple = 0; |
| 279 | int format = FORMAT_KEY_VALUE; | 279 | int format = FORMAT_KEY_VALUE; |
| 280 | char uuid[41]; | 280 | char udid[41]; |
| 281 | char *domain = NULL; | 281 | char *domain = NULL; |
| 282 | char *key = NULL; | 282 | char *key = NULL; |
| 283 | char *xml_doc = NULL; | 283 | char *xml_doc = NULL; |
| 284 | uint32_t xml_length; | 284 | uint32_t xml_length; |
| 285 | plist_t node = NULL; | 285 | plist_t node = NULL; |
| 286 | plist_type node_type; | 286 | plist_type node_type; |
| 287 | uuid[0] = 0; | 287 | udid[0] = 0; |
| 288 | 288 | ||
| 289 | /* parse cmdline args */ | 289 | /* parse cmdline args */ |
| 290 | for (i = 1; i < argc; i++) { | 290 | for (i = 1; i < argc; i++) { |
| @@ -292,13 +292,13 @@ int main(int argc, char *argv[]) | |||
| 292 | idevice_set_debug_level(1); | 292 | idevice_set_debug_level(1); |
| 293 | continue; | 293 | continue; |
| 294 | } | 294 | } |
| 295 | else if (!strcmp(argv[i], "-u") || !strcmp(argv[i], "--uuid")) { | 295 | else if (!strcmp(argv[i], "-u") || !strcmp(argv[i], "--udid")) { |
| 296 | i++; | 296 | i++; |
| 297 | if (!argv[i] || (strlen(argv[i]) != 40)) { | 297 | if (!argv[i] || (strlen(argv[i]) != 40)) { |
| 298 | print_usage(argc, argv); | 298 | print_usage(argc, argv); |
| 299 | return 0; | 299 | return 0; |
| 300 | } | 300 | } |
| 301 | strcpy(uuid, argv[i]); | 301 | strcpy(udid, argv[i]); |
| 302 | continue; | 302 | continue; |
| 303 | } | 303 | } |
| 304 | else if (!strcmp(argv[i], "-q") || !strcmp(argv[i], "--domain")) { | 304 | else if (!strcmp(argv[i], "-q") || !strcmp(argv[i], "--domain")) { |
| @@ -340,10 +340,10 @@ int main(int argc, char *argv[]) | |||
| 340 | } | 340 | } |
| 341 | } | 341 | } |
| 342 | 342 | ||
| 343 | if (uuid[0] != 0) { | 343 | if (udid[0] != 0) { |
| 344 | ret = idevice_new(&phone, uuid); | 344 | ret = idevice_new(&phone, udid); |
| 345 | if (ret != IDEVICE_E_SUCCESS) { | 345 | if (ret != IDEVICE_E_SUCCESS) { |
| 346 | printf("No device found with uuid %s, is it plugged in?\n", uuid); | 346 | printf("No device found with udid %s, is it plugged in?\n", udid); |
| 347 | return -1; | 347 | return -1; |
| 348 | } | 348 | } |
| 349 | } | 349 | } |
diff --git a/tools/idevicepair.c b/tools/idevicepair.c index 9eebc5c..d810365 100644 --- a/tools/idevicepair.c +++ b/tools/idevicepair.c | |||
| @@ -28,7 +28,7 @@ | |||
| 28 | #include <libimobiledevice/libimobiledevice.h> | 28 | #include <libimobiledevice/libimobiledevice.h> |
| 29 | #include <libimobiledevice/lockdown.h> | 29 | #include <libimobiledevice/lockdown.h> |
| 30 | 30 | ||
| 31 | static char *uuid = NULL; | 31 | static char *udid = NULL; |
| 32 | 32 | ||
| 33 | static void print_usage(int argc, char **argv) | 33 | static void print_usage(int argc, char **argv) |
| 34 | { | 34 | { |
| @@ -45,7 +45,7 @@ static void print_usage(int argc, char **argv) | |||
| 45 | printf(" list list devices paired with this computer\n\n"); | 45 | printf(" list list devices paired with this computer\n\n"); |
| 46 | printf(" The following OPTIONS are accepted:\n"); | 46 | printf(" The following OPTIONS are accepted:\n"); |
| 47 | printf(" -d, --debug enable communication debugging\n"); | 47 | printf(" -d, --debug enable communication debugging\n"); |
| 48 | printf(" -u, --uuid UUID target specific device by its 40-digit device UUID\n"); | 48 | printf(" -u, --udid UDID target specific device by its 40-digit device UDID\n"); |
| 49 | printf(" -h, --help prints usage information\n"); | 49 | printf(" -h, --help prints usage information\n"); |
| 50 | printf("\n"); | 50 | printf("\n"); |
| 51 | } | 51 | } |
| @@ -54,7 +54,7 @@ static void parse_opts(int argc, char **argv) | |||
| 54 | { | 54 | { |
| 55 | static struct option longopts[] = { | 55 | static struct option longopts[] = { |
| 56 | {"help", 0, NULL, 'h'}, | 56 | {"help", 0, NULL, 'h'}, |
| 57 | {"uuid", 1, NULL, 'u'}, | 57 | {"udid", 1, NULL, 'u'}, |
| 58 | {"debug", 0, NULL, 'd'}, | 58 | {"debug", 0, NULL, 'd'}, |
| 59 | {NULL, 0, NULL, 0} | 59 | {NULL, 0, NULL, 0} |
| 60 | }; | 60 | }; |
| @@ -72,11 +72,11 @@ static void parse_opts(int argc, char **argv) | |||
| 72 | exit(EXIT_SUCCESS); | 72 | exit(EXIT_SUCCESS); |
| 73 | case 'u': | 73 | case 'u': |
| 74 | if (strlen(optarg) != 40) { | 74 | if (strlen(optarg) != 40) { |
| 75 | printf("%s: invalid UUID specified (length != 40)\n", argv[0]); | 75 | printf("%s: invalid UDID specified (length != 40)\n", argv[0]); |
| 76 | print_usage(argc, argv); | 76 | print_usage(argc, argv); |
| 77 | exit(2); | 77 | exit(2); |
| 78 | } | 78 | } |
| 79 | uuid = strdup(optarg); | 79 | udid = strdup(optarg); |
| 80 | break; | 80 | break; |
| 81 | case 'd': | 81 | case 'd': |
| 82 | idevice_set_debug_level(1); | 82 | idevice_set_debug_level(1); |
| @@ -143,26 +143,26 @@ int main(int argc, char **argv) | |||
| 143 | 143 | ||
| 144 | if (op == OP_LIST) { | 144 | if (op == OP_LIST) { |
| 145 | unsigned int i; | 145 | unsigned int i; |
| 146 | char **uuids = NULL; | 146 | char **udids = NULL; |
| 147 | unsigned int count = 0; | 147 | unsigned int count = 0; |
| 148 | userpref_get_paired_uuids(&uuids, &count); | 148 | userpref_get_paired_udids(&udids, &count); |
| 149 | for (i = 0; i < count; i++) { | 149 | for (i = 0; i < count; i++) { |
| 150 | printf("%s\n", uuids[i]); | 150 | printf("%s\n", udids[i]); |
| 151 | free(uuids[i]); | 151 | free(udids[i]); |
| 152 | } | 152 | } |
| 153 | if (uuids) | 153 | if (udids) |
| 154 | free(uuids); | 154 | free(udids); |
| 155 | if (uuid) | 155 | if (udid) |
| 156 | free(uuid); | 156 | free(udid); |
| 157 | return EXIT_SUCCESS; | 157 | return EXIT_SUCCESS; |
| 158 | } | 158 | } |
| 159 | 159 | ||
| 160 | if (uuid) { | 160 | if (udid) { |
| 161 | ret = idevice_new(&phone, uuid); | 161 | ret = idevice_new(&phone, udid); |
| 162 | free(uuid); | 162 | free(udid); |
| 163 | uuid = NULL; | 163 | udid = NULL; |
| 164 | if (ret != IDEVICE_E_SUCCESS) { | 164 | if (ret != IDEVICE_E_SUCCESS) { |
| 165 | printf("No device found with uuid %s, is it plugged in?\n", uuid); | 165 | printf("No device found with udid %s, is it plugged in?\n", udid); |
| 166 | return EXIT_FAILURE; | 166 | return EXIT_FAILURE; |
| 167 | } | 167 | } |
| 168 | } else { | 168 | } else { |
| @@ -196,9 +196,9 @@ int main(int argc, char **argv) | |||
| 196 | } | 196 | } |
| 197 | } | 197 | } |
| 198 | 198 | ||
| 199 | ret = idevice_get_uuid(phone, &uuid); | 199 | ret = idevice_get_udid(phone, &udid); |
| 200 | if (ret != IDEVICE_E_SUCCESS) { | 200 | if (ret != IDEVICE_E_SUCCESS) { |
| 201 | printf("ERROR: Could not get device uuid, error code %d\n", ret); | 201 | printf("ERROR: Could not get device udid, error code %d\n", ret); |
| 202 | result = EXIT_FAILURE; | 202 | result = EXIT_FAILURE; |
| 203 | goto leave; | 203 | goto leave; |
| 204 | } | 204 | } |
| @@ -208,13 +208,13 @@ int main(int argc, char **argv) | |||
| 208 | case OP_PAIR: | 208 | case OP_PAIR: |
| 209 | lerr = lockdownd_pair(client, NULL); | 209 | lerr = lockdownd_pair(client, NULL); |
| 210 | if (lerr == LOCKDOWN_E_SUCCESS) { | 210 | if (lerr == LOCKDOWN_E_SUCCESS) { |
| 211 | printf("SUCCESS: Paired with device %s\n", uuid); | 211 | printf("SUCCESS: Paired with device %s\n", udid); |
| 212 | } else { | 212 | } else { |
| 213 | result = EXIT_FAILURE; | 213 | result = EXIT_FAILURE; |
| 214 | if (lerr == LOCKDOWN_E_PASSWORD_PROTECTED) { | 214 | if (lerr == LOCKDOWN_E_PASSWORD_PROTECTED) { |
| 215 | printf("ERROR: Could not pair with the device because a passcode is set. Please enter the passcode on the device and retry.\n"); | 215 | printf("ERROR: Could not pair with the device because a passcode is set. Please enter the passcode on the device and retry.\n"); |
| 216 | } else { | 216 | } else { |
| 217 | printf("ERROR: Pairing with device %s failed with unhandled error code %d\n", uuid, lerr); | 217 | printf("ERROR: Pairing with device %s failed with unhandled error code %d\n", udid, lerr); |
| 218 | } | 218 | } |
| 219 | } | 219 | } |
| 220 | break; | 220 | break; |
| @@ -222,13 +222,13 @@ int main(int argc, char **argv) | |||
| 222 | case OP_VALIDATE: | 222 | case OP_VALIDATE: |
| 223 | lerr = lockdownd_validate_pair(client, NULL); | 223 | lerr = lockdownd_validate_pair(client, NULL); |
| 224 | if (lerr == LOCKDOWN_E_SUCCESS) { | 224 | if (lerr == LOCKDOWN_E_SUCCESS) { |
| 225 | printf("SUCCESS: Validated pairing with device %s\n", uuid); | 225 | printf("SUCCESS: Validated pairing with device %s\n", udid); |
| 226 | } else { | 226 | } else { |
| 227 | result = EXIT_FAILURE; | 227 | result = EXIT_FAILURE; |
| 228 | if (lerr == LOCKDOWN_E_PASSWORD_PROTECTED) { | 228 | if (lerr == LOCKDOWN_E_PASSWORD_PROTECTED) { |
| 229 | printf("ERROR: Could not validate with the device because a passcode is set. Please enter the passcode on the device and retry.\n"); | 229 | printf("ERROR: Could not validate with the device because a passcode is set. Please enter the passcode on the device and retry.\n"); |
| 230 | } else if (lerr == LOCKDOWN_E_INVALID_HOST_ID) { | 230 | } else if (lerr == LOCKDOWN_E_INVALID_HOST_ID) { |
| 231 | printf("ERROR: Device %s is not paired with this host\n", uuid); | 231 | printf("ERROR: Device %s is not paired with this host\n", udid); |
| 232 | } else { | 232 | } else { |
| 233 | printf("ERROR: Pairing failed with unhandled error code %d\n", lerr); | 233 | printf("ERROR: Pairing failed with unhandled error code %d\n", lerr); |
| 234 | } | 234 | } |
| @@ -239,14 +239,14 @@ int main(int argc, char **argv) | |||
| 239 | lerr = lockdownd_unpair(client, NULL); | 239 | lerr = lockdownd_unpair(client, NULL); |
| 240 | if (lerr == LOCKDOWN_E_SUCCESS) { | 240 | if (lerr == LOCKDOWN_E_SUCCESS) { |
| 241 | /* also remove local device public key */ | 241 | /* also remove local device public key */ |
| 242 | userpref_remove_device_public_key(uuid); | 242 | userpref_remove_device_public_key(udid); |
| 243 | printf("SUCCESS: Unpaired with device %s\n", uuid); | 243 | printf("SUCCESS: Unpaired with device %s\n", udid); |
| 244 | } else { | 244 | } else { |
| 245 | result = EXIT_FAILURE; | 245 | result = EXIT_FAILURE; |
| 246 | if (lerr == LOCKDOWN_E_INVALID_HOST_ID) { | 246 | if (lerr == LOCKDOWN_E_INVALID_HOST_ID) { |
| 247 | printf("ERROR: Device %s is not paired with this host\n", uuid); | 247 | printf("ERROR: Device %s is not paired with this host\n", udid); |
| 248 | } else { | 248 | } else { |
| 249 | printf("ERROR: Unpairing with device %s failed with unhandled error code %d\n", uuid, lerr); | 249 | printf("ERROR: Unpairing with device %s failed with unhandled error code %d\n", udid, lerr); |
| 250 | } | 250 | } |
| 251 | } | 251 | } |
| 252 | break; | 252 | break; |
| @@ -255,8 +255,8 @@ int main(int argc, char **argv) | |||
| 255 | leave: | 255 | leave: |
| 256 | lockdownd_client_free(client); | 256 | lockdownd_client_free(client); |
| 257 | idevice_free(phone); | 257 | idevice_free(phone); |
| 258 | if (uuid) { | 258 | if (udid) { |
| 259 | free(uuid); | 259 | free(udid); |
| 260 | } | 260 | } |
| 261 | return result; | 261 | return result; |
| 262 | } | 262 | } |
diff --git a/tools/idevicescreenshot.c b/tools/idevicescreenshot.c index 31717dd..8f75fd1 100644 --- a/tools/idevicescreenshot.c +++ b/tools/idevicescreenshot.c | |||
| @@ -41,7 +41,7 @@ int main(int argc, char **argv) | |||
| 41 | uint16_t port = 0; | 41 | uint16_t port = 0; |
| 42 | int result = -1; | 42 | int result = -1; |
| 43 | int i; | 43 | int i; |
| 44 | char *uuid = NULL; | 44 | char *udid = NULL; |
| 45 | 45 | ||
| 46 | /* parse cmdline args */ | 46 | /* parse cmdline args */ |
| 47 | for (i = 1; i < argc; i++) { | 47 | for (i = 1; i < argc; i++) { |
| @@ -49,13 +49,13 @@ int main(int argc, char **argv) | |||
| 49 | idevice_set_debug_level(1); | 49 | idevice_set_debug_level(1); |
| 50 | continue; | 50 | continue; |
| 51 | } | 51 | } |
| 52 | else if (!strcmp(argv[i], "-u") || !strcmp(argv[i], "--uuid")) { | 52 | else if (!strcmp(argv[i], "-u") || !strcmp(argv[i], "--udid")) { |
| 53 | i++; | 53 | i++; |
| 54 | if (!argv[i] || (strlen(argv[i]) != 40)) { | 54 | if (!argv[i] || (strlen(argv[i]) != 40)) { |
| 55 | print_usage(argc, argv); | 55 | print_usage(argc, argv); |
| 56 | return 0; | 56 | return 0; |
| 57 | } | 57 | } |
| 58 | uuid = strdup(argv[i]); | 58 | udid = strdup(argv[i]); |
| 59 | continue; | 59 | continue; |
| 60 | } | 60 | } |
| 61 | else if (!strcmp(argv[i], "-h") || !strcmp(argv[i], "--help")) { | 61 | else if (!strcmp(argv[i], "-h") || !strcmp(argv[i], "--help")) { |
| @@ -68,15 +68,15 @@ int main(int argc, char **argv) | |||
| 68 | } | 68 | } |
| 69 | } | 69 | } |
| 70 | 70 | ||
| 71 | if (IDEVICE_E_SUCCESS != idevice_new(&device, uuid)) { | 71 | if (IDEVICE_E_SUCCESS != idevice_new(&device, udid)) { |
| 72 | printf("No device found, is it plugged in?\n"); | 72 | printf("No device found, is it plugged in?\n"); |
| 73 | if (uuid) { | 73 | if (udid) { |
| 74 | free(uuid); | 74 | free(udid); |
| 75 | } | 75 | } |
| 76 | return -1; | 76 | return -1; |
| 77 | } | 77 | } |
| 78 | if (uuid) { | 78 | if (udid) { |
| 79 | free(uuid); | 79 | free(udid); |
| 80 | } | 80 | } |
| 81 | 81 | ||
| 82 | if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake(device, &lckd, NULL)) { | 82 | if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake(device, &lckd, NULL)) { |
| @@ -133,7 +133,7 @@ void print_usage(int argc, char **argv) | |||
| 133 | printf("NOTE: A mounted developer disk image is required on the device, otherwise\n"); | 133 | printf("NOTE: A mounted developer disk image is required on the device, otherwise\n"); |
| 134 | printf("the screenshotr service is not available.\n\n"); | 134 | printf("the screenshotr service is not available.\n\n"); |
| 135 | printf(" -d, --debug\t\tenable communication debugging\n"); | 135 | printf(" -d, --debug\t\tenable communication debugging\n"); |
| 136 | printf(" -u, --uuid UUID\ttarget specific device by its 40-digit device UUID\n"); | 136 | printf(" -u, --udid UDID\ttarget specific device by its 40-digit device UDID\n"); |
| 137 | printf(" -h, --help\t\tprints usage information\n"); | 137 | printf(" -h, --help\t\tprints usage information\n"); |
| 138 | printf("\n"); | 138 | printf("\n"); |
| 139 | } | 139 | } |
diff --git a/tools/idevicesyslog.c b/tools/idevicesyslog.c index 3fc7922..abaef47 100644 --- a/tools/idevicesyslog.c +++ b/tools/idevicesyslog.c | |||
| @@ -48,9 +48,9 @@ int main(int argc, char *argv[]) | |||
| 48 | idevice_t phone = NULL; | 48 | idevice_t phone = NULL; |
| 49 | idevice_error_t ret = IDEVICE_E_UNKNOWN_ERROR; | 49 | idevice_error_t ret = IDEVICE_E_UNKNOWN_ERROR; |
| 50 | int i; | 50 | int i; |
| 51 | char uuid[41]; | 51 | char udid[41]; |
| 52 | uint16_t port = 0; | 52 | uint16_t port = 0; |
| 53 | uuid[0] = 0; | 53 | udid[0] = 0; |
| 54 | 54 | ||
| 55 | signal(SIGINT, clean_exit); | 55 | signal(SIGINT, clean_exit); |
| 56 | signal(SIGTERM, clean_exit); | 56 | signal(SIGTERM, clean_exit); |
| @@ -65,13 +65,13 @@ int main(int argc, char *argv[]) | |||
| 65 | idevice_set_debug_level(1); | 65 | idevice_set_debug_level(1); |
| 66 | continue; | 66 | continue; |
| 67 | } | 67 | } |
| 68 | else if (!strcmp(argv[i], "-u") || !strcmp(argv[i], "--uuid")) { | 68 | else if (!strcmp(argv[i], "-u") || !strcmp(argv[i], "--udid")) { |
| 69 | i++; | 69 | i++; |
| 70 | if (!argv[i] || (strlen(argv[i]) != 40)) { | 70 | if (!argv[i] || (strlen(argv[i]) != 40)) { |
| 71 | print_usage(argc, argv); | 71 | print_usage(argc, argv); |
| 72 | return 0; | 72 | return 0; |
| 73 | } | 73 | } |
| 74 | strcpy(uuid, argv[i]); | 74 | strcpy(udid, argv[i]); |
| 75 | continue; | 75 | continue; |
| 76 | } | 76 | } |
| 77 | else if (!strcmp(argv[i], "-h") || !strcmp(argv[i], "--help")) { | 77 | else if (!strcmp(argv[i], "-h") || !strcmp(argv[i], "--help")) { |
| @@ -84,10 +84,10 @@ int main(int argc, char *argv[]) | |||
| 84 | } | 84 | } |
| 85 | } | 85 | } |
| 86 | 86 | ||
| 87 | if (uuid[0] != 0) { | 87 | if (udid[0] != 0) { |
| 88 | ret = idevice_new(&phone, uuid); | 88 | ret = idevice_new(&phone, udid); |
| 89 | if (ret != IDEVICE_E_SUCCESS) { | 89 | if (ret != IDEVICE_E_SUCCESS) { |
| 90 | printf("No device found with uuid %s, is it plugged in?\n", uuid); | 90 | printf("No device found with udid %s, is it plugged in?\n", udid); |
| 91 | return -1; | 91 | return -1; |
| 92 | } | 92 | } |
| 93 | } | 93 | } |
| @@ -166,7 +166,7 @@ void print_usage(int argc, char **argv) | |||
| 166 | printf("Usage: %s [OPTIONS]\n", (name ? name + 1: argv[0])); | 166 | printf("Usage: %s [OPTIONS]\n", (name ? name + 1: argv[0])); |
| 167 | printf("Relay syslog of a connected iPhone/iPod Touch.\n\n"); | 167 | printf("Relay syslog of a connected iPhone/iPod Touch.\n\n"); |
| 168 | printf(" -d, --debug\t\tenable communication debugging\n"); | 168 | printf(" -d, --debug\t\tenable communication debugging\n"); |
| 169 | printf(" -u, --uuid UUID\ttarget specific device by its 40-digit device UUID\n"); | 169 | printf(" -u, --udid UDID\ttarget specific device by its 40-digit device UDID\n"); |
| 170 | printf(" -h, --help\t\tprints usage information\n"); | 170 | printf(" -h, --help\t\tprints usage information\n"); |
| 171 | printf("\n"); | 171 | printf("\n"); |
| 172 | } | 172 | } |
