summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/libimobiledevice/lockdown.h39
-rw-r--r--src/lockdown.c12
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" {
31#include <libimobiledevice/libimobiledevice.h> 31#include <libimobiledevice/libimobiledevice.h>
32 32
33/* Error Codes */ 33/* Error Codes */
34#define LOCKDOWN_E_SUCCESS 0 34#define LOCKDOWN_E_SUCCESS 0
35#define LOCKDOWN_E_INVALID_ARG -1 35#define LOCKDOWN_E_INVALID_ARG -1
36#define LOCKDOWN_E_INVALID_CONF -2 36#define LOCKDOWN_E_INVALID_CONF -2
37#define LOCKDOWN_E_PLIST_ERROR -3 37#define LOCKDOWN_E_PLIST_ERROR -3
38#define LOCKDOWN_E_PAIRING_FAILED -4 38#define LOCKDOWN_E_PAIRING_FAILED -4
39#define LOCKDOWN_E_SSL_ERROR -5 39#define LOCKDOWN_E_SSL_ERROR -5
40#define LOCKDOWN_E_DICT_ERROR -6 40#define LOCKDOWN_E_DICT_ERROR -6
41#define LOCKDOWN_E_START_SERVICE_FAILED -7 41#define LOCKDOWN_E_START_SERVICE_FAILED -7
42#define LOCKDOWN_E_NOT_ENOUGH_DATA -8 42#define LOCKDOWN_E_NOT_ENOUGH_DATA -8
43#define LOCKDOWN_E_SET_VALUE_PROHIBITED -9 43#define LOCKDOWN_E_SET_VALUE_PROHIBITED -9
44#define LOCKDOWN_E_GET_VALUE_PROHIBITED -10 44#define LOCKDOWN_E_GET_VALUE_PROHIBITED -10
45#define LOCKDOWN_E_REMOVE_VALUE_PROHIBITED -11 45#define LOCKDOWN_E_REMOVE_VALUE_PROHIBITED -11
46#define LOCKDOWN_E_MUX_ERROR -12 46#define LOCKDOWN_E_MUX_ERROR -12
47#define LOCKDOWN_E_ACTIVATION_FAILED -13 47#define LOCKDOWN_E_ACTIVATION_FAILED -13
48#define LOCKDOWN_E_PASSWORD_PROTECTED -14 48#define LOCKDOWN_E_PASSWORD_PROTECTED -14
49#define LOCKDOWN_E_NO_RUNNING_SESSION -15 49#define LOCKDOWN_E_NO_RUNNING_SESSION -15
50#define LOCKDOWN_E_INVALID_HOST_ID -16 50#define LOCKDOWN_E_INVALID_HOST_ID -16
51#define LOCKDOWN_E_INVALID_SERVICE -17 51#define LOCKDOWN_E_INVALID_SERVICE -17
52#define LOCKDOWN_E_INVALID_ACTIVATION_RECORD -18
52 53
53#define LOCKDOWN_E_UNKNOWN_ERROR -256 54#define LOCKDOWN_E_UNKNOWN_ERROR -256
54 55
55typedef int16_t lockdownd_error_t; 56typedef int16_t lockdownd_error_t;
56 57
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
1337 if (lockdown_check_result(dict, "Activate") == RESULT_SUCCESS) { 1337 if (lockdown_check_result(dict, "Activate") == RESULT_SUCCESS) {
1338 debug_info("success"); 1338 debug_info("success");
1339 ret = LOCKDOWN_E_SUCCESS; 1339 ret = LOCKDOWN_E_SUCCESS;
1340
1341 } else {
1342 plist_t error_node = plist_dict_get_item(dict, "Error");
1343 if (error_node && PLIST_STRING == plist_get_node_type(error_node)) {
1344 char *error = NULL;
1345 plist_get_string_val(error_node, &error);
1346 if (!strcmp(error, "InvalidActivationRecord")) {
1347 ret = LOCKDOWN_E_INVALID_ACTIVATION_RECORD;
1348 }
1349 free(error);
1350 }
1340 } 1351 }
1352
1341 plist_free(dict); 1353 plist_free(dict);
1342 dict = NULL; 1354 dict = NULL;
1343 1355