From 3e404301be0bf0b173d1e12cab547164a29c4a5d Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Fri, 3 Oct 2014 12:14:33 +0200 Subject: ideviceactivation: Allow to set a custom signing service URL --- tools/ideviceactivation.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tools') diff --git a/tools/ideviceactivation.c b/tools/ideviceactivation.c index 8fd5098..62f0c18 100644 --- a/tools/ideviceactivation.c +++ b/tools/ideviceactivation.c @@ -42,6 +42,7 @@ static void print_usage(int argc, char **argv) printf("\nThe following OPTIONS are accepted:\n"); printf(" -d, --debug\t\tenable communication debugging\n"); printf(" -u, --udid UDID\ttarget specific device by its 40-digit device UDID\n"); + printf(" -s, --service URL\tuse signing service at URL instead of default\n"); printf(" -h, --help\t\tprints usage information\n"); printf("\n"); } @@ -62,6 +63,7 @@ int main(int argc, char *argv[]) plist_dict_iter iter = NULL; plist_t record = NULL; char *udid = NULL; + char *signing_service_url = NULL; int i; int result = EXIT_FAILURE; @@ -86,6 +88,15 @@ int main(int argc, char *argv[]) udid = argv[i]; continue; } + else if (!strcmp(argv[i], "-s") || !strcmp(argv[i], "--service")) { + i++; + if (!argv[i]) { + print_usage(argc, argv); + return EXIT_FAILURE; + } + signing_service_url = argv[i]; + continue; + } else if (!strcmp(argv[i], "-h") || !strcmp(argv[i], "--help")) { print_usage(argc, argv); return EXIT_SUCCESS; @@ -152,6 +163,10 @@ int main(int argc, char *argv[]) goto cleanup; } + if (request && signing_service_url) { + idevice_activation_request_set_url(request, signing_service_url); + } + while(1) { if (idevice_activation_send_request(request, &response) != IDEVICE_ACTIVATION_E_SUCCESS) { fprintf(stderr, "Failed to send request or retrieve response.\n"); -- cgit v1.1-32-gdbae