diff options
author | Martin Szulecki | 2010-05-28 12:03:37 +0200 |
---|---|---|
committer | Martin Szulecki | 2010-06-06 16:19:18 +0200 |
commit | f43ca2d9554ab5bd0f06069f126f2bfca4941c0c (patch) | |
tree | 50156f172d8396072c859623282ce4196dea5d62 | |
parent | 4a809450c4bf55f522320e14568bae332fa4b8bf (diff) | |
download | libimobiledevice-f43ca2d9554ab5bd0f06069f126f2bfca4941c0c.tar.gz libimobiledevice-f43ca2d9554ab5bd0f06069f126f2bfca4941c0c.tar.bz2 |
Add option to avoid auto-pairing for lockdownd connections in ideviceinfo
-rw-r--r-- | tools/ideviceinfo.c | 10 |
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) printf("Usage: %s [OPTIONS]\n", (name ? name + 1: argv[0])); printf("Show information about a connected iPhone/iPod Touch.\n\n"); printf(" -d, --debug\t\tenable communication debugging\n"); + printf(" -s, --simple\t\tuse a simple connection to avoid auto-pairing with the device\n"); printf(" -u, --uuid UUID\ttarget specific device by its 40-digit device UUID\n"); printf(" -q, --domain NAME\tset domain of query to NAME. Default: None\n"); printf(" -k, --key NAME\tonly query key specified by NAME. Default: All keys.\n"); @@ -218,6 +219,7 @@ int main(int argc, char *argv[]) idevice_t phone = NULL; idevice_error_t ret = IDEVICE_E_UNKNOWN_ERROR; int i; + int simple = 0; int format = FORMAT_KEY_VALUE; char uuid[41]; char *domain = NULL; @@ -268,6 +270,10 @@ int main(int argc, char *argv[]) format = FORMAT_XML; continue; } + else if (!strcmp(argv[i], "-s") || !strcmp(argv[i], "--simple")) { + simple = 1; + continue; + } else if (!strcmp(argv[i], "-h") || !strcmp(argv[i], "--help")) { print_usage(argc, argv); return 0; @@ -294,7 +300,9 @@ int main(int argc, char *argv[]) } } - if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake(phone, &client, "ideviceinfo")) { + if (LOCKDOWN_E_SUCCESS != (simple ? + lockdownd_client_new(phone, &client, "ideviceinfo"): + lockdownd_client_new_with_handshake(phone, &client, "ideviceinfo"))) { idevice_free(phone); return -1; } |