summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2010-05-28 12:03:37 +0200
committerGravatar Martin Szulecki2010-05-28 12:03:37 +0200
commitb2c56d67d0dda2bf7624c27dc3714fa8e323bcf7 (patch)
tree28b8263df1b429ffdb9c2d6f0db6e0a5eee24c0c
parent75f7ce360a7cfd5a2fb25cf852fb9c4a6d0f38f4 (diff)
downloadlibimobiledevice-b2c56d67d0dda2bf7624c27dc3714fa8e323bcf7.tar.gz
libimobiledevice-b2c56d67d0dda2bf7624c27dc3714fa8e323bcf7.tar.bz2
Add option to avoid auto-pairing for lockdownd connections in ideviceinfo
-rw-r--r--tools/ideviceinfo.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/ideviceinfo.c b/tools/ideviceinfo.c
index 9183d92..cbf2ef8 100644
--- a/tools/ideviceinfo.c
+++ b/tools/ideviceinfo.c
@@ -199,6 +199,7 @@ static void print_usage(int argc, char **argv)
199 printf("Usage: %s [OPTIONS]\n", (name ? name + 1: argv[0])); 199 printf("Usage: %s [OPTIONS]\n", (name ? name + 1: argv[0]));
200 printf("Show information about a connected iPhone/iPod Touch.\n\n"); 200 printf("Show information about a connected iPhone/iPod Touch.\n\n");
201 printf(" -d, --debug\t\tenable communication debugging\n"); 201 printf(" -d, --debug\t\tenable communication debugging\n");
202 printf(" -s, --simple\t\tuse a simple connection to avoid auto-pairing with the device\n");
202 printf(" -u, --uuid UUID\ttarget specific device by its 40-digit device UUID\n"); 203 printf(" -u, --uuid UUID\ttarget specific device by its 40-digit device UUID\n");
203 printf(" -q, --domain NAME\tset domain of query to NAME. Default: None\n"); 204 printf(" -q, --domain NAME\tset domain of query to NAME. Default: None\n");
204 printf(" -k, --key NAME\tonly query key specified by NAME. Default: All keys.\n"); 205 printf(" -k, --key NAME\tonly query key specified by NAME. Default: All keys.\n");
@@ -218,6 +219,7 @@ int main(int argc, char *argv[])
218 idevice_t phone = NULL; 219 idevice_t phone = NULL;
219 idevice_error_t ret = IDEVICE_E_UNKNOWN_ERROR; 220 idevice_error_t ret = IDEVICE_E_UNKNOWN_ERROR;
220 int i; 221 int i;
222 int simple = 0;
221 int format = FORMAT_KEY_VALUE; 223 int format = FORMAT_KEY_VALUE;
222 char uuid[41]; 224 char uuid[41];
223 char *domain = NULL; 225 char *domain = NULL;
@@ -268,6 +270,10 @@ int main(int argc, char *argv[])
268 format = FORMAT_XML; 270 format = FORMAT_XML;
269 continue; 271 continue;
270 } 272 }
273 else if (!strcmp(argv[i], "-s") || !strcmp(argv[i], "--simple")) {
274 simple = 1;
275 continue;
276 }
271 else if (!strcmp(argv[i], "-h") || !strcmp(argv[i], "--help")) { 277 else if (!strcmp(argv[i], "-h") || !strcmp(argv[i], "--help")) {
272 print_usage(argc, argv); 278 print_usage(argc, argv);
273 return 0; 279 return 0;
@@ -294,7 +300,9 @@ int main(int argc, char *argv[])
294 } 300 }
295 } 301 }
296 302
297 if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake(phone, &client, "ideviceinfo")) { 303 if (LOCKDOWN_E_SUCCESS != (simple ?
304 lockdownd_client_new(phone, &client, "ideviceinfo"):
305 lockdownd_client_new_with_handshake(phone, &client, "ideviceinfo"))) {
298 idevice_free(phone); 306 idevice_free(phone);
299 return -1; 307 return -1;
300 } 308 }