summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/ideviceactivation.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/tools/ideviceactivation.c b/tools/ideviceactivation.c
index ef16ca0..0ea3901 100644
--- a/tools/ideviceactivation.c
+++ b/tools/ideviceactivation.c
@@ -60,6 +60,7 @@ static void print_usage(int argc, char **argv)
printf(" activate\t\tattempt to activate the device\n");
printf(" deactivate\t\tdeactivate the device\n");
printf(" state\t\t\tquery device about its activation state\n");
+ printf(" itunes\t\ttell the device that it has been connected to iTunes (useful for < iOS 4)\n");
printf("\n");
printf("The following OPTIONS are accepted:\n");
printf(" -d, --debug\t\tenable communication debugging\n");
@@ -142,7 +143,7 @@ int main(int argc, char *argv[])
int use_network = 0;
typedef enum {
- OP_NONE = 0, OP_ACTIVATE, OP_DEACTIVATE, OP_GETSTATE
+ OP_NONE = 0, OP_ACTIVATE, OP_DEACTIVATE, OP_GETSTATE, OP_ITUNES
} op_t;
op_t op = OP_NONE;
@@ -202,6 +203,10 @@ int main(int argc, char *argv[])
op = OP_GETSTATE;
continue;
}
+ else if (!strcmp(argv[i], "itunes")) {
+ op = OP_ITUNES;
+ continue;
+ }
else {
print_usage(argc, argv);
return EXIT_SUCCESS;
@@ -602,6 +607,18 @@ int main(int argc, char *argv[])
}
}
break;
+
+ case OP_ITUNES: {
+ // set iTunesHasConnected if we succeeded
+ if (LOCKDOWN_E_SUCCESS != lockdownd_set_value(lockdown, NULL, "iTunesHasConnected", plist_new_bool(1))) {
+ fprintf(stderr, "Failed to set iTunesHasConnected on device.\n");
+ result = EXIT_FAILURE;
+ goto cleanup;
+ }
+ result = EXIT_SUCCESS;
+ printf("Successfully set 'iTunesHasConnected'.\n");
+ }
+ break;
}
cleanup: