diff options
36 files changed, 264 insertions, 263 deletions
diff --git a/cython/imobiledevice.pxd b/cython/imobiledevice.pxd index 048f226..d0d1ada 100644 --- a/cython/imobiledevice.pxd +++ b/cython/imobiledevice.pxd | |||
| @@ -28,7 +28,7 @@ cdef extern from "libimobiledevice/libimobiledevice.h": | |||
| 28 | IDEVICE_DEVICE_REMOVE | 28 | IDEVICE_DEVICE_REMOVE |
| 29 | ctypedef struct idevice_event_t: | 29 | ctypedef struct idevice_event_t: |
| 30 | idevice_event_type event | 30 | idevice_event_type event |
| 31 | char *uuid | 31 | char *udid |
| 32 | int conn_type | 32 | int conn_type |
| 33 | ctypedef idevice_event_t* const_idevice_event_t "const idevice_event_t*" | 33 | ctypedef idevice_event_t* const_idevice_event_t "const idevice_event_t*" |
| 34 | 34 | ||
diff --git a/cython/imobiledevice.pyx b/cython/imobiledevice.pyx index 654288e..ffaa3c1 100644 --- a/cython/imobiledevice.pyx +++ b/cython/imobiledevice.pyx | |||
| @@ -44,9 +44,9 @@ cdef extern from "libimobiledevice/libimobiledevice.h": | |||
| 44 | idevice_error_t idevice_get_device_list(char ***devices, int *count) | 44 | idevice_error_t idevice_get_device_list(char ***devices, int *count) |
| 45 | idevice_error_t idevice_device_list_free(char **devices) | 45 | idevice_error_t idevice_device_list_free(char **devices) |
| 46 | void idevice_set_debug_level(int level) | 46 | void idevice_set_debug_level(int level) |
| 47 | idevice_error_t idevice_new(idevice_t *device, char *uuid) | 47 | idevice_error_t idevice_new(idevice_t *device, char *udid) |
| 48 | idevice_error_t idevice_free(idevice_t device) | 48 | idevice_error_t idevice_free(idevice_t device) |
| 49 | idevice_error_t idevice_get_uuid(idevice_t device, char** uuid) | 49 | idevice_error_t idevice_get_udid(idevice_t device, char** udid) |
| 50 | idevice_error_t idevice_get_handle(idevice_t device, uint32_t *handle) | 50 | idevice_error_t idevice_get_handle(idevice_t device, uint32_t *handle) |
| 51 | idevice_error_t idevice_connect(idevice_t device, uint16_t port, idevice_connection_t *connection) | 51 | idevice_error_t idevice_connect(idevice_t device, uint16_t port, idevice_connection_t *connection) |
| 52 | idevice_error_t idevice_disconnect(idevice_connection_t connection) | 52 | idevice_error_t idevice_disconnect(idevice_connection_t connection) |
| @@ -75,14 +75,14 @@ cdef class iDeviceEvent: | |||
| 75 | raise TypeError("iDeviceEvent cannot be instantiated") | 75 | raise TypeError("iDeviceEvent cannot be instantiated") |
| 76 | 76 | ||
| 77 | def __str__(self): | 77 | def __str__(self): |
| 78 | return 'iDeviceEvent: %s (%s)' % (self.event == IDEVICE_DEVICE_ADD and 'Add' or 'Remove', self.uuid) | 78 | return 'iDeviceEvent: %s (%s)' % (self.event == IDEVICE_DEVICE_ADD and 'Add' or 'Remove', self.udid) |
| 79 | 79 | ||
| 80 | property event: | 80 | property event: |
| 81 | def __get__(self): | 81 | def __get__(self): |
| 82 | return self._c_event.event | 82 | return self._c_event.event |
| 83 | property uuid: | 83 | property udid: |
| 84 | def __get__(self): | 84 | def __get__(self): |
| 85 | return self._c_event.uuid | 85 | return self._c_event.udid |
| 86 | property conn_type: | 86 | property conn_type: |
| 87 | def __get__(self): | 87 | def __get__(self): |
| 88 | return self._c_event.conn_type | 88 | return self._c_event.conn_type |
| @@ -137,13 +137,13 @@ cdef class iDeviceConnection(Base): | |||
| 137 | from libc.stdlib cimport * | 137 | from libc.stdlib cimport * |
| 138 | 138 | ||
| 139 | cdef class iDevice(Base): | 139 | cdef class iDevice(Base): |
| 140 | def __cinit__(self, object uuid=None, *args, **kwargs): | 140 | def __cinit__(self, object udid=None, *args, **kwargs): |
| 141 | cdef char* c_uuid = NULL | 141 | cdef char* c_udid = NULL |
| 142 | if isinstance(uuid, basestring): | 142 | if isinstance(udid, basestring): |
| 143 | c_uuid = <bytes>uuid | 143 | c_udid = <bytes>udid |
| 144 | elif uuid is not None: | 144 | elif udid is not None: |
| 145 | raise TypeError("iDevice's constructor takes a string or None as the uuid argument") | 145 | raise TypeError("iDevice's constructor takes a string or None as the udid argument") |
| 146 | self.handle_error(idevice_new(&self._c_dev, c_uuid)) | 146 | self.handle_error(idevice_new(&self._c_dev, c_udid)) |
| 147 | 147 | ||
| 148 | def __dealloc__(self): | 148 | def __dealloc__(self): |
| 149 | if self._c_dev is not NULL: | 149 | if self._c_dev is not NULL: |
| @@ -169,18 +169,18 @@ cdef class iDevice(Base): | |||
| 169 | if c_conn != NULL: | 169 | if c_conn != NULL: |
| 170 | idevice_disconnect(c_conn) | 170 | idevice_disconnect(c_conn) |
| 171 | 171 | ||
| 172 | property uuid: | 172 | property udid: |
| 173 | def __get__(self): | 173 | def __get__(self): |
| 174 | cdef: | 174 | cdef: |
| 175 | char* uuid | 175 | char* udid |
| 176 | idevice_error_t err | 176 | idevice_error_t err |
| 177 | err = idevice_get_uuid(self._c_dev, &uuid) | 177 | err = idevice_get_udid(self._c_dev, &udid) |
| 178 | try: | 178 | try: |
| 179 | self.handle_error(err) | 179 | self.handle_error(err) |
| 180 | return uuid | 180 | return udid |
| 181 | except Exception, e: | 181 | except Exception, e: |
| 182 | if uuid != NULL: | 182 | if udid != NULL: |
| 183 | free(uuid) | 183 | free(udid) |
| 184 | property handle: | 184 | property handle: |
| 185 | def __get__(self): | 185 | def __get__(self): |
| 186 | cdef uint32_t handle | 186 | cdef uint32_t handle |
diff --git a/dev/housearresttest.c b/dev/housearresttest.c index 7282a8c..951ebe4 100644 --- a/dev/housearresttest.c +++ b/dev/housearresttest.c | |||
| @@ -35,7 +35,7 @@ static void print_usage(int argc, char **argv) | |||
| 35 | printf("Usage: %s [OPTIONS] APPID\n", (name ? name + 1: argv[0])); | 35 | printf("Usage: %s [OPTIONS] APPID\n", (name ? name + 1: argv[0])); |
| 36 | printf("Test the house_arrest service.\n\n"); | 36 | printf("Test the house_arrest service.\n\n"); |
| 37 | printf(" -d, --debug\t\tenable communication debugging\n"); | 37 | printf(" -d, --debug\t\tenable communication debugging\n"); |
| 38 | printf(" -u, --uuid UUID\ttarget specific device by its 40-digit device UUID\n"); | 38 | printf(" -u, --udid UDID\ttarget specific device by its 40-digit device UDID\n"); |
| 39 | printf(" -t, --test\t\ttest creating, writing, and deleting a file\n"); | 39 | printf(" -t, --test\t\ttest creating, writing, and deleting a file\n"); |
| 40 | printf(" -h, --help\t\tprints usage information\n"); | 40 | printf(" -h, --help\t\tprints usage information\n"); |
| 41 | printf("\n"); | 41 | printf("\n"); |
| @@ -48,7 +48,7 @@ int main(int argc, char **argv) | |||
| 48 | house_arrest_client_t hac = NULL; | 48 | house_arrest_client_t hac = NULL; |
| 49 | house_arrest_error_t res; | 49 | house_arrest_error_t res; |
| 50 | int i; | 50 | int i; |
| 51 | char *uuid = NULL; | 51 | char *udid = NULL; |
| 52 | const char *appid = NULL; | 52 | const char *appid = NULL; |
| 53 | int test_file_io = 0; | 53 | int test_file_io = 0; |
| 54 | 54 | ||
| @@ -58,13 +58,13 @@ int main(int argc, char **argv) | |||
| 58 | idevice_set_debug_level(1); | 58 | idevice_set_debug_level(1); |
| 59 | continue; | 59 | continue; |
| 60 | } | 60 | } |
| 61 | else if (!strcmp(argv[i], "-u") || !strcmp(argv[i], "--uuid")) { | 61 | else if (!strcmp(argv[i], "-u") || !strcmp(argv[i], "--udid")) { |
| 62 | i++; | 62 | i++; |
| 63 | if (!argv[i] || (strlen(argv[i]) != 40)) { | 63 | if (!argv[i] || (strlen(argv[i]) != 40)) { |
| 64 | print_usage(argc, argv); | 64 | print_usage(argc, argv); |
| 65 | return 0; | 65 | return 0; |
| 66 | } | 66 | } |
| 67 | uuid = strdup(argv[i]); | 67 | udid = strdup(argv[i]); |
| 68 | continue; | 68 | continue; |
| 69 | } | 69 | } |
| 70 | else if (!strcmp(argv[i], "-t") || !strcmp(argv[i], "--test")) { | 70 | else if (!strcmp(argv[i], "-t") || !strcmp(argv[i], "--test")) { |
| @@ -86,7 +86,7 @@ int main(int argc, char **argv) | |||
| 86 | return 0; | 86 | return 0; |
| 87 | } | 87 | } |
| 88 | 88 | ||
| 89 | if (idevice_new(&dev, uuid) != IDEVICE_E_SUCCESS) { | 89 | if (idevice_new(&dev, udid) != IDEVICE_E_SUCCESS) { |
| 90 | printf("no device connected?!\n"); | 90 | printf("no device connected?!\n"); |
| 91 | goto leave_cleanup; | 91 | goto leave_cleanup; |
| 92 | } | 92 | } |
diff --git a/dev/ideviceclient.c b/dev/ideviceclient.c index c7bde4d..d467ee8 100644 --- a/dev/ideviceclient.c +++ b/dev/ideviceclient.c | |||
| @@ -83,12 +83,12 @@ int main(int argc, char *argv[]) | |||
| 83 | return -1; | 83 | return -1; |
| 84 | } | 84 | } |
| 85 | 85 | ||
| 86 | char *uuid = NULL; | 86 | char *udid = NULL; |
| 87 | if (IDEVICE_E_SUCCESS == idevice_get_uuid(phone, &uuid)) { | 87 | if (IDEVICE_E_SUCCESS == idevice_get_udid(phone, &udid)) { |
| 88 | printf("DeviceUniqueID : %s\n", uuid); | 88 | printf("DeviceUniqueID : %s\n", udid); |
| 89 | } | 89 | } |
| 90 | if (uuid) | 90 | if (udid) |
| 91 | free(uuid); | 91 | free(udid); |
| 92 | 92 | ||
| 93 | if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake(phone, &client, "ideviceclient")) { | 93 | if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake(phone, &client, "ideviceclient")) { |
| 94 | idevice_free(phone); | 94 | idevice_free(phone); |
diff --git a/dev/lckdclient.c b/dev/lckdclient.c index 5ca72f8..cc89634 100644 --- a/dev/lckdclient.c +++ b/dev/lckdclient.c | |||
| @@ -88,12 +88,12 @@ int main(int argc, char *argv[]) | |||
| 88 | return -1; | 88 | return -1; |
| 89 | } | 89 | } |
| 90 | 90 | ||
| 91 | char *uuid = NULL; | 91 | char *udid = NULL; |
| 92 | if (IDEVICE_E_SUCCESS == idevice_get_uuid(phone, &uuid)) { | 92 | if (IDEVICE_E_SUCCESS == idevice_get_udid(phone, &udid)) { |
| 93 | printf("DeviceUniqueID : %s\n", uuid); | 93 | printf("DeviceUniqueID : %s\n", udid); |
| 94 | } | 94 | } |
| 95 | if (uuid) | 95 | if (udid) |
| 96 | free(uuid); | 96 | free(udid); |
| 97 | 97 | ||
| 98 | if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake(phone, &client, "lckdclient")) { | 98 | if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake(phone, &client, "lckdclient")) { |
| 99 | idevice_free(phone); | 99 | idevice_free(phone); |
diff --git a/docs/idevice_id.1 b/docs/idevice_id.1 index c06fb5e..02d830d 100644 --- a/docs/idevice_id.1 +++ b/docs/idevice_id.1 | |||
| @@ -3,18 +3,18 @@ | |||
| 3 | idevice_id \- Prints device name or a list of attached iPhone/iPod Touch devices. | 3 | idevice_id \- Prints device name or a list of attached iPhone/iPod Touch devices. |
| 4 | .SH SYNOPSIS | 4 | .SH SYNOPSIS |
| 5 | .B idevice_id | 5 | .B idevice_id |
| 6 | [OPTIONS] [UUID] | 6 | [OPTIONS] [UDID] |
| 7 | 7 | ||
| 8 | .SH DESCRIPTION | 8 | .SH DESCRIPTION |
| 9 | 9 | ||
| 10 | Prints device name or a list of attached iPhone/iPod Touch devices. | 10 | Prints device name or a list of attached iPhone/iPod Touch devices. |
| 11 | The UUID is a 40-digit hexadecimal number of the device | 11 | The UDID is a 40-digit hexadecimal number of the device |
| 12 | for which the name should be retrieved. | 12 | for which the name should be retrieved. |
| 13 | 13 | ||
| 14 | .SH OPTIONS | 14 | .SH OPTIONS |
| 15 | .TP | 15 | .TP |
| 16 | .B \-l, \-\-list | 16 | .B \-l, \-\-list |
| 17 | list UUID of all attached devices | 17 | list UDID of all attached devices |
| 18 | .TP | 18 | .TP |
| 19 | .B \-d, \-\-debug | 19 | .B \-d, \-\-debug |
| 20 | enable communication debugging. | 20 | enable communication debugging. |
diff --git a/docs/idevicebackup.1 b/docs/idevicebackup.1 index 5ae867e..5ce9568 100644 --- a/docs/idevicebackup.1 +++ b/docs/idevicebackup.1 | |||
| @@ -11,8 +11,8 @@ Create or restore backup from the current or specified directory. | |||
| 11 | 11 | ||
| 12 | .SH OPTIONS | 12 | .SH OPTIONS |
| 13 | .TP | 13 | .TP |
| 14 | .B \-u, \-\-uuid UUID | 14 | .B \-u, \-\-udid UDID |
| 15 | target specific device by its 40-digit device UUID. | 15 | target specific device by its 40-digit device UDID. |
| 16 | .TP | 16 | .TP |
| 17 | .B \-d, \-\-debug | 17 | .B \-d, \-\-debug |
| 18 | enable communication debugging. | 18 | enable communication debugging. |
diff --git a/docs/idevicebackup2.1 b/docs/idevicebackup2.1 index a638b8f..e4f97f8 100644 --- a/docs/idevicebackup2.1 +++ b/docs/idevicebackup2.1 | |||
| @@ -11,8 +11,8 @@ Create or restore backup from the current or specified directory. | |||
| 11 | 11 | ||
| 12 | .SH OPTIONS | 12 | .SH OPTIONS |
| 13 | .TP | 13 | .TP |
| 14 | .B \-u, \-\-uuid UUID | 14 | .B \-u, \-\-udid UDID |
| 15 | target specific device by its 40-digit device UUID. | 15 | target specific device by its 40-digit device UDID. |
| 16 | .TP | 16 | .TP |
| 17 | .B \-d, \-\-debug | 17 | .B \-d, \-\-debug |
| 18 | enable communication debugging. | 18 | enable communication debugging. |
diff --git a/docs/idevicedate.1 b/docs/idevicedate.1 index 15c9895..5a3156e 100644 --- a/docs/idevicedate.1 +++ b/docs/idevicedate.1 | |||
| @@ -14,8 +14,8 @@ Show information about the first connected iPhone/iPod Touch. | |||
| 14 | .B \-d, \-\-debug | 14 | .B \-d, \-\-debug |
| 15 | enable communication debugging. | 15 | enable communication debugging. |
| 16 | .TP | 16 | .TP |
| 17 | .B \-u, \-\-uuid UUID | 17 | .B \-u, \-\-udid UDID |
| 18 | target specific device by its 40-digit device UUID. | 18 | target specific device by its 40-digit device UDID. |
| 19 | .TP | 19 | .TP |
| 20 | .B \-s, \-\-set TIMESTAMP | 20 | .B \-s, \-\-set TIMESTAMP |
| 21 | set UTC time described by TIMESTAMP | 21 | set UTC time described by TIMESTAMP |
diff --git a/docs/ideviceenterrecovery.1 b/docs/ideviceenterrecovery.1 index a543092..79de05c 100644 --- a/docs/ideviceenterrecovery.1 +++ b/docs/ideviceenterrecovery.1 | |||
| @@ -1,13 +1,13 @@ | |||
| 1 | .TH "ideviceenterrecovery" 1 | 1 | .TH "ideviceenterrecovery" 1 |
| 2 | .SH NAME | 2 | .SH NAME |
| 3 | ideviceenterrecovery \- Makes a device with the supplied 40-digit UUID enter recovery mode immediately. | 3 | ideviceenterrecovery \- Makes a device with the supplied 40-digit UDID enter recovery mode immediately. |
| 4 | .SH SYNOPSIS | 4 | .SH SYNOPSIS |
| 5 | .B ideviceenterrecovery | 5 | .B ideviceenterrecovery |
| 6 | [OPTIONS] UUID | 6 | [OPTIONS] UDID |
| 7 | 7 | ||
| 8 | .SH DESCRIPTION | 8 | .SH DESCRIPTION |
| 9 | 9 | ||
| 10 | Makes a device with the supplied 40-digit UUID enter recovery mode immediately. | 10 | Makes a device with the supplied 40-digit UDID enter recovery mode immediately. |
| 11 | 11 | ||
| 12 | .SH OPTIONS | 12 | .SH OPTIONS |
| 13 | .TP | 13 | .TP |
diff --git a/docs/ideviceimagemounter.1 b/docs/ideviceimagemounter.1 index 55d81e9..ab65b6f 100644 --- a/docs/ideviceimagemounter.1 +++ b/docs/ideviceimagemounter.1 | |||
| @@ -14,8 +14,8 @@ Mounts the specified disk image on the iPhone/iPod Touch device. | |||
| 14 | .B \-d, \-\-debug | 14 | .B \-d, \-\-debug |
| 15 | enable communication debugging. | 15 | enable communication debugging. |
| 16 | .TP | 16 | .TP |
| 17 | .B \-u, \-\-uuid UUID | 17 | .B \-u, \-\-udid UDID |
| 18 | target specific device by its 40-digit device UUID. | 18 | target specific device by its 40-digit device UDID. |
| 19 | .TP | 19 | .TP |
| 20 | .B \-l, \-\-list | 20 | .B \-l, \-\-list |
| 21 | list mount information | 21 | list mount information |
diff --git a/docs/ideviceinfo.1 b/docs/ideviceinfo.1 index e350dd0..adfa00f 100644 --- a/docs/ideviceinfo.1 +++ b/docs/ideviceinfo.1 | |||
| @@ -14,8 +14,8 @@ Show information about the first connected iPhone/iPod Touch. | |||
| 14 | .B \-d, \-\-debug | 14 | .B \-d, \-\-debug |
| 15 | enable communication debugging. | 15 | enable communication debugging. |
| 16 | .TP | 16 | .TP |
| 17 | .B \-u, \-\-uuid UUID | 17 | .B \-u, \-\-udid UDID |
| 18 | target specific device by its 40-digit device UUID. | 18 | target specific device by its 40-digit device UDID. |
| 19 | .TP | 19 | .TP |
| 20 | .B \-q, \-\-domain NAME | 20 | .B \-q, \-\-domain NAME |
| 21 | set domain of query to NAME. Default: None. | 21 | set domain of query to NAME. Default: None. |
diff --git a/docs/idevicepair.1 b/docs/idevicepair.1 index da76b7f..3e6ca1d 100644 --- a/docs/idevicepair.1 +++ b/docs/idevicepair.1 | |||
| @@ -11,8 +11,8 @@ Manage pairings with iPhone/iPod Touch/iPad devices and this host. | |||
| 11 | 11 | ||
| 12 | .SH OPTIONS | 12 | .SH OPTIONS |
| 13 | .TP | 13 | .TP |
| 14 | .B \-u, \-\-uuid UUID | 14 | .B \-u, \-\-udid UDID |
| 15 | target specific device by its 40-digit device UUID. | 15 | target specific device by its 40-digit device UDID. |
| 16 | .TP | 16 | .TP |
| 17 | .B \-d, \-\-debug | 17 | .B \-d, \-\-debug |
| 18 | enable communication debugging. | 18 | enable communication debugging. |
diff --git a/docs/idevicescreenshot.1 b/docs/idevicescreenshot.1 index cf0ed15..73d2c09 100644 --- a/docs/idevicescreenshot.1 +++ b/docs/idevicescreenshot.1 | |||
| @@ -17,8 +17,8 @@ NOTE: A mounted developer disk image is required on the device, otherwise | |||
| 17 | .B \-d, \-\-debug | 17 | .B \-d, \-\-debug |
| 18 | enable communication debugging. | 18 | enable communication debugging. |
| 19 | .TP | 19 | .TP |
| 20 | .B \-u, \-\-uuid UUID | 20 | .B \-u, \-\-udid UDID |
| 21 | target specific device by its 40-digit device UUID. | 21 | target specific device by its 40-digit device UDID. |
| 22 | .TP | 22 | .TP |
| 23 | .B \-h, \-\-help | 23 | .B \-h, \-\-help |
| 24 | prints usage information | 24 | prints usage information |
diff --git a/docs/idevicesyslog.1 b/docs/idevicesyslog.1 index 178d7c5..e53587b 100644 --- a/docs/idevicesyslog.1 +++ b/docs/idevicesyslog.1 | |||
| @@ -14,8 +14,8 @@ Relay syslog of a connected iPhone/iPod Touch. | |||
| 14 | .B \-d, \-\-debug | 14 | .B \-d, \-\-debug |
| 15 | enable communication debugging. | 15 | enable communication debugging. |
| 16 | .TP | 16 | .TP |
| 17 | .B \-u, \-\-uuid UUID | 17 | .B \-u, \-\-udid UDID |
| 18 | target specific device by its 40-digit device UUID | 18 | target specific device by its 40-digit device UDID |
| 19 | .TP | 19 | .TP |
| 20 | .B \-h, \-\-help | 20 | .B \-h, \-\-help |
| 21 | prints usage information. | 21 | prints usage information. |
diff --git a/include/libimobiledevice/libimobiledevice.h b/include/libimobiledevice/libimobiledevice.h index d0923d6..f7b747a 100644 --- a/include/libimobiledevice/libimobiledevice.h +++ b/include/libimobiledevice/libimobiledevice.h | |||
| @@ -66,7 +66,7 @@ enum idevice_event_type { | |||
| 66 | /** Provides information about the occured event. */ | 66 | /** Provides information about the occured event. */ |
| 67 | typedef struct { | 67 | typedef struct { |
| 68 | enum idevice_event_type event; /**< The event type. */ | 68 | enum idevice_event_type event; /**< The event type. */ |
| 69 | const char *uuid; /**< The device unique id. */ | 69 | const char *udid; /**< The device unique id. */ |
| 70 | int conn_type; /**< The connection type. Currently only 1 for usbmuxd. */ | 70 | int conn_type; /**< The connection type. Currently only 1 for usbmuxd. */ |
| 71 | } idevice_event_t; | 71 | } idevice_event_t; |
| 72 | 72 | ||
| @@ -83,7 +83,7 @@ idevice_error_t idevice_get_device_list(char ***devices, int *count); | |||
| 83 | idevice_error_t idevice_device_list_free(char **devices); | 83 | idevice_error_t idevice_device_list_free(char **devices); |
| 84 | 84 | ||
| 85 | /* device structure creation and destruction */ | 85 | /* device structure creation and destruction */ |
| 86 | idevice_error_t idevice_new(idevice_t *device, const char *uuid); | 86 | idevice_error_t idevice_new(idevice_t *device, const char *udid); |
| 87 | idevice_error_t idevice_free(idevice_t device); | 87 | idevice_error_t idevice_free(idevice_t device); |
| 88 | 88 | ||
| 89 | /* connection/disconnection */ | 89 | /* connection/disconnection */ |
| @@ -97,7 +97,7 @@ idevice_error_t idevice_connection_receive(idevice_connection_t connection, char | |||
| 97 | 97 | ||
| 98 | /* misc */ | 98 | /* misc */ |
| 99 | idevice_error_t idevice_get_handle(idevice_t device, uint32_t *handle); | 99 | idevice_error_t idevice_get_handle(idevice_t device, uint32_t *handle); |
| 100 | idevice_error_t idevice_get_uuid(idevice_t device, char **uuid); | 100 | idevice_error_t idevice_get_udid(idevice_t device, char **udid); |
| 101 | 101 | ||
| 102 | #ifdef __cplusplus | 102 | #ifdef __cplusplus |
| 103 | } | 103 | } |
diff --git a/include/libimobiledevice/lockdown.h b/include/libimobiledevice/lockdown.h index 97df6b0..4e7a4e8 100644 --- a/include/libimobiledevice/lockdown.h +++ b/include/libimobiledevice/lockdown.h | |||
| @@ -94,7 +94,7 @@ lockdownd_error_t lockdownd_goodbye(lockdownd_client_t client); | |||
| 94 | 94 | ||
| 95 | /* Helper */ | 95 | /* Helper */ |
| 96 | void lockdownd_client_set_label(lockdownd_client_t client, const char *label); | 96 | void lockdownd_client_set_label(lockdownd_client_t client, const char *label); |
| 97 | lockdownd_error_t lockdownd_get_device_uuid(lockdownd_client_t control, char **uuid); | 97 | lockdownd_error_t lockdownd_get_device_udid(lockdownd_client_t control, char **udid); |
| 98 | lockdownd_error_t lockdownd_get_device_name(lockdownd_client_t client, char **device_name); | 98 | lockdownd_error_t lockdownd_get_device_name(lockdownd_client_t client, char **device_name); |
| 99 | lockdownd_error_t lockdownd_get_sync_data_classes(lockdownd_client_t client, char ***classes, int *count); | 99 | lockdownd_error_t lockdownd_get_sync_data_classes(lockdownd_client_t client, char ***classes, int *count); |
| 100 | lockdownd_error_t lockdownd_data_classes_free(char **classes); | 100 | lockdownd_error_t lockdownd_data_classes_free(char **classes); |
diff --git a/src/idevice.c b/src/idevice.c index d2769de..a6091f2 100644 --- a/src/idevice.c +++ b/src/idevice.c | |||
| @@ -49,7 +49,7 @@ static void usbmux_event_cb(const usbmuxd_event_t *event, void *user_data) | |||
| 49 | idevice_event_t ev; | 49 | idevice_event_t ev; |
| 50 | 50 | ||
| 51 | ev.event = event->event; | 51 | ev.event = event->event; |
| 52 | ev.uuid = event->device.uuid; | 52 | ev.udid = event->device.uuid; |
| 53 | ev.conn_type = CONNECTION_USBMUXD; | 53 | ev.conn_type = CONNECTION_USBMUXD; |
| 54 | 54 | ||
| 55 | if (event_cb) { | 55 | if (event_cb) { |
| @@ -99,7 +99,7 @@ idevice_error_t idevice_event_unsubscribe() | |||
| 99 | /** | 99 | /** |
| 100 | * Get a list of currently available devices. | 100 | * Get a list of currently available devices. |
| 101 | * | 101 | * |
| 102 | * @param devices List of uuids of devices that are currently available. | 102 | * @param devices List of udids of devices that are currently available. |
| 103 | * This list is terminated by a NULL pointer. | 103 | * This list is terminated by a NULL pointer. |
| 104 | * @param count Number of devices found. | 104 | * @param count Number of devices found. |
| 105 | * | 105 | * |
| @@ -136,9 +136,9 @@ idevice_error_t idevice_get_device_list(char ***devices, int *count) | |||
| 136 | } | 136 | } |
| 137 | 137 | ||
| 138 | /** | 138 | /** |
| 139 | * Free a list of device uuids. | 139 | * Free a list of device udids. |
| 140 | * | 140 | * |
| 141 | * @param devices List of uuids to free. | 141 | * @param devices List of udids to free. |
| 142 | * | 142 | * |
| 143 | * @return Always returnes IDEVICE_E_SUCCESS. | 143 | * @return Always returnes IDEVICE_E_SUCCESS. |
| 144 | */ | 144 | */ |
| @@ -156,7 +156,7 @@ idevice_error_t idevice_device_list_free(char **devices) | |||
| 156 | } | 156 | } |
| 157 | 157 | ||
| 158 | /** | 158 | /** |
| 159 | * Creates an idevice_t structure for the device specified by uuid, | 159 | * Creates an idevice_t structure for the device specified by udid, |
| 160 | * if the device is available. | 160 | * if the device is available. |
| 161 | * | 161 | * |
| 162 | * @note The resulting idevice_t structure has to be freed with | 162 | * @note The resulting idevice_t structure has to be freed with |
| @@ -164,17 +164,17 @@ idevice_error_t idevice_device_list_free(char **devices) | |||
| 164 | * | 164 | * |
| 165 | * @param device Upon calling this function, a pointer to a location of type | 165 | * @param device Upon calling this function, a pointer to a location of type |
| 166 | * idevice_t. On successful return, this location will be populated. | 166 | * idevice_t. On successful return, this location will be populated. |
| 167 | * @param uuid The UUID to match. | 167 | * @param udid The UDID to match. |
| 168 | * | 168 | * |
| 169 | * @return IDEVICE_E_SUCCESS if ok, otherwise an error code. | 169 | * @return IDEVICE_E_SUCCESS if ok, otherwise an error code. |
| 170 | */ | 170 | */ |
| 171 | idevice_error_t idevice_new(idevice_t * device, const char *uuid) | 171 | idevice_error_t idevice_new(idevice_t * device, const char *udid) |
| 172 | { | 172 | { |
| 173 | usbmuxd_device_info_t muxdev; | 173 | usbmuxd_device_info_t muxdev; |
| 174 | int res = usbmuxd_get_device_by_uuid(uuid, &muxdev); | 174 | int res = usbmuxd_get_device_by_uuid(udid, &muxdev); |
| 175 | if (res > 0) { | 175 | if (res > 0) { |
| 176 | idevice_t phone = (idevice_t) malloc(sizeof(struct idevice_private)); | 176 | idevice_t phone = (idevice_t) malloc(sizeof(struct idevice_private)); |
| 177 | phone->uuid = strdup(muxdev.uuid); | 177 | phone->udid = strdup(muxdev.uuid); |
| 178 | phone->conn_type = CONNECTION_USBMUXD; | 178 | phone->conn_type = CONNECTION_USBMUXD; |
| 179 | phone->conn_data = (void*)(long)muxdev.handle; | 179 | phone->conn_data = (void*)(long)muxdev.handle; |
| 180 | *device = phone; | 180 | *device = phone; |
| @@ -200,7 +200,7 @@ idevice_error_t idevice_free(idevice_t device) | |||
| 200 | 200 | ||
| 201 | ret = IDEVICE_E_SUCCESS; | 201 | ret = IDEVICE_E_SUCCESS; |
| 202 | 202 | ||
| 203 | free(device->uuid); | 203 | free(device->udid); |
| 204 | 204 | ||
| 205 | if (device->conn_type == CONNECTION_USBMUXD) { | 205 | if (device->conn_type == CONNECTION_USBMUXD) { |
| 206 | device->conn_data = 0; | 206 | device->conn_data = 0; |
| @@ -471,12 +471,12 @@ idevice_error_t idevice_get_handle(idevice_t device, uint32_t *handle) | |||
| 471 | /** | 471 | /** |
| 472 | * Gets the unique id for the device. | 472 | * Gets the unique id for the device. |
| 473 | */ | 473 | */ |
| 474 | idevice_error_t idevice_get_uuid(idevice_t device, char **uuid) | 474 | idevice_error_t idevice_get_udid(idevice_t device, char **udid) |
| 475 | { | 475 | { |
| 476 | if (!device || !uuid) | 476 | if (!device || !udid) |
| 477 | return IDEVICE_E_INVALID_ARG; | 477 | return IDEVICE_E_INVALID_ARG; |
| 478 | 478 | ||
| 479 | *uuid = strdup(device->uuid); | 479 | *udid = strdup(device->udid); |
| 480 | return IDEVICE_E_SUCCESS; | 480 | return IDEVICE_E_SUCCESS; |
| 481 | } | 481 | } |
| 482 | 482 | ||
diff --git a/src/idevice.h b/src/idevice.h index 65fdae0..130d11e 100644 --- a/src/idevice.h +++ b/src/idevice.h | |||
| @@ -63,7 +63,7 @@ struct idevice_connection_private { | |||
| 63 | }; | 63 | }; |
| 64 | 64 | ||
| 65 | struct idevice_private { | 65 | struct idevice_private { |
| 66 | char *uuid; | 66 | char *udid; |
| 67 | enum connection_type conn_type; | 67 | enum connection_type conn_type; |
| 68 | void *conn_data; | 68 | void *conn_data; |
| 69 | }; | 69 | }; |
diff --git a/src/lockdown.c b/src/lockdown.c index 2dd20a4..68a74b5 100644 --- a/src/lockdown.c +++ b/src/lockdown.c | |||
| @@ -236,8 +236,8 @@ lockdownd_error_t lockdownd_client_free(lockdownd_client_t client) | |||
| 236 | } | 236 | } |
| 237 | } | 237 | } |
| 238 | 238 | ||
| 239 | if (client->uuid) { | 239 | if (client->udid) { |
| 240 | free(client->uuid); | 240 | free(client->udid); |
| 241 | } | 241 | } |
| 242 | if (client->label) { | 242 | if (client->label) { |
| 243 | free(client->label); | 243 | free(client->label); |
| @@ -549,12 +549,12 @@ lockdownd_error_t lockdownd_remove_value(lockdownd_client_t client, const char * | |||
| 549 | * Returns the unique id of the device from lockdownd. | 549 | * Returns the unique id of the device from lockdownd. |
| 550 | * | 550 | * |
| 551 | * @param client An initialized lockdownd client. | 551 | * @param client An initialized lockdownd client. |
| 552 | * @param uuid Holds the unique id of the device. The caller is responsible | 552 | * @param udid Holds the unique id of the device. The caller is responsible |
| 553 | * for freeing the memory. | 553 | * for freeing the memory. |
| 554 | * | 554 | * |
| 555 | * @return LOCKDOWN_E_SUCCESS on success | 555 | * @return LOCKDOWN_E_SUCCESS on success |
| 556 | */ | 556 | */ |
| 557 | lockdownd_error_t lockdownd_get_device_uuid(lockdownd_client_t client, char **uuid) | 557 | lockdownd_error_t lockdownd_get_device_udid(lockdownd_client_t client, char **udid) |
| 558 | { | 558 | { |
| 559 | lockdownd_error_t ret = LOCKDOWN_E_UNKNOWN_ERROR; | 559 | lockdownd_error_t ret = LOCKDOWN_E_UNKNOWN_ERROR; |
| 560 | plist_t value = NULL; | 560 | plist_t value = NULL; |
| @@ -563,7 +563,7 @@ lockdownd_error_t lockdownd_get_device_uuid(lockdownd_client_t client, char **uu | |||
| 563 | if (ret != LOCKDOWN_E_SUCCESS) { | 563 | if (ret != LOCKDOWN_E_SUCCESS) { |
| 564 | return ret; | 564 | return ret; |
| 565 | } | 565 | } |
| 566 | plist_get_string_val(value, uuid); | 566 | plist_get_string_val(value, udid); |
| 567 | 567 | ||
| 568 | plist_free(value); | 568 | plist_free(value); |
| 569 | value = NULL; | 569 | value = NULL; |
| @@ -648,7 +648,7 @@ lockdownd_error_t lockdownd_client_new(idevice_t device, lockdownd_client_t *cli | |||
| 648 | 648 | ||
| 649 | property_list_service_client_t plistclient = NULL; | 649 | property_list_service_client_t plistclient = NULL; |
| 650 | if (property_list_service_client_new(device, 0xf27e, &plistclient) != PROPERTY_LIST_SERVICE_E_SUCCESS) { | 650 | if (property_list_service_client_new(device, 0xf27e, &plistclient) != PROPERTY_LIST_SERVICE_E_SUCCESS) { |
| 651 | debug_info("could not connect to lockdownd (device %s)", device->uuid); | 651 | debug_info("could not connect to lockdownd (device %s)", device->udid); |
| 652 | return LOCKDOWN_E_MUX_ERROR; | 652 | return LOCKDOWN_E_MUX_ERROR; |
| 653 | } | 653 | } |
| 654 | 654 | ||
| @@ -657,10 +657,10 @@ lockdownd_error_t lockdownd_client_new(idevice_t device, lockdownd_client_t *cli | |||
| 657 | client_loc->ssl_enabled = 0; | 657 | client_loc->ssl_enabled = 0; |
| 658 | client_loc->session_id = NULL; | 658 | client_loc->session_id = NULL; |
| 659 | 659 | ||
| 660 | if (idevice_get_uuid(device, &client_loc->uuid) != IDEVICE_E_SUCCESS) { | 660 | if (idevice_get_udid(device, &client_loc->udid) != IDEVICE_E_SUCCESS) { |
| 661 | debug_info("failed to get device uuid."); | 661 | debug_info("failed to get device udid."); |
| 662 | } | 662 | } |
| 663 | debug_info("device uuid: %s", client_loc->uuid); | 663 | debug_info("device udid: %s", client_loc->udid); |
| 664 | 664 | ||
| 665 | client_loc->label = label ? strdup(label) : NULL; | 665 | client_loc->label = label ? strdup(label) : NULL; |
| 666 | 666 | ||
| @@ -719,7 +719,7 @@ lockdownd_error_t lockdownd_client_new_with_handshake(idevice_t device, lockdown | |||
| 719 | ret = LOCKDOWN_E_INVALID_CONF; | 719 | ret = LOCKDOWN_E_INVALID_CONF; |
| 720 | } | 720 | } |
| 721 | 721 | ||
| 722 | if (LOCKDOWN_E_SUCCESS == ret && !userpref_has_device_public_key(client_loc->uuid)) | 722 | if (LOCKDOWN_E_SUCCESS == ret && !userpref_has_device_public_key(client_loc->udid)) |
| 723 | ret = lockdownd_pair(client_loc, NULL); | 723 | ret = lockdownd_pair(client_loc, NULL); |
| 724 | 724 | ||
| 725 | /* in any case, we need to validate pairing to receive trusted host status */ | 725 | /* in any case, we need to validate pairing to receive trusted host status */ |
| @@ -925,10 +925,10 @@ static lockdownd_error_t lockdownd_do_pair(lockdownd_client_t client, lockdownd_ | |||
| 925 | if (!pairing_mode) { | 925 | if (!pairing_mode) { |
| 926 | if (!strcmp("Unpair", verb)) { | 926 | if (!strcmp("Unpair", verb)) { |
| 927 | /* remove public key from config */ | 927 | /* remove public key from config */ |
| 928 | userpref_remove_device_public_key(client->uuid); | 928 | userpref_remove_device_public_key(client->udid); |
| 929 | } else { | 929 | } else { |
| 930 | /* store public key in config */ | 930 | /* store public key in config */ |
| 931 | userpref_set_device_public_key(client->uuid, public_key); | 931 | userpref_set_device_public_key(client->udid, public_key); |
| 932 | } | 932 | } |
| 933 | } | 933 | } |
| 934 | } else { | 934 | } else { |
diff --git a/src/lockdown.h b/src/lockdown.h index a08b040..289053a 100644 --- a/src/lockdown.h +++ b/src/lockdown.h | |||
| @@ -31,7 +31,7 @@ struct lockdownd_client_private { | |||
| 31 | property_list_service_client_t parent; | 31 | property_list_service_client_t parent; |
| 32 | int ssl_enabled; | 32 | int ssl_enabled; |
| 33 | char *session_id; | 33 | char *session_id; |
| 34 | char *uuid; | 34 | char *udid; |
| 35 | char *label; | 35 | char *label; |
| 36 | }; | 36 | }; |
| 37 | 37 | ||
diff --git a/src/mobilebackup2.c b/src/mobilebackup2.c index 1e39efa..4263e1c 100644 --- a/src/mobilebackup2.c +++ b/src/mobilebackup2.c | |||
| @@ -418,8 +418,8 @@ leave: | |||
| 418 | * @param client | 418 | * @param client |
| 419 | * @param request The request to send to the backup service. | 419 | * @param request The request to send to the backup service. |
| 420 | * Currently, this is one of "Backup", "Restore", "Info", or "List". | 420 | * Currently, this is one of "Backup", "Restore", "Info", or "List". |
| 421 | * @param target_identifier UUID of the target device. | 421 | * @param target_identifier UDID of the target device. |
| 422 | * @param source_identifier UUID of backup data? | 422 | * @param source_identifier UDID of backup data? |
| 423 | * @param options Additional options in a plist of type PLIST_DICT. | 423 | * @param options Additional options in a plist of type PLIST_DICT. |
| 424 | * | 424 | * |
| 425 | * @return MOBILEBACKUP2_E_SUCCESS if the request was successfully sent, | 425 | * @return MOBILEBACKUP2_E_SUCCESS if the request was successfully sent, |
diff --git a/src/restore.c b/src/restore.c index f4a2ed3..a9ab8b9 100644 --- a/src/restore.c +++ b/src/restore.c | |||
| @@ -112,8 +112,8 @@ restored_error_t restored_client_free(restored_client_t client) | |||
| 112 | } | 112 | } |
| 113 | } | 113 | } |
| 114 | 114 | ||
| 115 | if (client->uuid) { | 115 | if (client->udid) { |
| 116 | free(client->uuid); | 116 | free(client->udid); |
| 117 | } | 117 | } |
| 118 | if (client->label) { | 118 | if (client->label) { |
| 119 | free(client->label); | 119 | free(client->label); |
| @@ -370,22 +370,22 @@ restored_error_t restored_client_new(idevice_t device, restored_client_t *client | |||
| 370 | 370 | ||
| 371 | property_list_service_client_t plistclient = NULL; | 371 | property_list_service_client_t plistclient = NULL; |
| 372 | if (property_list_service_client_new(device, 0xf27e, &plistclient) != PROPERTY_LIST_SERVICE_E_SUCCESS) { | 372 | if (property_list_service_client_new(device, 0xf27e, &plistclient) != PROPERTY_LIST_SERVICE_E_SUCCESS) { |
| 373 | debug_info("could not connect to restored (device %s)", device->uuid); | 373 | debug_info("could not connect to restored (device %s)", device->udid); |
| 374 | return RESTORE_E_MUX_ERROR; | 374 | return RESTORE_E_MUX_ERROR; |
| 375 | } | 375 | } |
| 376 | 376 | ||
| 377 | restored_client_t client_loc = (restored_client_t) malloc(sizeof(struct restored_client_private)); | 377 | restored_client_t client_loc = (restored_client_t) malloc(sizeof(struct restored_client_private)); |
| 378 | client_loc->parent = plistclient; | 378 | client_loc->parent = plistclient; |
| 379 | client_loc->uuid = NULL; | 379 | client_loc->udid = NULL; |
| 380 | client_loc->label = NULL; | 380 | client_loc->label = NULL; |
| 381 | if (label != NULL) | 381 | if (label != NULL) |
| 382 | client_loc->label = strdup(label); | 382 | client_loc->label = strdup(label); |
| 383 | 383 | ||
| 384 | ret = idevice_get_uuid(device, &client_loc->uuid); | 384 | ret = idevice_get_udid(device, &client_loc->udid); |
| 385 | if (RESTORE_E_SUCCESS != ret) { | 385 | if (RESTORE_E_SUCCESS != ret) { |
| 386 | debug_info("failed to get device uuid."); | 386 | debug_info("failed to get device udid."); |
| 387 | } | 387 | } |
| 388 | debug_info("device uuid: %s", client_loc->uuid); | 388 | debug_info("device udid: %s", client_loc->udid); |
| 389 | 389 | ||
| 390 | if (RESTORE_E_SUCCESS == ret) { | 390 | if (RESTORE_E_SUCCESS == ret) { |
| 391 | *client = client_loc; | 391 | *client = client_loc; |
diff --git a/src/restore.h b/src/restore.h index d790d01..cf9307c 100644 --- a/src/restore.h +++ b/src/restore.h | |||
| @@ -29,7 +29,7 @@ | |||
| 29 | 29 | ||
| 30 | struct restored_client_private { | 30 | struct restored_client_private { |
| 31 | property_list_service_client_t parent; | 31 | property_list_service_client_t parent; |
| 32 | char *uuid; | 32 | char *udid; |
| 33 | char *label; | 33 | char *label; |
| 34 | plist_t info; | 34 | plist_t info; |
| 35 | }; | 35 | }; |
diff --git a/src/userpref.c b/src/userpref.c index 2f4e55b..a0c3545 100644 --- a/src/userpref.c +++ b/src/userpref.c | |||
| @@ -432,26 +432,26 @@ void userpref_get_host_id(char **host_id) | |||
| 432 | /** | 432 | /** |
| 433 | * Determines whether this device has been connected to this system before. | 433 | * Determines whether this device has been connected to this system before. |
| 434 | * | 434 | * |
| 435 | * @param uid The device uid as given by the device. | 435 | * @param udid The device UDID as given by the device. |
| 436 | * | 436 | * |
| 437 | * @return 1 if the device has been connected previously to this configuration | 437 | * @return 1 if the device has been connected previously to this configuration |
| 438 | * or 0 otherwise. | 438 | * or 0 otherwise. |
| 439 | */ | 439 | */ |
| 440 | int userpref_has_device_public_key(const char *uuid) | 440 | int userpref_has_device_public_key(const char *udid) |
| 441 | { | 441 | { |
| 442 | int ret = 0; | 442 | int ret = 0; |
| 443 | const char *config_path; | 443 | const char *config_path; |
| 444 | char *config_file; | 444 | char *config_file; |
| 445 | struct stat st; | 445 | struct stat st; |
| 446 | 446 | ||
| 447 | if (!uuid) return 0; | 447 | if (!udid) return 0; |
| 448 | 448 | ||
| 449 | /* first get config file */ | 449 | /* first get config file */ |
| 450 | config_path = userpref_get_config_dir(); | 450 | config_path = userpref_get_config_dir(); |
| 451 | config_file = (char*)malloc(strlen(config_path)+1+strlen(uuid)+4+1); | 451 | config_file = (char*)malloc(strlen(config_path)+1+strlen(udid)+4+1); |
| 452 | strcpy(config_file, config_path); | 452 | strcpy(config_file, config_path); |
| 453 | strcat(config_file, DIR_SEP_S); | 453 | strcat(config_file, DIR_SEP_S); |
| 454 | strcat(config_file, uuid); | 454 | strcat(config_file, udid); |
| 455 | strcat(config_file, ".pem"); | 455 | strcat(config_file, ".pem"); |
| 456 | 456 | ||
| 457 | if ((stat(config_file, &st) == 0) && S_ISREG(st.st_mode)) | 457 | if ((stat(config_file, &st) == 0) && S_ISREG(st.st_mode)) |
| @@ -461,21 +461,21 @@ int userpref_has_device_public_key(const char *uuid) | |||
| 461 | } | 461 | } |
| 462 | 462 | ||
| 463 | /** | 463 | /** |
| 464 | * Fills a list with UUIDs of devices that have been connected to this | 464 | * Fills a list with UDIDs of devices that have been connected to this |
| 465 | * system before, i.e. for which a public key file exists. | 465 | * system before, i.e. for which a public key file exists. |
| 466 | * | 466 | * |
| 467 | * @param list A pointer to a char** initially pointing to NULL that will | 467 | * @param list A pointer to a char** initially pointing to NULL that will |
| 468 | * hold a newly allocated list of UUIDs upon successful return. | 468 | * hold a newly allocated list of UDIDs upon successful return. |
| 469 | * The caller is responsible for freeing the memory. Note that if | 469 | * The caller is responsible for freeing the memory. Note that if |
| 470 | * no public key file was found the list has to be freed too as it | 470 | * no public key file was found the list has to be freed too as it |
| 471 | * points to a terminating NULL element. | 471 | * points to a terminating NULL element. |
| 472 | * @param count The number of UUIDs found. This parameter can be NULL if it | 472 | * @param count The number of UDIDs found. This parameter can be NULL if it |
| 473 | * is not required. | 473 | * is not required. |
| 474 | * | 474 | * |
| 475 | * @return USERPREF_E_SUCCESS on success, or USERPREF_E_INVALID_ARG if the | 475 | * @return USERPREF_E_SUCCESS on success, or USERPREF_E_INVALID_ARG if the |
| 476 | * list parameter is not pointing to NULL. | 476 | * list parameter is not pointing to NULL. |
| 477 | */ | 477 | */ |
| 478 | userpref_error_t userpref_get_paired_uuids(char ***list, unsigned int *count) | 478 | userpref_error_t userpref_get_paired_udids(char ***list, unsigned int *count) |
| 479 | { | 479 | { |
| 480 | struct slist_t { | 480 | struct slist_t { |
| 481 | char *name; | 481 | char *name; |
| @@ -483,7 +483,7 @@ userpref_error_t userpref_get_paired_uuids(char ***list, unsigned int *count) | |||
| 483 | }; | 483 | }; |
| 484 | DIR *config_dir; | 484 | DIR *config_dir; |
| 485 | const char *config_path; | 485 | const char *config_path; |
| 486 | struct slist_t *uuids = NULL; | 486 | struct slist_t *udids = NULL; |
| 487 | unsigned int i; | 487 | unsigned int i; |
| 488 | unsigned int found = 0; | 488 | unsigned int found = 0; |
| 489 | 489 | ||
| @@ -500,7 +500,7 @@ userpref_error_t userpref_get_paired_uuids(char ***list, unsigned int *count) | |||
| 500 | config_dir = opendir(config_path); | 500 | config_dir = opendir(config_path); |
| 501 | if (config_dir) { | 501 | if (config_dir) { |
| 502 | struct dirent *entry; | 502 | struct dirent *entry; |
| 503 | struct slist_t *listp = uuids; | 503 | struct slist_t *listp = udids; |
| 504 | while ((entry = readdir(config_dir))) { | 504 | while ((entry = readdir(config_dir))) { |
| 505 | char *ext = strstr(entry->d_name, ".pem"); | 505 | char *ext = strstr(entry->d_name, ".pem"); |
| 506 | if (ext && ((ext - entry->d_name) == 40) && (strlen(entry->d_name) == 44)) { | 506 | if (ext && ((ext - entry->d_name) == 40) && (strlen(entry->d_name) == 44)) { |
| @@ -511,7 +511,7 @@ userpref_error_t userpref_get_paired_uuids(char ***list, unsigned int *count) | |||
| 511 | ne->next = NULL; | 511 | ne->next = NULL; |
| 512 | if (!listp) { | 512 | if (!listp) { |
| 513 | listp = ne; | 513 | listp = ne; |
| 514 | uuids = listp; | 514 | udids = listp; |
| 515 | } else { | 515 | } else { |
| 516 | listp->next = ne; | 516 | listp->next = ne; |
| 517 | listp = listp->next; | 517 | listp = listp->next; |
| @@ -523,10 +523,10 @@ userpref_error_t userpref_get_paired_uuids(char ***list, unsigned int *count) | |||
| 523 | } | 523 | } |
| 524 | *list = (char**)malloc(sizeof(char*) * (found+1)); | 524 | *list = (char**)malloc(sizeof(char*) * (found+1)); |
| 525 | i = 0; | 525 | i = 0; |
| 526 | while (uuids) { | 526 | while (udids) { |
| 527 | (*list)[i++] = uuids->name; | 527 | (*list)[i++] = udids->name; |
| 528 | struct slist_t *old = uuids; | 528 | struct slist_t *old = udids; |
| 529 | uuids = uuids->next; | 529 | udids = udids->next; |
| 530 | free(old); | 530 | free(old); |
| 531 | } | 531 | } |
| 532 | (*list)[i] = NULL; | 532 | (*list)[i] = NULL; |
| @@ -542,17 +542,18 @@ userpref_error_t userpref_get_paired_uuids(char ***list, unsigned int *count) | |||
| 542 | * Mark the device (as represented by the key) as having connected to this | 542 | * Mark the device (as represented by the key) as having connected to this |
| 543 | * configuration. | 543 | * configuration. |
| 544 | * | 544 | * |
| 545 | * @param udid The device UDID as given by the device | ||
| 545 | * @param public_key The public key given by the device | 546 | * @param public_key The public key given by the device |
| 546 | * | 547 | * |
| 547 | * @return 1 on success and 0 if no public key is given or if it has already | 548 | * @return 1 on success and 0 if no public key is given or if it has already |
| 548 | * been marked as connected previously. | 549 | * been marked as connected previously. |
| 549 | */ | 550 | */ |
| 550 | userpref_error_t userpref_set_device_public_key(const char *uuid, key_data_t public_key) | 551 | userpref_error_t userpref_set_device_public_key(const char *udid, key_data_t public_key) |
| 551 | { | 552 | { |
| 552 | if (NULL == public_key.data) | 553 | if (NULL == public_key.data) |
| 553 | return USERPREF_E_INVALID_ARG; | 554 | return USERPREF_E_INVALID_ARG; |
| 554 | 555 | ||
| 555 | if (userpref_has_device_public_key(uuid)) | 556 | if (userpref_has_device_public_key(udid)) |
| 556 | return USERPREF_E_SUCCESS; | 557 | return USERPREF_E_SUCCESS; |
| 557 | 558 | ||
| 558 | /* ensure config directory exists */ | 559 | /* ensure config directory exists */ |
| @@ -560,10 +561,10 @@ userpref_error_t userpref_set_device_public_key(const char *uuid, key_data_t pub | |||
| 560 | 561 | ||
| 561 | /* build file path */ | 562 | /* build file path */ |
| 562 | const char *config_path = userpref_get_config_dir(); | 563 | const char *config_path = userpref_get_config_dir(); |
| 563 | char *pem = (char*)malloc(strlen(config_path)+1+strlen(uuid)+4+1); | 564 | char *pem = (char*)malloc(strlen(config_path)+1+strlen(udid)+4+1); |
| 564 | strcpy(pem, config_path); | 565 | strcpy(pem, config_path); |
| 565 | strcat(pem, DIR_SEP_S); | 566 | strcat(pem, DIR_SEP_S); |
| 566 | strcat(pem, uuid); | 567 | strcat(pem, udid); |
| 567 | strcat(pem, ".pem"); | 568 | strcat(pem, ".pem"); |
| 568 | 569 | ||
| 569 | /* store file */ | 570 | /* store file */ |
| @@ -580,23 +581,23 @@ userpref_error_t userpref_set_device_public_key(const char *uuid, key_data_t pub | |||
| 580 | } | 581 | } |
| 581 | 582 | ||
| 582 | /** | 583 | /** |
| 583 | * Remove the public key stored for the device with uuid from this host. | 584 | * Remove the public key stored for the device with udid from this host. |
| 584 | * | 585 | * |
| 585 | * @param uuid The uuid of the device | 586 | * @param udid The udid of the device |
| 586 | * | 587 | * |
| 587 | * @return USERPREF_E_SUCCESS on success. | 588 | * @return USERPREF_E_SUCCESS on success. |
| 588 | */ | 589 | */ |
| 589 | userpref_error_t userpref_remove_device_public_key(const char *uuid) | 590 | userpref_error_t userpref_remove_device_public_key(const char *udid) |
| 590 | { | 591 | { |
| 591 | if (!userpref_has_device_public_key(uuid)) | 592 | if (!userpref_has_device_public_key(udid)) |
| 592 | return USERPREF_E_SUCCESS; | 593 | return USERPREF_E_SUCCESS; |
| 593 | 594 | ||
| 594 | /* build file path */ | 595 | /* build file path */ |
| 595 | const char *config_path = userpref_get_config_dir(); | 596 | const char *config_path = userpref_get_config_dir(); |
| 596 | char *pem = (char*)malloc(strlen(config_path)+1+strlen(uuid)+4+1); | 597 | char *pem = (char*)malloc(strlen(config_path)+1+strlen(udid)+4+1); |
| 597 | strcpy(pem, config_path); | 598 | strcpy(pem, config_path); |
| 598 | strcat(pem, DIR_SEP_S); | 599 | strcat(pem, DIR_SEP_S); |
| 599 | strcat(pem, uuid); | 600 | strcat(pem, udid); |
| 600 | strcat(pem, ".pem"); | 601 | strcat(pem, ".pem"); |
| 601 | 602 | ||
| 602 | /* remove file */ | 603 | /* remove file */ |
diff --git a/src/userpref.h b/src/userpref.h index e5dcd1f..7ff91b3 100644 --- a/src/userpref.h +++ b/src/userpref.h | |||
| @@ -64,10 +64,10 @@ LIBIMOBILEDEVICE_INTERNAL userpref_error_t userpref_get_keys_and_certs(gnutls_x5 | |||
| 64 | #endif | 64 | #endif |
| 65 | LIBIMOBILEDEVICE_INTERNAL userpref_error_t userpref_set_keys_and_certs(key_data_t * root_key, key_data_t * root_cert, key_data_t * host_key, key_data_t * host_cert); | 65 | LIBIMOBILEDEVICE_INTERNAL userpref_error_t userpref_set_keys_and_certs(key_data_t * root_key, key_data_t * root_cert, key_data_t * host_key, key_data_t * host_cert); |
| 66 | LIBIMOBILEDEVICE_INTERNAL userpref_error_t userpref_get_certs_as_pem(key_data_t *pem_root_cert, key_data_t *pem_host_cert); | 66 | LIBIMOBILEDEVICE_INTERNAL userpref_error_t userpref_get_certs_as_pem(key_data_t *pem_root_cert, key_data_t *pem_host_cert); |
| 67 | LIBIMOBILEDEVICE_INTERNAL userpref_error_t userpref_set_device_public_key(const char *uuid, key_data_t public_key); | 67 | LIBIMOBILEDEVICE_INTERNAL userpref_error_t userpref_set_device_public_key(const char *udid, key_data_t public_key); |
| 68 | userpref_error_t userpref_remove_device_public_key(const char *uuid); | 68 | userpref_error_t userpref_remove_device_public_key(const char *udid); |
| 69 | LIBIMOBILEDEVICE_INTERNAL int userpref_has_device_public_key(const char *uuid); | 69 | LIBIMOBILEDEVICE_INTERNAL int userpref_has_device_public_key(const char *udid); |
| 70 | userpref_error_t userpref_get_paired_uuids(char ***list, unsigned int *count); | 70 | userpref_error_t userpref_get_paired_udids(char ***list, unsigned int *count); |
| 71 | void userpref_get_host_id(char **host_id); | 71 | void userpref_get_host_id(char **host_id); |
| 72 | 72 | ||
| 73 | #endif | 73 | #endif |
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 | } |
