summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2014-10-03 12:14:33 +0200
committerGravatar Martin Szulecki2014-10-03 12:14:33 +0200
commit3e404301be0bf0b173d1e12cab547164a29c4a5d (patch)
tree3f613488415b9fe2bd5cea9eb6dbe9c908dea786
parent89101482ca8a705990c918ad50cd7c48a24fd69d (diff)
downloadlibideviceactivation-3e404301be0bf0b173d1e12cab547164a29c4a5d.tar.gz
libideviceactivation-3e404301be0bf0b173d1e12cab547164a29c4a5d.tar.bz2
ideviceactivation: Allow to set a custom signing service URL
-rw-r--r--tools/ideviceactivation.c15
1 files changed, 15 insertions, 0 deletions
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");