summaryrefslogtreecommitdiffstats
path: root/tools/idevicedate.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/idevicedate.c')
-rw-r--r--tools/idevicedate.c16
1 files changed, 8 insertions, 8 deletions
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 }