summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/ideviceactivation.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/tools/ideviceactivation.c b/tools/ideviceactivation.c
index 93e6717..f7b3da6 100644
--- a/tools/ideviceactivation.c
+++ b/tools/ideviceactivation.c
@@ -447,9 +447,22 @@ int main(int argc, char *argv[])
} else {
// activate device using lockdown
if (LOCKDOWN_E_SUCCESS != lockdownd_activate(lockdown, record)) {
- fprintf(stderr, "Failed to activate device with record.\n");
- result = EXIT_FAILURE;
- goto cleanup;
+ plist_t state = NULL;
+ lockdownd_get_value(lockdown, NULL, "ActivationState", &state);
+ int success = 0;
+ if (state && plist_get_node_type(state) == PLIST_STRING) {
+ char *strval = NULL;
+ plist_get_string_val(state, &strval);
+ if (strval && strcmp(strval, "Unactivated")) {
+ success = 1;
+ }
+ free(strval);
+ }
+ if (!success) {
+ fprintf(stderr, "Failed to activate device with record.\n");
+ result = EXIT_FAILURE;
+ goto cleanup;
+ }
}
}