summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/MobileSync.c13
-rw-r--r--src/lockdown.c18
2 files changed, 14 insertions, 17 deletions
diff --git a/src/MobileSync.c b/src/MobileSync.c
index 752aee9..839ed2b 100644
--- a/src/MobileSync.c
+++ b/src/MobileSync.c
@@ -222,7 +222,7 @@ iphone_error_t iphone_msync_get_all_contacts(iphone_msync_client_t client)
222 222
223 ret = iphone_msync_recv(client, &array); 223 ret = iphone_msync_recv(client, &array);
224 224
225 plist_t rep_node = plist_find_node(array, PLIST_STRING, "SDSyncTypeSlow", strlen("SDSyncTypeSlow")); 225 plist_t rep_node = plist_find_node_by_string(array, "SDSyncTypeSlow");
226 226
227 if (!rep_node) 227 if (!rep_node)
228 return ret; 228 return ret;
@@ -244,10 +244,9 @@ iphone_error_t iphone_msync_get_all_contacts(iphone_msync_client_t client)
244 plist_t contact_node; 244 plist_t contact_node;
245 plist_t switch_node; 245 plist_t switch_node;
246 246
247 contact_node = plist_find_node(array, PLIST_STRING, "com.apple.Contacts", strlen("com.apple.Contacts")); 247 contact_node = plist_find_node_by_string(array, "com.apple.Contacts");
248 switch_node = 248 switch_node =
249 plist_find_node(array, PLIST_STRING, "SDMessageDeviceReadyToReceiveChanges", 249 plist_find_node_by_string(array, "SDMessageDeviceReadyToReceiveChanges");
250 strlen("SDMessageDeviceReadyToReceiveChanges"));
251 250
252 while (NULL == switch_node) { 251 while (NULL == switch_node) {
253 252
@@ -264,10 +263,8 @@ iphone_error_t iphone_msync_get_all_contacts(iphone_msync_client_t client)
264 263
265 ret = iphone_msync_recv(client, &array); 264 ret = iphone_msync_recv(client, &array);
266 265
267 contact_node = plist_find_node(array, PLIST_STRING, "com.apple.Contacts", strlen("com.apple.Contacts")); 266 contact_node = plist_find_node_by_string(array, "com.apple.Contacts");
268 switch_node = 267 switch_node = plist_find_node_by_string(array, "SDMessageDeviceReadyToReceiveChanges");
269 plist_find_node(array, PLIST_STRING, "SDMessageDeviceReadyToReceiveChanges",
270 strlen("SDMessageDeviceReadyToReceiveChanges"));
271 } 268 }
272 269
273 array = plist_new_array(); 270 array = plist_new_array();
diff --git a/src/lockdown.c b/src/lockdown.c
index a02e6a8..2f48dfd 100644
--- a/src/lockdown.c
+++ b/src/lockdown.c
@@ -411,15 +411,15 @@ iphone_error_t lockdownd_generic_get_value(iphone_lckd_client_t control, const c
411 if (!strcmp(result_key, "Value")) { 411 if (!strcmp(result_key, "Value")) {
412 log_dbg_msg(DBGMASK_LOCKDOWND, "lockdownd_generic_get_value(): success\n"); 412 log_dbg_msg(DBGMASK_LOCKDOWND, "lockdownd_generic_get_value(): success\n");
413 413
414 plist_type value_value_type; 414 plist_type value_value_type = plist_get_node_type(value_value_node);
415 char *value_value = NULL; 415 if (PLIST_STRING == value_value_type) {
416 uint64_t valval_length = 0; 416 char *value_value = NULL;
417 plist_get_string_val(value_value_node, &value_value);
417 418
418 plist_get_type_and_value(value_value_node, &value_value_type, (void *) (&value_value), &valval_length); 419 value->data = value_value;
419 420 value->size = strlen(value_value);
420 value->data = value_value; 421 ret = IPHONE_E_SUCCESS;
421 value->size = valval_length; 422 }
422 ret = IPHONE_E_SUCCESS;
423 } 423 }
424 free(result_key); 424 free(result_key);
425 } 425 }
@@ -825,7 +825,7 @@ iphone_error_t lockdownd_start_SSL_session(iphone_lckd_client_t control, const c
825 if (!dict) 825 if (!dict)
826 return IPHONE_E_PLIST_ERROR; 826 return IPHONE_E_PLIST_ERROR;
827 827
828 plist_t query_node = plist_find_node(dict, PLIST_STRING, "StartSession", strlen("StartSession")); 828 plist_t query_node = plist_find_node_by_string(dict, "StartSession");
829 plist_t result_key_node = plist_get_next_sibling(query_node); 829 plist_t result_key_node = plist_get_next_sibling(query_node);
830 plist_t result_value_node = plist_get_next_sibling(result_key_node); 830 plist_t result_value_node = plist_get_next_sibling(result_key_node);
831 831