Skip to content

Commit

Permalink
ideviceactivation: Allow to set a custom signing service URL
Browse files Browse the repository at this point in the history
  • Loading branch information
FunkyM committed Oct 3, 2014
1 parent 8910148 commit 3e40430
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tools/ideviceactivation.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand All @@ -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;

Expand All @@ -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;
Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit 3e40430

Please sign in to comment.