diff options
-rw-r--r-- | include/libimobiledevice/lockdown.h | 39 | ||||
-rw-r--r-- | src/lockdown.c | 12 |
2 files changed, 32 insertions, 19 deletions
diff --git a/include/libimobiledevice/lockdown.h b/include/libimobiledevice/lockdown.h index 49c708d..bfdffad 100644 --- a/include/libimobiledevice/lockdown.h +++ b/include/libimobiledevice/lockdown.h @@ -31,26 +31,27 @@ extern "C" { #include <libimobiledevice/libimobiledevice.h> /* Error Codes */ -#define LOCKDOWN_E_SUCCESS 0 -#define LOCKDOWN_E_INVALID_ARG -1 -#define LOCKDOWN_E_INVALID_CONF -2 -#define LOCKDOWN_E_PLIST_ERROR -3 -#define LOCKDOWN_E_PAIRING_FAILED -4 -#define LOCKDOWN_E_SSL_ERROR -5 -#define LOCKDOWN_E_DICT_ERROR -6 -#define LOCKDOWN_E_START_SERVICE_FAILED -7 -#define LOCKDOWN_E_NOT_ENOUGH_DATA -8 -#define LOCKDOWN_E_SET_VALUE_PROHIBITED -9 -#define LOCKDOWN_E_GET_VALUE_PROHIBITED -10 -#define LOCKDOWN_E_REMOVE_VALUE_PROHIBITED -11 -#define LOCKDOWN_E_MUX_ERROR -12 -#define LOCKDOWN_E_ACTIVATION_FAILED -13 -#define LOCKDOWN_E_PASSWORD_PROTECTED -14 -#define LOCKDOWN_E_NO_RUNNING_SESSION -15 -#define LOCKDOWN_E_INVALID_HOST_ID -16 -#define LOCKDOWN_E_INVALID_SERVICE -17 +#define LOCKDOWN_E_SUCCESS 0 +#define LOCKDOWN_E_INVALID_ARG -1 +#define LOCKDOWN_E_INVALID_CONF -2 +#define LOCKDOWN_E_PLIST_ERROR -3 +#define LOCKDOWN_E_PAIRING_FAILED -4 +#define LOCKDOWN_E_SSL_ERROR -5 +#define LOCKDOWN_E_DICT_ERROR -6 +#define LOCKDOWN_E_START_SERVICE_FAILED -7 +#define LOCKDOWN_E_NOT_ENOUGH_DATA -8 +#define LOCKDOWN_E_SET_VALUE_PROHIBITED -9 +#define LOCKDOWN_E_GET_VALUE_PROHIBITED -10 +#define LOCKDOWN_E_REMOVE_VALUE_PROHIBITED -11 +#define LOCKDOWN_E_MUX_ERROR -12 +#define LOCKDOWN_E_ACTIVATION_FAILED -13 +#define LOCKDOWN_E_PASSWORD_PROTECTED -14 +#define LOCKDOWN_E_NO_RUNNING_SESSION -15 +#define LOCKDOWN_E_INVALID_HOST_ID -16 +#define LOCKDOWN_E_INVALID_SERVICE -17 +#define LOCKDOWN_E_INVALID_ACTIVATION_RECORD -18 -#define LOCKDOWN_E_UNKNOWN_ERROR -256 +#define LOCKDOWN_E_UNKNOWN_ERROR -256 typedef int16_t lockdownd_error_t; diff --git a/src/lockdown.c b/src/lockdown.c index 13f3d48..512ec9e 100644 --- a/src/lockdown.c +++ b/src/lockdown.c @@ -1337,7 +1337,19 @@ lockdownd_error_t lockdownd_activate(lockdownd_client_t client, plist_t activati if (lockdown_check_result(dict, "Activate") == RESULT_SUCCESS) { debug_info("success"); ret = LOCKDOWN_E_SUCCESS; + + } else { + plist_t error_node = plist_dict_get_item(dict, "Error"); + if (error_node && PLIST_STRING == plist_get_node_type(error_node)) { + char *error = NULL; + plist_get_string_val(error_node, &error); + if (!strcmp(error, "InvalidActivationRecord")) { + ret = LOCKDOWN_E_INVALID_ACTIVATION_RECORD; + } + free(error); + } } + plist_free(dict); dict = NULL; |