diff options
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) char *name = NULL; name = strrchr(argv[0], '/'); - printf("Usage: %s [OPTIONS] [UUID]\n", (name ? name + 1: argv[0])); + printf("Usage: %s [OPTIONS] [UDID]\n", (name ? name + 1: argv[0])); printf("Prints device name or a list of attached iPhone/iPod Touch devices.\n\n"); - printf(" The UUID is a 40-digit hexadecimal number of the device\n"); + printf(" The UDID is a 40-digit hexadecimal number of the device\n"); printf(" for which the name should be retrieved.\n\n"); - printf(" -l, --list\t\tlist UUID of all attached devices\n"); + printf(" -l, --list\t\tlist UDID of all attached devices\n"); printf(" -d, --debug\t\tenable communication debugging\n"); printf(" -h, --help\t\tprints usage information\n"); printf("\n"); @@ -32,8 +32,8 @@ int main(int argc, char **argv) int ret = 0; int i; int mode = MODE_SHOW_ID; - char uuid[41]; - uuid[0] = 0; + char udid[41]; + udid[0] = 0; /* parse cmdline args */ for (i = 1; i < argc; i++) { @@ -51,21 +51,21 @@ int main(int argc, char **argv) } } - /* check if uuid was passed */ + /* check if udid was passed */ if (mode == MODE_SHOW_ID) { i--; if (!argv[i] || (strlen(argv[i]) != 40)) { print_usage(argc, argv); return 0; } - strcpy(uuid, argv[i]); + strcpy(udid, argv[i]); } switch (mode) { case MODE_SHOW_ID: - idevice_new(&phone, uuid); + idevice_new(&phone, udid); if (!phone) { - fprintf(stderr, "ERROR: No device with UUID=%s attached.\n", uuid); + fprintf(stderr, "ERROR: No device with UDID=%s attached.\n", udid); return -2; } 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() /* gather data from lockdown */ plist_t value_node = NULL; plist_t root_node = NULL; - char *uuid = NULL; - char *uuid_uppercase = NULL; + char *udid = NULL; + char *udid_uppercase = NULL; plist_t ret = plist_new_dict(); @@ -323,14 +323,14 @@ static plist_t mobilebackup_factory_info_plist_new() plist_dict_insert_item(ret, "Serial Number", plist_copy(value_node)); value_node = plist_dict_get_item(root_node, "UniqueDeviceID"); - idevice_get_uuid(phone, &uuid); - plist_dict_insert_item(ret, "Target Identifier", plist_new_string(uuid)); + idevice_get_udid(phone, &udid); + plist_dict_insert_item(ret, "Target Identifier", plist_new_string(udid)); /* uppercase */ - uuid_uppercase = str_toupper(uuid); - plist_dict_insert_item(ret, "Unique Identifier", plist_new_string(uuid_uppercase)); - free(uuid_uppercase); - free(uuid); + udid_uppercase = str_toupper(udid); + plist_dict_insert_item(ret, "Unique Identifier", plist_new_string(udid_uppercase)); + free(udid_uppercase); + free(udid); /* FIXME: Embed files as <data> nodes */ plist_t files = plist_new_dict(); @@ -521,7 +521,7 @@ static int mobilebackup_info_is_current_device(plist_t info) /* get basic device information in one go */ lockdownd_get_value(client, NULL, NULL, &root_node); - /* verify UUID */ + /* verify UDID */ value_node = plist_dict_get_item(root_node, "UniqueDeviceID"); node = plist_dict_get_item(info, "Target Identifier"); @@ -810,7 +810,7 @@ static void print_usage(int argc, char **argv) printf(" restore\tRestores a device backup from DIRECTORY.\n\n"); printf("options:\n"); printf(" -d, --debug\t\tenable communication debugging\n"); - printf(" -u, --uuid UUID\ttarget specific device by its 40-digit device UUID\n"); + printf(" -u, --udid UDID\ttarget specific device by its 40-digit device UDID\n"); printf(" -h, --help\t\tprints usage information\n"); printf("\n"); } @@ -819,9 +819,9 @@ int main(int argc, char *argv[]) { idevice_error_t ret = IDEVICE_E_UNKNOWN_ERROR; int i; - char uuid[41]; + char udid[41]; uint16_t port = 0; - uuid[0] = 0; + udid[0] = 0; int cmd = -1; int is_full_backup = 0; char *backup_directory = NULL; @@ -851,13 +851,13 @@ int main(int argc, char *argv[]) idevice_set_debug_level(1); continue; } - else if (!strcmp(argv[i], "-u") || !strcmp(argv[i], "--uuid")) { + else if (!strcmp(argv[i], "-u") || !strcmp(argv[i], "--udid")) { i++; if (!argv[i] || (strlen(argv[i]) != 40)) { print_usage(argc, argv); return 0; } - strcpy(uuid, argv[i]); + strcpy(udid, argv[i]); continue; } else if (!strcmp(argv[i], "-h") || !strcmp(argv[i], "--help")) { @@ -910,10 +910,10 @@ int main(int argc, char *argv[]) printf("Backup directory is \"%s\"\n", backup_directory); - if (uuid[0] != 0) { - ret = idevice_new(&phone, uuid); + if (udid[0] != 0) { + ret = idevice_new(&phone, udid); if (ret != IDEVICE_E_SUCCESS) { - printf("No device found with uuid %s, is it plugged in?\n", uuid); + printf("No device found with udid %s, is it plugged in?\n", udid); return -1; } } 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() /* gather data from lockdown */ plist_t value_node = NULL; plist_t root_node = NULL; - char *uuid = NULL; - char *uuid_uppercase = NULL; + char *udid = NULL; + char *udid_uppercase = NULL; plist_t ret = plist_new_dict(); @@ -299,16 +299,16 @@ static plist_t mobilebackup_factory_info_plist_new() /* FIXME Sync Settings? */ value_node = plist_dict_get_item(root_node, "UniqueDeviceID"); - idevice_get_uuid(phone, &uuid); - plist_dict_insert_item(ret, "Target Identifier", plist_new_string(uuid)); + idevice_get_udid(phone, &udid); + plist_dict_insert_item(ret, "Target Identifier", plist_new_string(udid)); plist_dict_insert_item(ret, "Target Type", plist_new_string("Device")); /* uppercase */ - uuid_uppercase = str_toupper(uuid); - plist_dict_insert_item(ret, "Unique Identifier", plist_new_string(uuid_uppercase)); - free(uuid_uppercase); - free(uuid); + udid_uppercase = str_toupper(udid); + plist_dict_insert_item(ret, "Unique Identifier", plist_new_string(udid_uppercase)); + free(udid_uppercase); + free(udid); char *data_buf = NULL; uint64_t data_size = 0; @@ -446,11 +446,11 @@ static int plist_write_to_filename(plist_t plist, const char *filename, enum pli return 1; } -static int mb2_status_check_snapshot_state(const char *path, const char *uuid, const char *matches) +static int mb2_status_check_snapshot_state(const char *path, const char *udid, const char *matches) { int ret = -1; plist_t status_plist = NULL; - char *file_path = build_path(path, uuid, "Status.plist", NULL); + char *file_path = build_path(path, udid, "Status.plist", NULL); plist_read_from_filename(&status_plist, file_path); free(file_path); @@ -488,7 +488,7 @@ static int mobilebackup_info_is_current_device(plist_t info) /* get basic device information in one go */ lockdownd_get_value(client, NULL, NULL, &root_node); - /* verify UUID */ + /* verify UDID */ value_node = plist_dict_get_item(root_node, "UniqueDeviceID"); node = plist_dict_get_item(info, "Target Identifier"); @@ -1171,7 +1171,7 @@ static void print_usage(int argc, char **argv) printf(" unback\tunpack a completed backup in DIRECTORY/_unback_/\n\n"); printf("options:\n"); printf(" -d, --debug\t\tenable communication debugging\n"); - printf(" -u, --uuid UUID\ttarget specific device by its 40-digit device UUID\n"); + printf(" -u, --udid UDID\ttarget specific device by its 40-digit device UDID\n"); printf(" -h, --help\t\tprints usage information\n"); printf("\n"); } @@ -1180,9 +1180,9 @@ int main(int argc, char *argv[]) { idevice_error_t ret = IDEVICE_E_UNKNOWN_ERROR; int i; - char uuid[41]; + char udid[41]; uint16_t port = 0; - uuid[0] = 0; + udid[0] = 0; int cmd = -1; int cmd_flags = 0; int is_full_backup = 0; @@ -1207,13 +1207,13 @@ int main(int argc, char *argv[]) idevice_set_debug_level(1); continue; } - else if (!strcmp(argv[i], "-u") || !strcmp(argv[i], "--uuid")) { + else if (!strcmp(argv[i], "-u") || !strcmp(argv[i], "--udid")) { i++; if (!argv[i] || (strlen(argv[i]) != 40)) { print_usage(argc, argv); return 0; } - strcpy(uuid, argv[i]); + strcpy(udid, argv[i]); continue; } else if (!strcmp(argv[i], "-h") || !strcmp(argv[i], "--help")) { @@ -1277,10 +1277,10 @@ int main(int argc, char *argv[]) return -1; } - if (uuid[0] != 0) { - ret = idevice_new(&phone, uuid); + if (udid[0] != 0) { + ret = idevice_new(&phone, udid); if (ret != IDEVICE_E_SUCCESS) { - printf("No device found with uuid %s, is it plugged in?\n", uuid); + printf("No device found with udid %s, is it plugged in?\n", udid); return -1; } } @@ -1291,18 +1291,18 @@ int main(int argc, char *argv[]) printf("No device found, is it plugged in?\n"); return -1; } - char *newuuid = NULL; - idevice_get_uuid(phone, &newuuid); - strcpy(uuid, newuuid); - free(newuuid); + char *newudid = NULL; + idevice_get_udid(phone, &newudid); + strcpy(udid, newudid); + free(newudid); } /* backup directory must contain an Info.plist */ - char *info_path = build_path(backup_directory, uuid, "Info.plist", NULL); + char *info_path = build_path(backup_directory, udid, "Info.plist", NULL); if (cmd == CMD_RESTORE) { if (stat(info_path, &st) != 0) { free(info_path); - printf("ERROR: Backup directory \"%s\" is invalid. No Info.plist found for UUID %s.\n", backup_directory, uuid); + printf("ERROR: Backup directory \"%s\" is invalid. No Info.plist found for UDID %s.\n", backup_directory, udid); return -1; } } @@ -1430,7 +1430,7 @@ checkpoint: PRINT_VERBOSE(1, "Starting backup...\n"); /* make sure backup device sub-directory exists */ - char *devbackupdir = build_path(backup_directory, uuid, NULL); + char *devbackupdir = build_path(backup_directory, udid, NULL); __mkdir(devbackupdir, 0755); free(devbackupdir); @@ -1453,7 +1453,7 @@ checkpoint: /* request backup from device with manifest from last backup */ PRINT_VERBOSE(1, "Requesting backup from device...\n"); - err = mobilebackup2_send_request(mobilebackup2, "Backup", uuid, NULL, NULL); + err = mobilebackup2_send_request(mobilebackup2, "Backup", udid, NULL, NULL); if (err == MOBILEBACKUP2_E_SUCCESS) { if (is_full_backup) { PRINT_VERBOSE(1, "Full backup mode.\n"); @@ -1475,7 +1475,7 @@ checkpoint: /* TODO: verify battery on AC enough battery remaining */ /* verify if Status.plist says we read from an successful backup */ - if (!mb2_status_check_snapshot_state(backup_directory, uuid, "finished")) { + if (!mb2_status_check_snapshot_state(backup_directory, udid, "finished")) { printf("ERROR: Cannot ensure we restore from a successful backup. Aborting.\n"); cmd = CMD_LEAVE; break; @@ -1495,7 +1495,7 @@ checkpoint: plist_dict_insert_item(opts, "RestorePreserveSettings", plist_new_bool((cmd_flags & CMD_FLAG_RESTORE_SETTINGS) == 0)); PRINT_VERBOSE(1, "Preserve settings of device: %s\n", ((cmd_flags & CMD_FLAG_RESTORE_SETTINGS) == 0 ? "Yes":"No")); - err = mobilebackup2_send_request(mobilebackup2, "Restore", uuid, uuid, opts); + err = mobilebackup2_send_request(mobilebackup2, "Restore", udid, udid, opts); plist_free(opts); if (err != MOBILEBACKUP2_E_SUCCESS) { if (err == MOBILEBACKUP2_E_BAD_VERSION) { @@ -1510,7 +1510,7 @@ checkpoint: break; case CMD_INFO: PRINT_VERBOSE(1, "Requesting backup info from device...\n"); - err = mobilebackup2_send_request(mobilebackup2, "Info", uuid, NULL, NULL); + err = mobilebackup2_send_request(mobilebackup2, "Info", udid, NULL, NULL); if (err != MOBILEBACKUP2_E_SUCCESS) { printf("Error requesting backup info from device, error code %d\n", err); cmd = CMD_LEAVE; @@ -1518,7 +1518,7 @@ checkpoint: break; case CMD_LIST: PRINT_VERBOSE(1, "Requesting backup list from device...\n"); - err = mobilebackup2_send_request(mobilebackup2, "List", uuid, NULL, NULL); + err = mobilebackup2_send_request(mobilebackup2, "List", udid, NULL, NULL); if (err != MOBILEBACKUP2_E_SUCCESS) { printf("Error requesting backup list from device, error code %d\n", err); cmd = CMD_LEAVE; @@ -1526,7 +1526,7 @@ checkpoint: break; case CMD_UNBACK: PRINT_VERBOSE(1, "Starting to unpack backup...\n"); - err = mobilebackup2_send_request(mobilebackup2, "Unback", uuid, NULL, NULL); + err = mobilebackup2_send_request(mobilebackup2, "Unback", udid, NULL, NULL); if (err != MOBILEBACKUP2_E_SUCCESS) { printf("Error requesting unback operation from device, error code %d\n", err); cmd = CMD_LEAVE; @@ -1765,7 +1765,7 @@ files_out: switch (cmd) { case CMD_BACKUP: PRINT_VERBOSE(1, "Received %d files from device.\n", file_count); - if (mb2_status_check_snapshot_state(backup_directory, uuid, "finished")) { + if (mb2_status_check_snapshot_state(backup_directory, udid, "finished")) { PRINT_VERBOSE(1, "Backup Successful.\n"); } else { 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) printf("Usage: %s [OPTIONS]\n", (name ? name + 1: argv[0])); printf("Display the current date or set it on an iDevice.\n\n"); printf(" -d, --debug\t\tenable communication debugging\n"); - printf(" -u, --uuid UUID\ttarget specific device by its 40-digit device UUID\n"); + printf(" -u, --udid UDID\ttarget specific device by its 40-digit device UDID\n"); printf(" -s, --set TIMESTAMP\tset UTC time described by TIMESTAMP\n"); printf(" -c, --sync\t\tset time of device to current system time\n"); printf(" -h, --help\t\tprints usage information\n"); @@ -57,10 +57,10 @@ int main(int argc, char *argv[]) idevice_t phone = NULL; idevice_error_t ret = IDEVICE_E_UNKNOWN_ERROR; int i; - char uuid[41]; + char udid[41]; time_t setdate = 0; plist_t node = NULL; - uuid[0] = 0; + udid[0] = 0; uint64_t datetime = 0; time_t rawtime; struct tm * tmp; @@ -73,13 +73,13 @@ int main(int argc, char *argv[]) idevice_set_debug_level(1); continue; } - else if (!strcmp(argv[i], "-u") || !strcmp(argv[i], "--uuid")) { + else if (!strcmp(argv[i], "-u") || !strcmp(argv[i], "--udid")) { i++; if (!argv[i] || (strlen(argv[i]) != 40)) { print_usage(argc, argv); return 0; } - strcpy(uuid, argv[i]); + strcpy(udid, argv[i]); continue; } else if (!strcmp(argv[i], "-s") || !strcmp(argv[i], "--set")) { @@ -124,10 +124,10 @@ int main(int argc, char *argv[]) } } - if (uuid[0] != 0) { - ret = idevice_new(&phone, uuid); + if (udid[0] != 0) { + ret = idevice_new(&phone, udid); if (ret != IDEVICE_E_SUCCESS) { - printf("No device found with uuid %s, is it plugged in?\n", uuid); + printf("No device found with udid %s, is it plugged in?\n", udid); return -1; } } 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) char *name = NULL; name = strrchr(argv[0], '/'); - printf("Usage: %s [OPTIONS] UUID\n", (name ? name + 1: argv[0])); - printf("Makes a device with the supplied 40-digit UUID enter recovery mode immediately.\n\n"); + printf("Usage: %s [OPTIONS] UDID\n", (name ? name + 1: argv[0])); + printf("Makes a device with the supplied 40-digit UDID enter recovery mode immediately.\n\n"); printf(" -d, --debug\t\tenable communication debugging\n"); printf(" -h, --help\t\tprints usage information\n"); printf("\n"); @@ -45,8 +45,8 @@ int main(int argc, char *argv[]) idevice_t phone = NULL; idevice_error_t ret = IDEVICE_E_UNKNOWN_ERROR; int i; - char uuid[41]; - uuid[0] = 0; + char udid[41]; + udid[0] = 0; /* parse cmdline args */ for (i = 1; i < argc; i++) { @@ -65,11 +65,11 @@ int main(int argc, char *argv[]) print_usage(argc, argv); return 0; } - strcpy(uuid, argv[i]); + strcpy(udid, argv[i]); - ret = idevice_new(&phone, uuid); + ret = idevice_new(&phone, udid); if (ret != IDEVICE_E_SUCCESS) { - printf("No device found with uuid %s, is it plugged in?\n", uuid); + printf("No device found with udid %s, is it plugged in?\n", udid); return -1; } @@ -79,7 +79,7 @@ int main(int argc, char *argv[]) } /* run query and output information */ - printf("Telling device with uuid %s to enter recovery mode.\n", uuid); + printf("Telling device with udid %s to enter recovery mode.\n", udid); if(lockdownd_enter_recovery(client) != LOCKDOWN_E_SUCCESS) { 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; static int list_mode = 0; static int xml_mode = 0; -static char *uuid = NULL; +static char *udid = NULL; static char *imagetype = NULL; static const char PKG_PATH[] = "PublicStaging"; @@ -56,7 +56,7 @@ static void print_usage(int argc, char **argv) name = strrchr(argv[0], '/'); printf("Usage: %s [OPTIONS] IMAGE_FILE IMAGE_SIGNATURE_FILE\n\n", (name ? name + 1: argv[0])); printf("Mounts the specified disk image on the device.\n\n"); - printf(" -u, --uuid UUID\ttarget specific device by its 40-digit device UUID\n"); + printf(" -u, --udid UDID\ttarget specific device by its 40-digit device UDID\n"); printf(" -l, --list\t\tList mount information\n"); printf(" -t, --imagetype\tImage type to use, default is 'Developer'\n"); printf(" -x, --xml\t\tUse XML output\n"); @@ -69,7 +69,7 @@ static void parse_opts(int argc, char **argv) { static struct option longopts[] = { {"help", 0, NULL, 'h'}, - {"uuid", 0, NULL, 'u'}, + {"udid", 0, NULL, 'u'}, {"list", 0, NULL, 'l'}, {"imagetype", 0, NULL, 't'}, {"xml", 0, NULL, 'x'}, @@ -91,12 +91,12 @@ static void parse_opts(int argc, char **argv) exit(0); case 'u': if (strlen(optarg) != 40) { - printf("%s: invalid UUID specified (length != 40)\n", + printf("%s: invalid UDID specified (length != 40)\n", argv[0]); print_usage(argc, argv); exit(2); } - uuid = strdup(optarg); + udid = strdup(optarg); break; case 'l': list_mode = 1; @@ -295,7 +295,7 @@ int main(int argc, char **argv) } } - if (IDEVICE_E_SUCCESS != idevice_new(&device, uuid)) { + if (IDEVICE_E_SUCCESS != idevice_new(&device, udid)) { printf("No device found, is it plugged in?\n"); return -1; } 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) printf("Show information about a connected iPhone/iPod Touch.\n\n"); printf(" -d, --debug\t\tenable communication debugging\n"); printf(" -s, --simple\t\tuse a simple connection to avoid auto-pairing with the device\n"); - printf(" -u, --uuid UUID\ttarget specific device by its 40-digit device UUID\n"); + printf(" -u, --udid UDID\ttarget specific device by its 40-digit device UDID\n"); printf(" -q, --domain NAME\tset domain of query to NAME. Default: None\n"); printf(" -k, --key NAME\tonly query key specified by NAME. Default: All keys.\n"); 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[]) int i; int simple = 0; int format = FORMAT_KEY_VALUE; - char uuid[41]; + char udid[41]; char *domain = NULL; char *key = NULL; char *xml_doc = NULL; uint32_t xml_length; plist_t node = NULL; plist_type node_type; - uuid[0] = 0; + udid[0] = 0; /* parse cmdline args */ for (i = 1; i < argc; i++) { @@ -292,13 +292,13 @@ int main(int argc, char *argv[]) idevice_set_debug_level(1); continue; } - else if (!strcmp(argv[i], "-u") || !strcmp(argv[i], "--uuid")) { + else if (!strcmp(argv[i], "-u") || !strcmp(argv[i], "--udid")) { i++; if (!argv[i] || (strlen(argv[i]) != 40)) { print_usage(argc, argv); return 0; } - strcpy(uuid, argv[i]); + strcpy(udid, argv[i]); continue; } else if (!strcmp(argv[i], "-q") || !strcmp(argv[i], "--domain")) { @@ -340,10 +340,10 @@ int main(int argc, char *argv[]) } } - if (uuid[0] != 0) { - ret = idevice_new(&phone, uuid); + if (udid[0] != 0) { + ret = idevice_new(&phone, udid); if (ret != IDEVICE_E_SUCCESS) { - printf("No device found with uuid %s, is it plugged in?\n", uuid); + printf("No device found with udid %s, is it plugged in?\n", udid); return -1; } } 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 @@ #include <libimobiledevice/libimobiledevice.h> #include <libimobiledevice/lockdown.h> -static char *uuid = NULL; +static char *udid = NULL; static void print_usage(int argc, char **argv) { @@ -45,7 +45,7 @@ static void print_usage(int argc, char **argv) printf(" list list devices paired with this computer\n\n"); printf(" The following OPTIONS are accepted:\n"); printf(" -d, --debug enable communication debugging\n"); - printf(" -u, --uuid UUID target specific device by its 40-digit device UUID\n"); + printf(" -u, --udid UDID target specific device by its 40-digit device UDID\n"); printf(" -h, --help prints usage information\n"); printf("\n"); } @@ -54,7 +54,7 @@ static void parse_opts(int argc, char **argv) { static struct option longopts[] = { {"help", 0, NULL, 'h'}, - {"uuid", 1, NULL, 'u'}, + {"udid", 1, NULL, 'u'}, {"debug", 0, NULL, 'd'}, {NULL, 0, NULL, 0} }; @@ -72,11 +72,11 @@ static void parse_opts(int argc, char **argv) exit(EXIT_SUCCESS); case 'u': if (strlen(optarg) != 40) { - printf("%s: invalid UUID specified (length != 40)\n", argv[0]); + printf("%s: invalid UDID specified (length != 40)\n", argv[0]); print_usage(argc, argv); exit(2); } - uuid = strdup(optarg); + udid = strdup(optarg); break; case 'd': idevice_set_debug_level(1); @@ -143,26 +143,26 @@ int main(int argc, char **argv) if (op == OP_LIST) { unsigned int i; - char **uuids = NULL; + char **udids = NULL; unsigned int count = 0; - userpref_get_paired_uuids(&uuids, &count); + userpref_get_paired_udids(&udids, &count); for (i = 0; i < count; i++) { - printf("%s\n", uuids[i]); - free(uuids[i]); + printf("%s\n", udids[i]); + free(udids[i]); } - if (uuids) - free(uuids); - if (uuid) - free(uuid); + if (udids) + free(udids); + if (udid) + free(udid); return EXIT_SUCCESS; } - if (uuid) { - ret = idevice_new(&phone, uuid); - free(uuid); - uuid = NULL; + if (udid) { + ret = idevice_new(&phone, udid); + free(udid); + udid = NULL; if (ret != IDEVICE_E_SUCCESS) { - printf("No device found with uuid %s, is it plugged in?\n", uuid); + printf("No device found with udid %s, is it plugged in?\n", udid); return EXIT_FAILURE; } } else { @@ -196,9 +196,9 @@ int main(int argc, char **argv) } } - ret = idevice_get_uuid(phone, &uuid); + ret = idevice_get_udid(phone, &udid); if (ret != IDEVICE_E_SUCCESS) { - printf("ERROR: Could not get device uuid, error code %d\n", ret); + printf("ERROR: Could not get device udid, error code %d\n", ret); result = EXIT_FAILURE; goto leave; } @@ -208,13 +208,13 @@ int main(int argc, char **argv) case OP_PAIR: lerr = lockdownd_pair(client, NULL); if (lerr == LOCKDOWN_E_SUCCESS) { - printf("SUCCESS: Paired with device %s\n", uuid); + printf("SUCCESS: Paired with device %s\n", udid); } else { result = EXIT_FAILURE; if (lerr == LOCKDOWN_E_PASSWORD_PROTECTED) { printf("ERROR: Could not pair with the device because a passcode is set. Please enter the passcode on the device and retry.\n"); } else { - printf("ERROR: Pairing with device %s failed with unhandled error code %d\n", uuid, lerr); + printf("ERROR: Pairing with device %s failed with unhandled error code %d\n", udid, lerr); } } break; @@ -222,13 +222,13 @@ int main(int argc, char **argv) case OP_VALIDATE: lerr = lockdownd_validate_pair(client, NULL); if (lerr == LOCKDOWN_E_SUCCESS) { - printf("SUCCESS: Validated pairing with device %s\n", uuid); + printf("SUCCESS: Validated pairing with device %s\n", udid); } else { result = EXIT_FAILURE; if (lerr == LOCKDOWN_E_PASSWORD_PROTECTED) { printf("ERROR: Could not validate with the device because a passcode is set. Please enter the passcode on the device and retry.\n"); } else if (lerr == LOCKDOWN_E_INVALID_HOST_ID) { - printf("ERROR: Device %s is not paired with this host\n", uuid); + printf("ERROR: Device %s is not paired with this host\n", udid); } else { printf("ERROR: Pairing failed with unhandled error code %d\n", lerr); } @@ -239,14 +239,14 @@ int main(int argc, char **argv) lerr = lockdownd_unpair(client, NULL); if (lerr == LOCKDOWN_E_SUCCESS) { /* also remove local device public key */ - userpref_remove_device_public_key(uuid); - printf("SUCCESS: Unpaired with device %s\n", uuid); + userpref_remove_device_public_key(udid); + printf("SUCCESS: Unpaired with device %s\n", udid); } else { result = EXIT_FAILURE; if (lerr == LOCKDOWN_E_INVALID_HOST_ID) { - printf("ERROR: Device %s is not paired with this host\n", uuid); + printf("ERROR: Device %s is not paired with this host\n", udid); } else { - printf("ERROR: Unpairing with device %s failed with unhandled error code %d\n", uuid, lerr); + printf("ERROR: Unpairing with device %s failed with unhandled error code %d\n", udid, lerr); } } break; @@ -255,8 +255,8 @@ int main(int argc, char **argv) leave: lockdownd_client_free(client); idevice_free(phone); - if (uuid) { - free(uuid); + if (udid) { + free(udid); } return result; } 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) uint16_t port = 0; int result = -1; int i; - char *uuid = NULL; + char *udid = NULL; /* parse cmdline args */ for (i = 1; i < argc; i++) { @@ -49,13 +49,13 @@ int main(int argc, char **argv) idevice_set_debug_level(1); continue; } - else if (!strcmp(argv[i], "-u") || !strcmp(argv[i], "--uuid")) { + else if (!strcmp(argv[i], "-u") || !strcmp(argv[i], "--udid")) { i++; if (!argv[i] || (strlen(argv[i]) != 40)) { print_usage(argc, argv); return 0; } - uuid = strdup(argv[i]); + udid = strdup(argv[i]); continue; } else if (!strcmp(argv[i], "-h") || !strcmp(argv[i], "--help")) { @@ -68,15 +68,15 @@ int main(int argc, char **argv) } } - if (IDEVICE_E_SUCCESS != idevice_new(&device, uuid)) { + if (IDEVICE_E_SUCCESS != idevice_new(&device, udid)) { printf("No device found, is it plugged in?\n"); - if (uuid) { - free(uuid); + if (udid) { + free(udid); } return -1; } - if (uuid) { - free(uuid); + if (udid) { + free(udid); } if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake(device, &lckd, NULL)) { @@ -133,7 +133,7 @@ void print_usage(int argc, char **argv) printf("NOTE: A mounted developer disk image is required on the device, otherwise\n"); printf("the screenshotr service is not available.\n\n"); printf(" -d, --debug\t\tenable communication debugging\n"); - printf(" -u, --uuid UUID\ttarget specific device by its 40-digit device UUID\n"); + printf(" -u, --udid UDID\ttarget specific device by its 40-digit device UDID\n"); printf(" -h, --help\t\tprints usage information\n"); printf("\n"); } 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[]) idevice_t phone = NULL; idevice_error_t ret = IDEVICE_E_UNKNOWN_ERROR; int i; - char uuid[41]; + char udid[41]; uint16_t port = 0; - uuid[0] = 0; + udid[0] = 0; signal(SIGINT, clean_exit); signal(SIGTERM, clean_exit); @@ -65,13 +65,13 @@ int main(int argc, char *argv[]) idevice_set_debug_level(1); continue; } - else if (!strcmp(argv[i], "-u") || !strcmp(argv[i], "--uuid")) { + else if (!strcmp(argv[i], "-u") || !strcmp(argv[i], "--udid")) { i++; if (!argv[i] || (strlen(argv[i]) != 40)) { print_usage(argc, argv); return 0; } - strcpy(uuid, argv[i]); + strcpy(udid, argv[i]); continue; } else if (!strcmp(argv[i], "-h") || !strcmp(argv[i], "--help")) { @@ -84,10 +84,10 @@ int main(int argc, char *argv[]) } } - if (uuid[0] != 0) { - ret = idevice_new(&phone, uuid); + if (udid[0] != 0) { + ret = idevice_new(&phone, udid); if (ret != IDEVICE_E_SUCCESS) { - printf("No device found with uuid %s, is it plugged in?\n", uuid); + printf("No device found with udid %s, is it plugged in?\n", udid); return -1; } } @@ -166,7 +166,7 @@ void print_usage(int argc, char **argv) printf("Usage: %s [OPTIONS]\n", (name ? name + 1: argv[0])); printf("Relay syslog of a connected iPhone/iPod Touch.\n\n"); printf(" -d, --debug\t\tenable communication debugging\n"); - printf(" -u, --uuid UUID\ttarget specific device by its 40-digit device UUID\n"); + printf(" -u, --udid UDID\ttarget specific device by its 40-digit device UDID\n"); printf(" -h, --help\t\tprints usage information\n"); printf("\n"); } |