diff options
| -rw-r--r-- | common/userpref.c | 4 | ||||
| -rw-r--r-- | configure.ac | 2 | ||||
| -rw-r--r-- | dev/ideviceheartbeat.c | 2 | ||||
| -rw-r--r-- | src/diagnostics_relay.c | 28 | ||||
| -rw-r--r-- | src/file_relay.c | 2 | ||||
| -rw-r--r-- | src/house_arrest.c | 4 | ||||
| -rw-r--r-- | src/installation_proxy.c | 14 | ||||
| -rw-r--r-- | src/lockdown.c | 78 | ||||
| -rw-r--r-- | src/misagent.c | 16 | ||||
| -rw-r--r-- | src/mobile_image_mounter.c | 20 | ||||
| -rw-r--r-- | src/mobilebackup.c | 24 | ||||
| -rw-r--r-- | src/mobilebackup2.c | 14 | ||||
| -rw-r--r-- | src/mobilesync.c | 4 | ||||
| -rw-r--r-- | src/notification_proxy.c | 10 | ||||
| -rw-r--r-- | src/restore.c | 18 | ||||
| -rw-r--r-- | src/sbservices.c | 16 | ||||
| -rw-r--r-- | src/screenshotr.c | 2 | ||||
| -rw-r--r-- | src/webinspector.c | 4 | ||||
| -rw-r--r-- | tools/idevicebackup.c | 48 | ||||
| -rw-r--r-- | tools/idevicebackup2.c | 76 |
20 files changed, 193 insertions, 193 deletions
diff --git a/common/userpref.c b/common/userpref.c index cd8b229..c192c1d 100644 --- a/common/userpref.c +++ b/common/userpref.c | |||
| @@ -252,13 +252,13 @@ static int internal_set_value(const char *config_file, const char *key, plist_t | |||
| 252 | plist_read_from_filename(&config, config_file); | 252 | plist_read_from_filename(&config, config_file); |
| 253 | if (!config) { | 253 | if (!config) { |
| 254 | config = plist_new_dict(); | 254 | config = plist_new_dict(); |
| 255 | plist_dict_insert_item(config, key, value); | 255 | plist_dict_set_item(config, key, value); |
| 256 | } else { | 256 | } else { |
| 257 | plist_t n = plist_dict_get_item(config, key); | 257 | plist_t n = plist_dict_get_item(config, key); |
| 258 | if (n) { | 258 | if (n) { |
| 259 | plist_dict_remove_item(config, key); | 259 | plist_dict_remove_item(config, key); |
| 260 | } | 260 | } |
| 261 | plist_dict_insert_item(config, key, value); | 261 | plist_dict_set_item(config, key, value); |
| 262 | remove(config_file); | 262 | remove(config_file); |
| 263 | } | 263 | } |
| 264 | 264 | ||
diff --git a/configure.ac b/configure.ac index 5711659..8d081aa 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -18,7 +18,7 @@ dnl libtool versioning | |||
| 18 | LIBIMOBILEDEVICE_SO_VERSION=4:1:0 | 18 | LIBIMOBILEDEVICE_SO_VERSION=4:1:0 |
| 19 | 19 | ||
| 20 | dnl Minimum package versions | 20 | dnl Minimum package versions |
| 21 | LIBPLIST_VERSION=1.8 | 21 | LIBPLIST_VERSION=1.11 |
| 22 | LIBUSBMUXD_VERSION=1.0.8 | 22 | LIBUSBMUXD_VERSION=1.0.8 |
| 23 | LIBPLISTMM_VERSION=1.8 | 23 | LIBPLISTMM_VERSION=1.8 |
| 24 | 24 | ||
diff --git a/dev/ideviceheartbeat.c b/dev/ideviceheartbeat.c index d108766..fe2cdf3 100644 --- a/dev/ideviceheartbeat.c +++ b/dev/ideviceheartbeat.c | |||
| @@ -136,7 +136,7 @@ int main(int argc, char *argv[]) | |||
| 136 | 136 | ||
| 137 | /* answer with a "pong" message */ | 137 | /* answer with a "pong" message */ |
| 138 | message = plist_new_dict(); | 138 | message = plist_new_dict(); |
| 139 | plist_dict_insert_item(message, "Command", plist_new_string("Polo")); | 139 | plist_dict_set_item(message, "Command", plist_new_string("Polo")); |
| 140 | heartbeat_send(heartbeat, message); | 140 | heartbeat_send(heartbeat, message); |
| 141 | 141 | ||
| 142 | printf("< polo\n"); | 142 | printf("< polo\n"); |
diff --git a/src/diagnostics_relay.c b/src/diagnostics_relay.c index 9786f0e..de3781c 100644 --- a/src/diagnostics_relay.c +++ b/src/diagnostics_relay.c | |||
| @@ -216,7 +216,7 @@ diagnostics_relay_error_t diagnostics_relay_goodbye(diagnostics_relay_client_t c | |||
| 216 | diagnostics_relay_error_t ret = DIAGNOSTICS_RELAY_E_UNKNOWN_ERROR; | 216 | diagnostics_relay_error_t ret = DIAGNOSTICS_RELAY_E_UNKNOWN_ERROR; |
| 217 | 217 | ||
| 218 | plist_t dict = plist_new_dict(); | 218 | plist_t dict = plist_new_dict(); |
| 219 | plist_dict_insert_item(dict, "Request", plist_new_string("Goodbye")); | 219 | plist_dict_set_item(dict, "Request", plist_new_string("Goodbye")); |
| 220 | 220 | ||
| 221 | ret = diagnostics_relay_send(client, dict); | 221 | ret = diagnostics_relay_send(client, dict); |
| 222 | plist_free(dict); | 222 | plist_free(dict); |
| @@ -261,7 +261,7 @@ diagnostics_relay_error_t diagnostics_relay_sleep(diagnostics_relay_client_t cli | |||
| 261 | 261 | ||
| 262 | plist_t dict = plist_new_dict(); | 262 | plist_t dict = plist_new_dict(); |
| 263 | 263 | ||
| 264 | plist_dict_insert_item(dict,"Request", plist_new_string("Sleep")); | 264 | plist_dict_set_item(dict,"Request", plist_new_string("Sleep")); |
| 265 | ret = diagnostics_relay_send(client, dict); | 265 | ret = diagnostics_relay_send(client, dict); |
| 266 | plist_free(dict); | 266 | plist_free(dict); |
| 267 | dict = NULL; | 267 | dict = NULL; |
| @@ -292,18 +292,18 @@ static diagnostics_relay_error_t internal_diagnostics_relay_action(diagnostics_r | |||
| 292 | diagnostics_relay_error_t ret = DIAGNOSTICS_RELAY_E_UNKNOWN_ERROR; | 292 | diagnostics_relay_error_t ret = DIAGNOSTICS_RELAY_E_UNKNOWN_ERROR; |
| 293 | 293 | ||
| 294 | plist_t dict = plist_new_dict(); | 294 | plist_t dict = plist_new_dict(); |
| 295 | plist_dict_insert_item(dict,"Request", plist_new_string(name)); | 295 | plist_dict_set_item(dict,"Request", plist_new_string(name)); |
| 296 | 296 | ||
| 297 | if (flags & DIAGNOSTICS_RELAY_ACTION_FLAG_WAIT_FOR_DISCONNECT) { | 297 | if (flags & DIAGNOSTICS_RELAY_ACTION_FLAG_WAIT_FOR_DISCONNECT) { |
| 298 | plist_dict_insert_item(dict, "WaitForDisconnect", plist_new_bool(1)); | 298 | plist_dict_set_item(dict, "WaitForDisconnect", plist_new_bool(1)); |
| 299 | } | 299 | } |
| 300 | 300 | ||
| 301 | if (flags & DIAGNOSTICS_RELAY_ACTION_FLAG_DISPLAY_PASS) { | 301 | if (flags & DIAGNOSTICS_RELAY_ACTION_FLAG_DISPLAY_PASS) { |
| 302 | plist_dict_insert_item(dict, "DisplayPass", plist_new_bool(1)); | 302 | plist_dict_set_item(dict, "DisplayPass", plist_new_bool(1)); |
| 303 | } | 303 | } |
| 304 | 304 | ||
| 305 | if (flags & DIAGNOSTICS_RELAY_ACTION_FLAG_DISPLAY_FAIL) { | 305 | if (flags & DIAGNOSTICS_RELAY_ACTION_FLAG_DISPLAY_FAIL) { |
| 306 | plist_dict_insert_item(dict, "DisplayFail", plist_new_bool(1)); | 306 | plist_dict_set_item(dict, "DisplayFail", plist_new_bool(1)); |
| 307 | } | 307 | } |
| 308 | 308 | ||
| 309 | ret = diagnostics_relay_send(client, dict); | 309 | ret = diagnostics_relay_send(client, dict); |
| @@ -376,7 +376,7 @@ diagnostics_relay_error_t diagnostics_relay_request_diagnostics(diagnostics_rela | |||
| 376 | diagnostics_relay_error_t ret = DIAGNOSTICS_RELAY_E_UNKNOWN_ERROR; | 376 | diagnostics_relay_error_t ret = DIAGNOSTICS_RELAY_E_UNKNOWN_ERROR; |
| 377 | 377 | ||
| 378 | plist_t dict = plist_new_dict(); | 378 | plist_t dict = plist_new_dict(); |
| 379 | plist_dict_insert_item(dict,"Request", plist_new_string(type)); | 379 | plist_dict_set_item(dict,"Request", plist_new_string(type)); |
| 380 | ret = diagnostics_relay_send(client, dict); | 380 | ret = diagnostics_relay_send(client, dict); |
| 381 | plist_free(dict); | 381 | plist_free(dict); |
| 382 | dict = NULL; | 382 | dict = NULL; |
| @@ -417,8 +417,8 @@ diagnostics_relay_error_t diagnostics_relay_query_mobilegestalt(diagnostics_rela | |||
| 417 | diagnostics_relay_error_t ret = DIAGNOSTICS_RELAY_E_UNKNOWN_ERROR; | 417 | diagnostics_relay_error_t ret = DIAGNOSTICS_RELAY_E_UNKNOWN_ERROR; |
| 418 | 418 | ||
| 419 | plist_t dict = plist_new_dict(); | 419 | plist_t dict = plist_new_dict(); |
| 420 | plist_dict_insert_item(dict,"MobileGestaltKeys", plist_copy(keys)); | 420 | plist_dict_set_item(dict,"MobileGestaltKeys", plist_copy(keys)); |
| 421 | plist_dict_insert_item(dict,"Request", plist_new_string("MobileGestalt")); | 421 | plist_dict_set_item(dict,"Request", plist_new_string("MobileGestalt")); |
| 422 | ret = diagnostics_relay_send(client, dict); | 422 | ret = diagnostics_relay_send(client, dict); |
| 423 | plist_free(dict); | 423 | plist_free(dict); |
| 424 | dict = NULL; | 424 | dict = NULL; |
| @@ -460,10 +460,10 @@ diagnostics_relay_error_t diagnostics_relay_query_ioregistry_entry(diagnostics_r | |||
| 460 | 460 | ||
| 461 | plist_t dict = plist_new_dict(); | 461 | plist_t dict = plist_new_dict(); |
| 462 | if (name) | 462 | if (name) |
| 463 | plist_dict_insert_item(dict,"EntryName", plist_new_string(name)); | 463 | plist_dict_set_item(dict,"EntryName", plist_new_string(name)); |
| 464 | if (class) | 464 | if (class) |
| 465 | plist_dict_insert_item(dict,"EntryClass", plist_new_string(class)); | 465 | plist_dict_set_item(dict,"EntryClass", plist_new_string(class)); |
| 466 | plist_dict_insert_item(dict,"Request", plist_new_string("IORegistry")); | 466 | plist_dict_set_item(dict,"Request", plist_new_string("IORegistry")); |
| 467 | ret = diagnostics_relay_send(client, dict); | 467 | ret = diagnostics_relay_send(client, dict); |
| 468 | plist_free(dict); | 468 | plist_free(dict); |
| 469 | dict = NULL; | 469 | dict = NULL; |
| @@ -504,8 +504,8 @@ diagnostics_relay_error_t diagnostics_relay_query_ioregistry_plane(diagnostics_r | |||
| 504 | diagnostics_relay_error_t ret = DIAGNOSTICS_RELAY_E_UNKNOWN_ERROR; | 504 | diagnostics_relay_error_t ret = DIAGNOSTICS_RELAY_E_UNKNOWN_ERROR; |
| 505 | 505 | ||
| 506 | plist_t dict = plist_new_dict(); | 506 | plist_t dict = plist_new_dict(); |
| 507 | plist_dict_insert_item(dict,"CurrentPlane", plist_new_string(plane)); | 507 | plist_dict_set_item(dict,"CurrentPlane", plist_new_string(plane)); |
| 508 | plist_dict_insert_item(dict,"Request", plist_new_string("IORegistry")); | 508 | plist_dict_set_item(dict,"Request", plist_new_string("IORegistry")); |
| 509 | ret = diagnostics_relay_send(client, dict); | 509 | ret = diagnostics_relay_send(client, dict); |
| 510 | plist_free(dict); | 510 | plist_free(dict); |
| 511 | dict = NULL; | 511 | dict = NULL; |
diff --git a/src/file_relay.c b/src/file_relay.c index 3d064b9..fb802a8 100644 --- a/src/file_relay.c +++ b/src/file_relay.c | |||
| @@ -144,7 +144,7 @@ file_relay_error_t file_relay_request_sources_timeout(file_relay_client_t client | |||
| 144 | i++; | 144 | i++; |
| 145 | } | 145 | } |
| 146 | plist_t dict = plist_new_dict(); | 146 | plist_t dict = plist_new_dict(); |
| 147 | plist_dict_insert_item(dict, "Sources", array); | 147 | plist_dict_set_item(dict, "Sources", array); |
| 148 | 148 | ||
| 149 | if (property_list_service_send_xml_plist(client->parent, dict) != PROPERTY_LIST_SERVICE_E_SUCCESS) { | 149 | if (property_list_service_send_xml_plist(client->parent, dict) != PROPERTY_LIST_SERVICE_E_SUCCESS) { |
| 150 | debug_info("ERROR: Could not send request to device!"); | 150 | debug_info("ERROR: Could not send request to device!"); |
diff --git a/src/house_arrest.c b/src/house_arrest.c index 5a23aff..9aaad34 100644 --- a/src/house_arrest.c +++ b/src/house_arrest.c | |||
| @@ -193,8 +193,8 @@ house_arrest_error_t house_arrest_send_command(house_arrest_client_t client, con | |||
| 193 | house_arrest_error_t res = HOUSE_ARREST_E_UNKNOWN_ERROR; | 193 | house_arrest_error_t res = HOUSE_ARREST_E_UNKNOWN_ERROR; |
| 194 | 194 | ||
| 195 | plist_t dict = plist_new_dict(); | 195 | plist_t dict = plist_new_dict(); |
| 196 | plist_dict_insert_item(dict, "Command", plist_new_string(command)); | 196 | plist_dict_set_item(dict, "Command", plist_new_string(command)); |
| 197 | plist_dict_insert_item(dict, "Identifier", plist_new_string(appid)); | 197 | plist_dict_set_item(dict, "Identifier", plist_new_string(appid)); |
| 198 | 198 | ||
| 199 | res = house_arrest_send_request(client, dict); | 199 | res = house_arrest_send_request(client, dict); |
| 200 | 200 | ||
diff --git a/src/installation_proxy.c b/src/installation_proxy.c index f758a14..109df10 100644 --- a/src/installation_proxy.c +++ b/src/installation_proxy.c | |||
| @@ -180,14 +180,14 @@ static instproxy_error_t instproxy_send_command(instproxy_client_t client, const | |||
| 180 | 180 | ||
| 181 | plist_t dict = plist_new_dict(); | 181 | plist_t dict = plist_new_dict(); |
| 182 | if (appid) { | 182 | if (appid) { |
| 183 | plist_dict_insert_item(dict, "ApplicationIdentifier", plist_new_string(appid)); | 183 | plist_dict_set_item(dict, "ApplicationIdentifier", plist_new_string(appid)); |
| 184 | } | 184 | } |
| 185 | if (client_options && (plist_dict_get_size(client_options) > 0)) { | 185 | if (client_options && (plist_dict_get_size(client_options) > 0)) { |
| 186 | plist_dict_insert_item(dict, "ClientOptions", plist_copy(client_options)); | 186 | plist_dict_set_item(dict, "ClientOptions", plist_copy(client_options)); |
| 187 | } | 187 | } |
| 188 | plist_dict_insert_item(dict, "Command", plist_new_string(command)); | 188 | plist_dict_set_item(dict, "Command", plist_new_string(command)); |
| 189 | if (package_path) { | 189 | if (package_path) { |
| 190 | plist_dict_insert_item(dict, "PackagePath", plist_new_string(package_path)); | 190 | plist_dict_set_item(dict, "PackagePath", plist_new_string(package_path)); |
| 191 | } | 191 | } |
| 192 | 192 | ||
| 193 | instproxy_error_t err = instproxy_error(property_list_service_send_xml_plist(client->parent, dict)); | 193 | instproxy_error_t err = instproxy_error(property_list_service_send_xml_plist(client->parent, dict)); |
| @@ -761,21 +761,21 @@ void instproxy_client_options_add(plist_t client_options, ...) | |||
| 761 | char *key = strdup(arg); | 761 | char *key = strdup(arg); |
| 762 | if (!strcmp(key, "SkipUninstall")) { | 762 | if (!strcmp(key, "SkipUninstall")) { |
| 763 | int intval = va_arg(args, int); | 763 | int intval = va_arg(args, int); |
| 764 | plist_dict_insert_item(client_options, key, plist_new_bool(intval)); | 764 | plist_dict_set_item(client_options, key, plist_new_bool(intval)); |
| 765 | } else if (!strcmp(key, "ApplicationSINF") || !strcmp(key, "iTunesMetadata") || !strcmp(key, "ReturnAttributes")) { | 765 | } else if (!strcmp(key, "ApplicationSINF") || !strcmp(key, "iTunesMetadata") || !strcmp(key, "ReturnAttributes")) { |
| 766 | plist_t plistval = va_arg(args, plist_t); | 766 | plist_t plistval = va_arg(args, plist_t); |
| 767 | if (!plistval) { | 767 | if (!plistval) { |
| 768 | free(key); | 768 | free(key); |
| 769 | break; | 769 | break; |
| 770 | } | 770 | } |
| 771 | plist_dict_insert_item(client_options, key, plist_copy(plistval)); | 771 | plist_dict_set_item(client_options, key, plist_copy(plistval)); |
| 772 | } else { | 772 | } else { |
| 773 | char *strval = va_arg(args, char*); | 773 | char *strval = va_arg(args, char*); |
| 774 | if (!strval) { | 774 | if (!strval) { |
| 775 | free(key); | 775 | free(key); |
| 776 | break; | 776 | break; |
| 777 | } | 777 | } |
| 778 | plist_dict_insert_item(client_options, key, plist_new_string(strval)); | 778 | plist_dict_set_item(client_options, key, plist_new_string(strval)); |
| 779 | } | 779 | } |
| 780 | free(key); | 780 | free(key); |
| 781 | arg = va_arg(args, char*); | 781 | arg = va_arg(args, char*); |
diff --git a/src/lockdown.c b/src/lockdown.c index 284840d..e21db30 100644 --- a/src/lockdown.c +++ b/src/lockdown.c | |||
| @@ -158,7 +158,7 @@ static void plist_dict_add_label(plist_t plist, const char *label) | |||
| 158 | { | 158 | { |
| 159 | if (plist && label) { | 159 | if (plist && label) { |
| 160 | if (plist_get_node_type(plist) == PLIST_DICT) | 160 | if (plist_get_node_type(plist) == PLIST_DICT) |
| 161 | plist_dict_insert_item(plist, "Label", plist_new_string(label)); | 161 | plist_dict_set_item(plist, "Label", plist_new_string(label)); |
| 162 | } | 162 | } |
| 163 | } | 163 | } |
| 164 | 164 | ||
| @@ -186,8 +186,8 @@ lockdownd_error_t lockdownd_stop_session(lockdownd_client_t client, const char * | |||
| 186 | 186 | ||
| 187 | plist_t dict = plist_new_dict(); | 187 | plist_t dict = plist_new_dict(); |
| 188 | plist_dict_add_label(dict, client->label); | 188 | plist_dict_add_label(dict, client->label); |
| 189 | plist_dict_insert_item(dict,"Request", plist_new_string("StopSession")); | 189 | plist_dict_set_item(dict,"Request", plist_new_string("StopSession")); |
| 190 | plist_dict_insert_item(dict,"SessionID", plist_new_string(session_id)); | 190 | plist_dict_set_item(dict,"SessionID", plist_new_string(session_id)); |
| 191 | 191 | ||
| 192 | debug_info("stopping session %s", session_id); | 192 | debug_info("stopping session %s", session_id); |
| 193 | 193 | ||
| @@ -368,7 +368,7 @@ lockdownd_error_t lockdownd_query_type(lockdownd_client_t client, char **type) | |||
| 368 | 368 | ||
| 369 | plist_t dict = plist_new_dict(); | 369 | plist_t dict = plist_new_dict(); |
| 370 | plist_dict_add_label(dict, client->label); | 370 | plist_dict_add_label(dict, client->label); |
| 371 | plist_dict_insert_item(dict,"Request", plist_new_string("QueryType")); | 371 | plist_dict_set_item(dict,"Request", plist_new_string("QueryType")); |
| 372 | 372 | ||
| 373 | debug_info("called"); | 373 | debug_info("called"); |
| 374 | ret = lockdownd_send(client, dict); | 374 | ret = lockdownd_send(client, dict); |
| @@ -426,12 +426,12 @@ lockdownd_error_t lockdownd_get_value(lockdownd_client_t client, const char *dom | |||
| 426 | dict = plist_new_dict(); | 426 | dict = plist_new_dict(); |
| 427 | plist_dict_add_label(dict, client->label); | 427 | plist_dict_add_label(dict, client->label); |
| 428 | if (domain) { | 428 | if (domain) { |
| 429 | plist_dict_insert_item(dict,"Domain", plist_new_string(domain)); | 429 | plist_dict_set_item(dict,"Domain", plist_new_string(domain)); |
| 430 | } | 430 | } |
| 431 | if (key) { | 431 | if (key) { |
| 432 | plist_dict_insert_item(dict,"Key", plist_new_string(key)); | 432 | plist_dict_set_item(dict,"Key", plist_new_string(key)); |
| 433 | } | 433 | } |
| 434 | plist_dict_insert_item(dict,"Request", plist_new_string("GetValue")); | 434 | plist_dict_set_item(dict,"Request", plist_new_string("GetValue")); |
| 435 | 435 | ||
| 436 | /* send to device */ | 436 | /* send to device */ |
| 437 | ret = lockdownd_send(client, dict); | 437 | ret = lockdownd_send(client, dict); |
| @@ -490,13 +490,13 @@ lockdownd_error_t lockdownd_set_value(lockdownd_client_t client, const char *dom | |||
| 490 | dict = plist_new_dict(); | 490 | dict = plist_new_dict(); |
| 491 | plist_dict_add_label(dict, client->label); | 491 | plist_dict_add_label(dict, client->label); |
| 492 | if (domain) { | 492 | if (domain) { |
| 493 | plist_dict_insert_item(dict,"Domain", plist_new_string(domain)); | 493 | plist_dict_set_item(dict,"Domain", plist_new_string(domain)); |
| 494 | } | 494 | } |
| 495 | if (key) { | 495 | if (key) { |
| 496 | plist_dict_insert_item(dict,"Key", plist_new_string(key)); | 496 | plist_dict_set_item(dict,"Key", plist_new_string(key)); |
| 497 | } | 497 | } |
| 498 | plist_dict_insert_item(dict,"Request", plist_new_string("SetValue")); | 498 | plist_dict_set_item(dict,"Request", plist_new_string("SetValue")); |
| 499 | plist_dict_insert_item(dict,"Value", value); | 499 | plist_dict_set_item(dict,"Value", value); |
| 500 | 500 | ||
| 501 | /* send to device */ | 501 | /* send to device */ |
| 502 | ret = lockdownd_send(client, dict); | 502 | ret = lockdownd_send(client, dict); |
| @@ -549,12 +549,12 @@ lockdownd_error_t lockdownd_remove_value(lockdownd_client_t client, const char * | |||
| 549 | dict = plist_new_dict(); | 549 | dict = plist_new_dict(); |
| 550 | plist_dict_add_label(dict, client->label); | 550 | plist_dict_add_label(dict, client->label); |
| 551 | if (domain) { | 551 | if (domain) { |
| 552 | plist_dict_insert_item(dict,"Domain", plist_new_string(domain)); | 552 | plist_dict_set_item(dict,"Domain", plist_new_string(domain)); |
| 553 | } | 553 | } |
| 554 | if (key) { | 554 | if (key) { |
| 555 | plist_dict_insert_item(dict,"Key", plist_new_string(key)); | 555 | plist_dict_set_item(dict,"Key", plist_new_string(key)); |
| 556 | } | 556 | } |
| 557 | plist_dict_insert_item(dict,"Request", plist_new_string("RemoveValue")); | 557 | plist_dict_set_item(dict,"Request", plist_new_string("RemoveValue")); |
| 558 | 558 | ||
| 559 | /* send to device */ | 559 | /* send to device */ |
| 560 | ret = lockdownd_send(client, dict); | 560 | ret = lockdownd_send(client, dict); |
| @@ -818,11 +818,11 @@ static plist_t lockdownd_pair_record_to_plist(lockdownd_pair_record_t pair_recor | |||
| 818 | 818 | ||
| 819 | /* setup request plist */ | 819 | /* setup request plist */ |
| 820 | plist_t dict = plist_new_dict(); | 820 | plist_t dict = plist_new_dict(); |
| 821 | plist_dict_insert_item(dict, "DeviceCertificate", plist_new_data(pair_record->device_certificate, strlen(pair_record->device_certificate))); | 821 | plist_dict_set_item(dict, "DeviceCertificate", plist_new_data(pair_record->device_certificate, strlen(pair_record->device_certificate))); |
| 822 | plist_dict_insert_item(dict, "HostCertificate", plist_new_data(pair_record->host_certificate, strlen(pair_record->host_certificate))); | 822 | plist_dict_set_item(dict, "HostCertificate", plist_new_data(pair_record->host_certificate, strlen(pair_record->host_certificate))); |
| 823 | plist_dict_insert_item(dict, "HostID", plist_new_string(pair_record->host_id)); | 823 | plist_dict_set_item(dict, "HostID", plist_new_string(pair_record->host_id)); |
| 824 | plist_dict_insert_item(dict, "RootCertificate", plist_new_data(pair_record->root_certificate, strlen(pair_record->root_certificate))); | 824 | plist_dict_set_item(dict, "RootCertificate", plist_new_data(pair_record->root_certificate, strlen(pair_record->root_certificate))); |
| 825 | plist_dict_insert_item(dict, "SystemBUID", plist_new_string(pair_record->system_buid)); | 825 | plist_dict_set_item(dict, "SystemBUID", plist_new_string(pair_record->system_buid)); |
| 826 | 826 | ||
| 827 | return dict; | 827 | return dict; |
| 828 | } | 828 | } |
| @@ -878,11 +878,11 @@ static lockdownd_error_t generate_pair_record_plist(lockdownd_client_t client, p | |||
| 878 | 878 | ||
| 879 | /* setup request plist */ | 879 | /* setup request plist */ |
| 880 | *pair_record_plist = plist_new_dict(); | 880 | *pair_record_plist = plist_new_dict(); |
| 881 | plist_dict_insert_item(*pair_record_plist, "DeviceCertificate", plist_new_data((const char*)device_cert.data, device_cert.size)); | 881 | plist_dict_set_item(*pair_record_plist, "DeviceCertificate", plist_new_data((const char*)device_cert.data, device_cert.size)); |
| 882 | plist_dict_insert_item(*pair_record_plist, "HostCertificate", plist_new_data((const char*)host_cert.data, host_cert.size)); | 882 | plist_dict_set_item(*pair_record_plist, "HostCertificate", plist_new_data((const char*)host_cert.data, host_cert.size)); |
| 883 | plist_dict_insert_item(*pair_record_plist, "HostID", plist_new_string(host_id)); | 883 | plist_dict_set_item(*pair_record_plist, "HostID", plist_new_string(host_id)); |
| 884 | plist_dict_insert_item(*pair_record_plist, "RootCertificate", plist_new_data((const char*)root_cert.data, root_cert.size)); | 884 | plist_dict_set_item(*pair_record_plist, "RootCertificate", plist_new_data((const char*)root_cert.data, root_cert.size)); |
| 885 | plist_dict_insert_item(*pair_record_plist, "SystemBUID", plist_new_string(system_buid)); | 885 | plist_dict_set_item(*pair_record_plist, "SystemBUID", plist_new_string(system_buid)); |
| 886 | 886 | ||
| 887 | leave: | 887 | leave: |
| 888 | if (host_id) | 888 | if (host_id) |
| @@ -962,13 +962,13 @@ static lockdownd_error_t lockdownd_do_pair(lockdownd_client_t client, lockdownd_ | |||
| 962 | /* setup pair request plist */ | 962 | /* setup pair request plist */ |
| 963 | dict = plist_new_dict(); | 963 | dict = plist_new_dict(); |
| 964 | plist_dict_add_label(dict, client->label); | 964 | plist_dict_add_label(dict, client->label); |
| 965 | plist_dict_insert_item(dict, "PairRecord", plist_copy(dict_record)); | 965 | plist_dict_set_item(dict, "PairRecord", plist_copy(dict_record)); |
| 966 | plist_dict_insert_item(dict, "Request", plist_new_string(verb)); | 966 | plist_dict_set_item(dict, "Request", plist_new_string(verb)); |
| 967 | plist_dict_insert_item(dict, "ProtocolVersion", plist_new_string(LOCKDOWN_PROTOCOL_VERSION)); | 967 | plist_dict_set_item(dict, "ProtocolVersion", plist_new_string(LOCKDOWN_PROTOCOL_VERSION)); |
| 968 | 968 | ||
| 969 | plist_t options = plist_new_dict(); | 969 | plist_t options = plist_new_dict(); |
| 970 | plist_dict_insert_item(options, "ExtendedPairingErrors", plist_new_bool(1)); | 970 | plist_dict_set_item(options, "ExtendedPairingErrors", plist_new_bool(1)); |
| 971 | plist_dict_insert_item(dict, "PairingOptions", options); | 971 | plist_dict_set_item(dict, "PairingOptions", options); |
| 972 | 972 | ||
| 973 | /* send to device */ | 973 | /* send to device */ |
| 974 | ret = lockdownd_send(client, dict); | 974 | ret = lockdownd_send(client, dict); |
| @@ -1144,7 +1144,7 @@ lockdownd_error_t lockdownd_enter_recovery(lockdownd_client_t client) | |||
| 1144 | 1144 | ||
| 1145 | plist_t dict = plist_new_dict(); | 1145 | plist_t dict = plist_new_dict(); |
| 1146 | plist_dict_add_label(dict, client->label); | 1146 | plist_dict_add_label(dict, client->label); |
| 1147 | plist_dict_insert_item(dict,"Request", plist_new_string("EnterRecovery")); | 1147 | plist_dict_set_item(dict,"Request", plist_new_string("EnterRecovery")); |
| 1148 | 1148 | ||
| 1149 | debug_info("telling device to enter recovery mode"); | 1149 | debug_info("telling device to enter recovery mode"); |
| 1150 | 1150 | ||
| @@ -1181,7 +1181,7 @@ lockdownd_error_t lockdownd_goodbye(lockdownd_client_t client) | |||
| 1181 | 1181 | ||
| 1182 | plist_t dict = plist_new_dict(); | 1182 | plist_t dict = plist_new_dict(); |
| 1183 | plist_dict_add_label(dict, client->label); | 1183 | plist_dict_add_label(dict, client->label); |
| 1184 | plist_dict_insert_item(dict,"Request", plist_new_string("Goodbye")); | 1184 | plist_dict_set_item(dict,"Request", plist_new_string("Goodbye")); |
| 1185 | 1185 | ||
| 1186 | debug_info("called"); | 1186 | debug_info("called"); |
| 1187 | 1187 | ||
| @@ -1560,18 +1560,18 @@ lockdownd_error_t lockdownd_start_session(lockdownd_client_t client, const char | |||
| 1560 | /* setup request plist */ | 1560 | /* setup request plist */ |
| 1561 | dict = plist_new_dict(); | 1561 | dict = plist_new_dict(); |
| 1562 | plist_dict_add_label(dict, client->label); | 1562 | plist_dict_add_label(dict, client->label); |
| 1563 | plist_dict_insert_item(dict,"Request", plist_new_string("StartSession")); | 1563 | plist_dict_set_item(dict,"Request", plist_new_string("StartSession")); |
| 1564 | 1564 | ||
| 1565 | /* add host id */ | 1565 | /* add host id */ |
| 1566 | if (host_id) { | 1566 | if (host_id) { |
| 1567 | plist_dict_insert_item(dict, "HostID", plist_new_string(host_id)); | 1567 | plist_dict_set_item(dict, "HostID", plist_new_string(host_id)); |
| 1568 | } | 1568 | } |
| 1569 | 1569 | ||
| 1570 | /* add system buid */ | 1570 | /* add system buid */ |
| 1571 | char *system_buid = NULL; | 1571 | char *system_buid = NULL; |
| 1572 | userpref_get_system_buid(&system_buid); | 1572 | userpref_get_system_buid(&system_buid); |
| 1573 | if (system_buid) { | 1573 | if (system_buid) { |
| 1574 | plist_dict_insert_item(dict, "SystemBUID", plist_new_string(system_buid)); | 1574 | plist_dict_set_item(dict, "SystemBUID", plist_new_string(system_buid)); |
| 1575 | if (system_buid) { | 1575 | if (system_buid) { |
| 1576 | free(system_buid); | 1576 | free(system_buid); |
| 1577 | system_buid = NULL; | 1577 | system_buid = NULL; |
| @@ -1685,8 +1685,8 @@ lockdownd_error_t lockdownd_start_service(lockdownd_client_t client, const char | |||
| 1685 | 1685 | ||
| 1686 | dict = plist_new_dict(); | 1686 | dict = plist_new_dict(); |
| 1687 | plist_dict_add_label(dict, client->label); | 1687 | plist_dict_add_label(dict, client->label); |
| 1688 | plist_dict_insert_item(dict,"Request", plist_new_string("StartService")); | 1688 | plist_dict_set_item(dict,"Request", plist_new_string("StartService")); |
| 1689 | plist_dict_insert_item(dict,"Service", plist_new_string(identifier)); | 1689 | plist_dict_set_item(dict,"Service", plist_new_string(identifier)); |
| 1690 | 1690 | ||
| 1691 | /* send to device */ | 1691 | /* send to device */ |
| 1692 | ret = lockdownd_send(client, dict); | 1692 | ret = lockdownd_send(client, dict); |
| @@ -1785,8 +1785,8 @@ lockdownd_error_t lockdownd_activate(lockdownd_client_t client, plist_t activati | |||
| 1785 | 1785 | ||
| 1786 | plist_t dict = plist_new_dict(); | 1786 | plist_t dict = plist_new_dict(); |
| 1787 | plist_dict_add_label(dict, client->label); | 1787 | plist_dict_add_label(dict, client->label); |
| 1788 | plist_dict_insert_item(dict,"Request", plist_new_string("Activate")); | 1788 | plist_dict_set_item(dict,"Request", plist_new_string("Activate")); |
| 1789 | plist_dict_insert_item(dict,"ActivationRecord", plist_copy(activation_record)); | 1789 | plist_dict_set_item(dict,"ActivationRecord", plist_copy(activation_record)); |
| 1790 | 1790 | ||
| 1791 | ret = lockdownd_send(client, dict); | 1791 | ret = lockdownd_send(client, dict); |
| 1792 | plist_free(dict); | 1792 | plist_free(dict); |
| @@ -1843,7 +1843,7 @@ lockdownd_error_t lockdownd_deactivate(lockdownd_client_t client) | |||
| 1843 | 1843 | ||
| 1844 | plist_t dict = plist_new_dict(); | 1844 | plist_t dict = plist_new_dict(); |
| 1845 | plist_dict_add_label(dict, client->label); | 1845 | plist_dict_add_label(dict, client->label); |
| 1846 | plist_dict_insert_item(dict,"Request", plist_new_string("Deactivate")); | 1846 | plist_dict_set_item(dict,"Request", plist_new_string("Deactivate")); |
| 1847 | 1847 | ||
| 1848 | ret = lockdownd_send(client, dict); | 1848 | ret = lockdownd_send(client, dict); |
| 1849 | plist_free(dict); | 1849 | plist_free(dict); |
diff --git a/src/misagent.c b/src/misagent.c index a9bf89b..6edbadd 100644 --- a/src/misagent.c +++ b/src/misagent.c | |||
| @@ -176,9 +176,9 @@ misagent_error_t misagent_install(misagent_client_t client, plist_t profile) | |||
| 176 | client->last_error = MISAGENT_E_UNKNOWN_ERROR; | 176 | client->last_error = MISAGENT_E_UNKNOWN_ERROR; |
| 177 | 177 | ||
| 178 | plist_t dict = plist_new_dict(); | 178 | plist_t dict = plist_new_dict(); |
| 179 | plist_dict_insert_item(dict, "MessageType", plist_new_string("Install")); | 179 | plist_dict_set_item(dict, "MessageType", plist_new_string("Install")); |
| 180 | plist_dict_insert_item(dict, "Profile", plist_copy(profile)); | 180 | plist_dict_set_item(dict, "Profile", plist_copy(profile)); |
| 181 | plist_dict_insert_item(dict, "ProfileType", plist_new_string("Provisioning")); | 181 | plist_dict_set_item(dict, "ProfileType", plist_new_string("Provisioning")); |
| 182 | 182 | ||
| 183 | misagent_error_t res = misagent_error(property_list_service_send_xml_plist(client->parent, dict)); | 183 | misagent_error_t res = misagent_error(property_list_service_send_xml_plist(client->parent, dict)); |
| 184 | plist_free(dict); | 184 | plist_free(dict); |
| @@ -227,8 +227,8 @@ misagent_error_t misagent_copy(misagent_client_t client, plist_t* profiles) | |||
| 227 | client->last_error = MISAGENT_E_UNKNOWN_ERROR; | 227 | client->last_error = MISAGENT_E_UNKNOWN_ERROR; |
| 228 | 228 | ||
| 229 | plist_t dict = plist_new_dict(); | 229 | plist_t dict = plist_new_dict(); |
| 230 | plist_dict_insert_item(dict, "MessageType", plist_new_string("Copy")); | 230 | plist_dict_set_item(dict, "MessageType", plist_new_string("Copy")); |
| 231 | plist_dict_insert_item(dict, "ProfileType", plist_new_string("Provisioning")); | 231 | plist_dict_set_item(dict, "ProfileType", plist_new_string("Provisioning")); |
| 232 | 232 | ||
| 233 | misagent_error_t res = misagent_error(property_list_service_send_xml_plist(client->parent, dict)); | 233 | misagent_error_t res = misagent_error(property_list_service_send_xml_plist(client->parent, dict)); |
| 234 | plist_free(dict); | 234 | plist_free(dict); |
| @@ -278,9 +278,9 @@ misagent_error_t misagent_remove(misagent_client_t client, const char* profileID | |||
| 278 | client->last_error = MISAGENT_E_UNKNOWN_ERROR; | 278 | client->last_error = MISAGENT_E_UNKNOWN_ERROR; |
| 279 | 279 | ||
| 280 | plist_t dict = plist_new_dict(); | 280 | plist_t dict = plist_new_dict(); |
| 281 | plist_dict_insert_item(dict, "MessageType", plist_new_string("Remove")); | 281 | plist_dict_set_item(dict, "MessageType", plist_new_string("Remove")); |
| 282 | plist_dict_insert_item(dict, "ProfileID", plist_new_string(profileID)); | 282 | plist_dict_set_item(dict, "ProfileID", plist_new_string(profileID)); |
| 283 | plist_dict_insert_item(dict, "ProfileType", plist_new_string("Provisioning")); | 283 | plist_dict_set_item(dict, "ProfileType", plist_new_string("Provisioning")); |
| 284 | 284 | ||
| 285 | misagent_error_t res = misagent_error(property_list_service_send_xml_plist(client->parent, dict)); | 285 | misagent_error_t res = misagent_error(property_list_service_send_xml_plist(client->parent, dict)); |
| 286 | plist_free(dict); | 286 | plist_free(dict); |
diff --git a/src/mobile_image_mounter.c b/src/mobile_image_mounter.c index 9e6d8e9..4b2818d 100644 --- a/src/mobile_image_mounter.c +++ b/src/mobile_image_mounter.c | |||
| @@ -168,8 +168,8 @@ mobile_image_mounter_error_t mobile_image_mounter_lookup_image(mobile_image_moun | |||
| 168 | mobile_image_mounter_lock(client); | 168 | mobile_image_mounter_lock(client); |
| 169 | 169 | ||
| 170 | plist_t dict = plist_new_dict(); | 170 | plist_t dict = plist_new_dict(); |
| 171 | plist_dict_insert_item(dict,"Command", plist_new_string("LookupImage")); | 171 | plist_dict_set_item(dict,"Command", plist_new_string("LookupImage")); |
| 172 | plist_dict_insert_item(dict,"ImageType", plist_new_string(image_type)); | 172 | plist_dict_set_item(dict,"ImageType", plist_new_string(image_type)); |
| 173 | 173 | ||
| 174 | mobile_image_mounter_error_t res = mobile_image_mounter_error(property_list_service_send_xml_plist(client->parent, dict)); | 174 | mobile_image_mounter_error_t res = mobile_image_mounter_error(property_list_service_send_xml_plist(client->parent, dict)); |
| 175 | plist_free(dict); | 175 | plist_free(dict); |
| @@ -211,9 +211,9 @@ mobile_image_mounter_error_t mobile_image_mounter_upload_image(mobile_image_moun | |||
| 211 | plist_t result = NULL; | 211 | plist_t result = NULL; |
| 212 | 212 | ||
| 213 | plist_t dict = plist_new_dict(); | 213 | plist_t dict = plist_new_dict(); |
| 214 | plist_dict_insert_item(dict, "Command", plist_new_string("ReceiveBytes")); | 214 | plist_dict_set_item(dict, "Command", plist_new_string("ReceiveBytes")); |
| 215 | plist_dict_insert_item(dict, "ImageSize", plist_new_uint(image_size)); | 215 | plist_dict_set_item(dict, "ImageSize", plist_new_uint(image_size)); |
| 216 | plist_dict_insert_item(dict, "ImageType", plist_new_string(image_type)); | 216 | plist_dict_set_item(dict, "ImageType", plist_new_string(image_type)); |
| 217 | 217 | ||
| 218 | mobile_image_mounter_error_t res = mobile_image_mounter_error(property_list_service_send_xml_plist(client->parent, dict)); | 218 | mobile_image_mounter_error_t res = mobile_image_mounter_error(property_list_service_send_xml_plist(client->parent, dict)); |
| 219 | plist_free(dict); | 219 | plist_free(dict); |
| @@ -340,10 +340,10 @@ mobile_image_mounter_error_t mobile_image_mounter_mount_image(mobile_image_mount | |||
| 340 | mobile_image_mounter_lock(client); | 340 | mobile_image_mounter_lock(client); |
| 341 | 341 | ||
| 342 | plist_t dict = plist_new_dict(); | 342 | plist_t dict = plist_new_dict(); |
| 343 | plist_dict_insert_item(dict, "Command", plist_new_string("MountImage")); | 343 | plist_dict_set_item(dict, "Command", plist_new_string("MountImage")); |
| 344 | plist_dict_insert_item(dict, "ImagePath", plist_new_string(image_path)); | 344 | plist_dict_set_item(dict, "ImagePath", plist_new_string(image_path)); |
| 345 | plist_dict_insert_item(dict, "ImageSignature", plist_new_data(image_signature, signature_length)); | 345 | plist_dict_set_item(dict, "ImageSignature", plist_new_data(image_signature, signature_length)); |
| 346 | plist_dict_insert_item(dict, "ImageType", plist_new_string(image_type)); | 346 | plist_dict_set_item(dict, "ImageType", plist_new_string(image_type)); |
| 347 | 347 | ||
| 348 | mobile_image_mounter_error_t res = mobile_image_mounter_error(property_list_service_send_xml_plist(client->parent, dict)); | 348 | mobile_image_mounter_error_t res = mobile_image_mounter_error(property_list_service_send_xml_plist(client->parent, dict)); |
| 349 | plist_free(dict); | 349 | plist_free(dict); |
| @@ -382,7 +382,7 @@ mobile_image_mounter_error_t mobile_image_mounter_hangup(mobile_image_mounter_cl | |||
| 382 | mobile_image_mounter_lock(client); | 382 | mobile_image_mounter_lock(client); |
| 383 | 383 | ||
| 384 | plist_t dict = plist_new_dict(); | 384 | plist_t dict = plist_new_dict(); |
| 385 | plist_dict_insert_item(dict, "Command", plist_new_string("Hangup")); | 385 | plist_dict_set_item(dict, "Command", plist_new_string("Hangup")); |
| 386 | 386 | ||
| 387 | mobile_image_mounter_error_t res = mobile_image_mounter_error(property_list_service_send_xml_plist(client->parent, dict)); | 387 | mobile_image_mounter_error_t res = mobile_image_mounter_error(property_list_service_send_xml_plist(client->parent, dict)); |
| 388 | plist_free(dict); | 388 | plist_free(dict); |
diff --git a/src/mobilebackup.c b/src/mobilebackup.c index c53a2cb..66e590a 100644 --- a/src/mobilebackup.c +++ b/src/mobilebackup.c | |||
| @@ -205,7 +205,7 @@ static mobilebackup_error_t mobilebackup_send_message(mobilebackup_client_t clie | |||
| 205 | } else { | 205 | } else { |
| 206 | dict = plist_new_dict(); | 206 | dict = plist_new_dict(); |
| 207 | } | 207 | } |
| 208 | plist_dict_insert_item(dict, "BackupMessageTypeKey", plist_new_string(message)); | 208 | plist_dict_set_item(dict, "BackupMessageTypeKey", plist_new_string(message)); |
| 209 | 209 | ||
| 210 | /* send it as DLMessageProcessMessage */ | 210 | /* send it as DLMessageProcessMessage */ |
| 211 | err = mobilebackup_error(device_link_service_send_process_message(client->parent, dict)); | 211 | err = mobilebackup_error(device_link_service_send_process_message(client->parent, dict)); |
| @@ -315,10 +315,10 @@ mobilebackup_error_t mobilebackup_request_backup(mobilebackup_client_t client, p | |||
| 315 | /* construct request plist */ | 315 | /* construct request plist */ |
| 316 | plist_t dict = plist_new_dict(); | 316 | plist_t dict = plist_new_dict(); |
| 317 | if (backup_manifest) | 317 | if (backup_manifest) |
| 318 | plist_dict_insert_item(dict, "BackupManifestKey", plist_copy(backup_manifest)); | 318 | plist_dict_set_item(dict, "BackupManifestKey", plist_copy(backup_manifest)); |
| 319 | plist_dict_insert_item(dict, "BackupComputerBasePathKey", plist_new_string(base_path)); | 319 | plist_dict_set_item(dict, "BackupComputerBasePathKey", plist_new_string(base_path)); |
| 320 | plist_dict_insert_item(dict, "BackupMessageTypeKey", plist_new_string("BackupMessageBackupRequest")); | 320 | plist_dict_set_item(dict, "BackupMessageTypeKey", plist_new_string("BackupMessageBackupRequest")); |
| 321 | plist_dict_insert_item(dict, "BackupProtocolVersion", plist_new_string(proto_version)); | 321 | plist_dict_set_item(dict, "BackupProtocolVersion", plist_new_string(proto_version)); |
| 322 | 322 | ||
| 323 | /* send request */ | 323 | /* send request */ |
| 324 | err = mobilebackup_send_message(client, NULL, dict); | 324 | err = mobilebackup_send_message(client, NULL, dict); |
| @@ -409,13 +409,13 @@ mobilebackup_error_t mobilebackup_request_restore(mobilebackup_client_t client, | |||
| 409 | 409 | ||
| 410 | /* construct request plist */ | 410 | /* construct request plist */ |
| 411 | plist_t dict = plist_new_dict(); | 411 | plist_t dict = plist_new_dict(); |
| 412 | plist_dict_insert_item(dict, "BackupManifestKey", plist_copy(backup_manifest)); | 412 | plist_dict_set_item(dict, "BackupManifestKey", plist_copy(backup_manifest)); |
| 413 | plist_dict_insert_item(dict, "BackupMessageTypeKey", plist_new_string("kBackupMessageRestoreRequest")); | 413 | plist_dict_set_item(dict, "BackupMessageTypeKey", plist_new_string("kBackupMessageRestoreRequest")); |
| 414 | plist_dict_insert_item(dict, "BackupProtocolVersion", plist_new_string(proto_version)); | 414 | plist_dict_set_item(dict, "BackupProtocolVersion", plist_new_string(proto_version)); |
| 415 | /* add flags */ | 415 | /* add flags */ |
| 416 | plist_dict_insert_item(dict, "BackupNotifySpringBoard", plist_new_bool(IS_FLAG_SET(flags, MB_RESTORE_NOTIFY_SPRINGBOARD))); | 416 | plist_dict_set_item(dict, "BackupNotifySpringBoard", plist_new_bool(IS_FLAG_SET(flags, MB_RESTORE_NOTIFY_SPRINGBOARD))); |
| 417 | plist_dict_insert_item(dict, "BackupPreserveSettings", plist_new_bool(IS_FLAG_SET(flags, MB_RESTORE_PRESERVE_SETTINGS))); | 417 | plist_dict_set_item(dict, "BackupPreserveSettings", plist_new_bool(IS_FLAG_SET(flags, MB_RESTORE_PRESERVE_SETTINGS))); |
| 418 | plist_dict_insert_item(dict, "BackupPreserveCameraRoll", plist_new_bool(IS_FLAG_SET(flags, MB_RESTORE_PRESERVE_CAMERA_ROLL))); | 418 | plist_dict_set_item(dict, "BackupPreserveCameraRoll", plist_new_bool(IS_FLAG_SET(flags, MB_RESTORE_PRESERVE_CAMERA_ROLL))); |
| 419 | 419 | ||
| 420 | /* send request */ | 420 | /* send request */ |
| 421 | err = mobilebackup_send_message(client, NULL, dict); | 421 | err = mobilebackup_send_message(client, NULL, dict); |
| @@ -572,7 +572,7 @@ mobilebackup_error_t mobilebackup_send_error(mobilebackup_client_t client, const | |||
| 572 | 572 | ||
| 573 | /* construct error plist */ | 573 | /* construct error plist */ |
| 574 | plist_t dict = plist_new_dict(); | 574 | plist_t dict = plist_new_dict(); |
| 575 | plist_dict_insert_item(dict, "BackupErrorReasonKey", plist_new_string(reason)); | 575 | plist_dict_set_item(dict, "BackupErrorReasonKey", plist_new_string(reason)); |
| 576 | 576 | ||
| 577 | err = mobilebackup_send_message(client, "BackupMessageError", dict); | 577 | err = mobilebackup_send_message(client, "BackupMessageError", dict); |
| 578 | plist_free(dict); | 578 | plist_free(dict); |
diff --git a/src/mobilebackup2.c b/src/mobilebackup2.c index 350fa3e..09b156d 100644 --- a/src/mobilebackup2.c +++ b/src/mobilebackup2.c | |||
| @@ -173,7 +173,7 @@ mobilebackup2_error_t mobilebackup2_send_message(mobilebackup2_client_t client, | |||
| 173 | } else { | 173 | } else { |
| 174 | dict = plist_new_dict(); | 174 | dict = plist_new_dict(); |
| 175 | } | 175 | } |
| 176 | plist_dict_insert_item(dict, "MessageName", plist_new_string(message)); | 176 | plist_dict_set_item(dict, "MessageName", plist_new_string(message)); |
| 177 | 177 | ||
| 178 | /* send it as DLMessageProcessMessage */ | 178 | /* send it as DLMessageProcessMessage */ |
| 179 | err = mobilebackup2_error(device_link_service_send_process_message(client->parent, dict)); | 179 | err = mobilebackup2_error(device_link_service_send_process_message(client->parent, dict)); |
| @@ -386,7 +386,7 @@ mobilebackup2_error_t mobilebackup2_version_exchange(mobilebackup2_client_t clie | |||
| 386 | for (i = 0; i < count; i++) { | 386 | for (i = 0; i < count; i++) { |
| 387 | plist_array_append_item(array, plist_new_real(local_versions[i])); | 387 | plist_array_append_item(array, plist_new_real(local_versions[i])); |
| 388 | } | 388 | } |
| 389 | plist_dict_insert_item(dict, "SupportedProtocolVersions", array); | 389 | plist_dict_set_item(dict, "SupportedProtocolVersions", array); |
| 390 | 390 | ||
| 391 | mobilebackup2_error_t err = mobilebackup2_send_message(client, "Hello", dict); | 391 | mobilebackup2_error_t err = mobilebackup2_send_message(client, "Hello", dict); |
| 392 | plist_free(dict); | 392 | plist_free(dict); |
| @@ -451,23 +451,23 @@ mobilebackup2_error_t mobilebackup2_send_request(mobilebackup2_client_t client, | |||
| 451 | return MOBILEBACKUP2_E_INVALID_ARG; | 451 | return MOBILEBACKUP2_E_INVALID_ARG; |
| 452 | 452 | ||
| 453 | plist_t dict = plist_new_dict(); | 453 | plist_t dict = plist_new_dict(); |
| 454 | plist_dict_insert_item(dict, "TargetIdentifier", plist_new_string(target_identifier)); | 454 | plist_dict_set_item(dict, "TargetIdentifier", plist_new_string(target_identifier)); |
| 455 | if (source_identifier) { | 455 | if (source_identifier) { |
| 456 | plist_dict_insert_item(dict, "SourceIdentifier", plist_new_string(source_identifier)); | 456 | plist_dict_set_item(dict, "SourceIdentifier", plist_new_string(source_identifier)); |
| 457 | } | 457 | } |
| 458 | if (options) { | 458 | if (options) { |
| 459 | plist_dict_insert_item(dict, "Options", plist_copy(options)); | 459 | plist_dict_set_item(dict, "Options", plist_copy(options)); |
| 460 | } | 460 | } |
| 461 | if (!strcmp(request, "Unback") && options) { | 461 | if (!strcmp(request, "Unback") && options) { |
| 462 | plist_t node = plist_dict_get_item(options, "Password"); | 462 | plist_t node = plist_dict_get_item(options, "Password"); |
| 463 | if (node) { | 463 | if (node) { |
| 464 | plist_dict_insert_item(dict, "Password", plist_copy(node)); | 464 | plist_dict_set_item(dict, "Password", plist_copy(node)); |
| 465 | } | 465 | } |
| 466 | } | 466 | } |
| 467 | if (!strcmp(request, "EnableCloudBackup") && options) { | 467 | if (!strcmp(request, "EnableCloudBackup") && options) { |
| 468 | plist_t node = plist_dict_get_item(options, "CloudBackupState"); | 468 | plist_t node = plist_dict_get_item(options, "CloudBackupState"); |
| 469 | if (node) { | 469 | if (node) { |
| 470 | plist_dict_insert_item(dict, "CloudBackupState", plist_copy(node)); | 470 | plist_dict_set_item(dict, "CloudBackupState", plist_copy(node)); |
| 471 | } | 471 | } |
| 472 | } | 472 | } |
| 473 | mobilebackup2_error_t err = mobilebackup2_send_message(client, request, dict); | 473 | mobilebackup2_error_t err = mobilebackup2_send_message(client, request, dict); |
diff --git a/src/mobilesync.c b/src/mobilesync.c index e9e05ee..fd64e63 100644 --- a/src/mobilesync.c +++ b/src/mobilesync.c | |||
| @@ -987,10 +987,10 @@ void mobilesync_actions_add(plist_t actions, ...) | |||
| 987 | plist_array_append_item(array, plist_new_string(entity_names[i])); | 987 | plist_array_append_item(array, plist_new_string(entity_names[i])); |
| 988 | } | 988 | } |
| 989 | 989 | ||
| 990 | plist_dict_insert_item(actions, key, array); | 990 | plist_dict_set_item(actions, key, array); |
| 991 | } else if (!strcmp(key, "SyncDeviceLinkAllRecordsOfPulledEntityTypeSentKey")) { | 991 | } else if (!strcmp(key, "SyncDeviceLinkAllRecordsOfPulledEntityTypeSentKey")) { |
| 992 | int link_records = va_arg(args, int); | 992 | int link_records = va_arg(args, int); |
| 993 | plist_dict_insert_item(actions, key, plist_new_bool(link_records)); | 993 | plist_dict_set_item(actions, key, plist_new_bool(link_records)); |
| 994 | } | 994 | } |
| 995 | free(key); | 995 | free(key); |
| 996 | key = NULL; | 996 | key = NULL; |
diff --git a/src/notification_proxy.c b/src/notification_proxy.c index 6073b76..1ccda6b 100644 --- a/src/notification_proxy.c +++ b/src/notification_proxy.c | |||
| @@ -177,14 +177,14 @@ np_error_t np_post_notification(np_client_t client, const char *notification) | |||
| 177 | np_lock(client); | 177 | np_lock(client); |
| 178 | 178 | ||
| 179 | plist_t dict = plist_new_dict(); | 179 | plist_t dict = plist_new_dict(); |
| 180 | plist_dict_insert_item(dict,"Command", plist_new_string("PostNotification")); | 180 | plist_dict_set_item(dict,"Command", plist_new_string("PostNotification")); |
| 181 | plist_dict_insert_item(dict,"Name", plist_new_string(notification)); | 181 | plist_dict_set_item(dict,"Name", plist_new_string(notification)); |
| 182 | 182 | ||
| 183 | np_error_t res = np_error(property_list_service_send_xml_plist(client->parent, dict)); | 183 | np_error_t res = np_error(property_list_service_send_xml_plist(client->parent, dict)); |
| 184 | plist_free(dict); | 184 | plist_free(dict); |
| 185 | 185 | ||
| 186 | dict = plist_new_dict(); | 186 | dict = plist_new_dict(); |
| 187 | plist_dict_insert_item(dict,"Command", plist_new_string("Shutdown")); | 187 | plist_dict_set_item(dict,"Command", plist_new_string("Shutdown")); |
| 188 | 188 | ||
| 189 | res = np_error(property_list_service_send_xml_plist(client->parent, dict)); | 189 | res = np_error(property_list_service_send_xml_plist(client->parent, dict)); |
| 190 | plist_free(dict); | 190 | plist_free(dict); |
| @@ -237,8 +237,8 @@ np_error_t np_observe_notification( np_client_t client, const char *notification | |||
| 237 | np_lock(client); | 237 | np_lock(client); |
| 238 | 238 | ||
| 239 | plist_t dict = plist_new_dict(); | 239 | plist_t dict = plist_new_dict(); |
| 240 | plist_dict_insert_item(dict,"Command", plist_new_string("ObserveNotification")); | 240 | plist_dict_set_item(dict,"Command", plist_new_string("ObserveNotification")); |
| 241 | plist_dict_insert_item(dict,"Name", plist_new_string(notification)); | 241 | plist_dict_set_item(dict,"Name", plist_new_string(notification)); |
| 242 | 242 | ||
| 243 | np_error_t res = np_error(property_list_service_send_xml_plist(client->parent, dict)); | 243 | np_error_t res = np_error(property_list_service_send_xml_plist(client->parent, dict)); |
| 244 | if (res != NP_E_SUCCESS) { | 244 | if (res != NP_E_SUCCESS) { |
diff --git a/src/restore.c b/src/restore.c index 88fc168..6339270 100644 --- a/src/restore.c +++ b/src/restore.c | |||
| @@ -85,7 +85,7 @@ static void plist_dict_add_label(plist_t plist, const char *label) | |||
| 85 | { | 85 | { |
| 86 | if (plist && label) { | 86 | if (plist && label) { |
| 87 | if (plist_get_node_type(plist) == PLIST_DICT) | 87 | if (plist_get_node_type(plist) == PLIST_DICT) |
| 88 | plist_dict_insert_item(plist, "Label", plist_new_string(label)); | 88 | plist_dict_set_item(plist, "Label", plist_new_string(label)); |
| 89 | } | 89 | } |
| 90 | } | 90 | } |
| 91 | 91 | ||
| @@ -218,7 +218,7 @@ restored_error_t restored_query_type(restored_client_t client, char **type, uint | |||
| 218 | 218 | ||
| 219 | plist_t dict = plist_new_dict(); | 219 | plist_t dict = plist_new_dict(); |
| 220 | plist_dict_add_label(dict, client->label); | 220 | plist_dict_add_label(dict, client->label); |
| 221 | plist_dict_insert_item(dict,"Request", plist_new_string("QueryType")); | 221 | plist_dict_set_item(dict,"Request", plist_new_string("QueryType")); |
| 222 | 222 | ||
| 223 | debug_info("called"); | 223 | debug_info("called"); |
| 224 | ret = restored_send(client, dict); | 224 | ret = restored_send(client, dict); |
| @@ -289,9 +289,9 @@ restored_error_t restored_query_value(restored_client_t client, const char *key, | |||
| 289 | dict = plist_new_dict(); | 289 | dict = plist_new_dict(); |
| 290 | plist_dict_add_label(dict, client->label); | 290 | plist_dict_add_label(dict, client->label); |
| 291 | if (key) { | 291 | if (key) { |
| 292 | plist_dict_insert_item(dict,"QueryKey", plist_new_string(key)); | 292 | plist_dict_set_item(dict,"QueryKey", plist_new_string(key)); |
| 293 | } | 293 | } |
| 294 | plist_dict_insert_item(dict,"Request", plist_new_string("QueryValue")); | 294 | plist_dict_set_item(dict,"Request", plist_new_string("QueryValue")); |
| 295 | 295 | ||
| 296 | /* send to device */ | 296 | /* send to device */ |
| 297 | ret = restored_send(client, dict); | 297 | ret = restored_send(client, dict); |
| @@ -422,7 +422,7 @@ restored_error_t restored_goodbye(restored_client_t client) | |||
| 422 | 422 | ||
| 423 | plist_t dict = plist_new_dict(); | 423 | plist_t dict = plist_new_dict(); |
| 424 | plist_dict_add_label(dict, client->label); | 424 | plist_dict_add_label(dict, client->label); |
| 425 | plist_dict_insert_item(dict,"Request", plist_new_string("Goodbye")); | 425 | plist_dict_set_item(dict,"Request", plist_new_string("Goodbye")); |
| 426 | 426 | ||
| 427 | debug_info("called"); | 427 | debug_info("called"); |
| 428 | 428 | ||
| @@ -465,11 +465,11 @@ restored_error_t restored_start_restore(restored_client_t client, plist_t option | |||
| 465 | 465 | ||
| 466 | dict = plist_new_dict(); | 466 | dict = plist_new_dict(); |
| 467 | plist_dict_add_label(dict, client->label); | 467 | plist_dict_add_label(dict, client->label); |
| 468 | plist_dict_insert_item(dict,"Request", plist_new_string("StartRestore")); | 468 | plist_dict_set_item(dict,"Request", plist_new_string("StartRestore")); |
| 469 | if (options) { | 469 | if (options) { |
| 470 | plist_dict_insert_item(dict, "RestoreOptions", plist_copy(options)); | 470 | plist_dict_set_item(dict, "RestoreOptions", plist_copy(options)); |
| 471 | } | 471 | } |
| 472 | plist_dict_insert_item(dict,"RestoreProtocolVersion", plist_new_uint(version)); | 472 | plist_dict_set_item(dict,"RestoreProtocolVersion", plist_new_uint(version)); |
| 473 | 473 | ||
| 474 | /* send to device */ | 474 | /* send to device */ |
| 475 | ret = restored_send(client, dict); | 475 | ret = restored_send(client, dict); |
| @@ -497,7 +497,7 @@ restored_error_t restored_reboot(restored_client_t client) | |||
| 497 | 497 | ||
| 498 | dict = plist_new_dict(); | 498 | dict = plist_new_dict(); |
| 499 | plist_dict_add_label(dict, client->label); | 499 | plist_dict_add_label(dict, client->label); |
| 500 | plist_dict_insert_item(dict,"Request", plist_new_string("Reboot")); | 500 | plist_dict_set_item(dict,"Request", plist_new_string("Reboot")); |
| 501 | 501 | ||
| 502 | /* send to device */ | 502 | /* send to device */ |
| 503 | ret = restored_send(client, dict); | 503 | ret = restored_send(client, dict); |
diff --git a/src/sbservices.c b/src/sbservices.c index c761070..1d043f1 100644 --- a/src/sbservices.c +++ b/src/sbservices.c | |||
| @@ -167,9 +167,9 @@ sbservices_error_t sbservices_get_icon_state(sbservices_client_t client, plist_t | |||
| 167 | sbservices_error_t res = SBSERVICES_E_UNKNOWN_ERROR; | 167 | sbservices_error_t res = SBSERVICES_E_UNKNOWN_ERROR; |
| 168 | 168 | ||
| 169 | plist_t dict = plist_new_dict(); | 169 | plist_t dict = plist_new_dict(); |
| 170 | plist_dict_insert_item(dict, "command", plist_new_string("getIconState")); | 170 | plist_dict_set_item(dict, "command", plist_new_string("getIconState")); |
| 171 | if (format_version) { | 171 | if (format_version) { |
| 172 | plist_dict_insert_item(dict, "formatVersion", plist_new_string(format_version)); | 172 | plist_dict_set_item(dict, "formatVersion", plist_new_string(format_version)); |
| 173 | } | 173 | } |
| 174 | 174 | ||
| 175 | sbs_lock(client); | 175 | sbs_lock(client); |
| @@ -216,8 +216,8 @@ sbservices_error_t sbservices_set_icon_state(sbservices_client_t client, plist_t | |||
| 216 | sbservices_error_t res = SBSERVICES_E_UNKNOWN_ERROR; | 216 | sbservices_error_t res = SBSERVICES_E_UNKNOWN_ERROR; |
| 217 | 217 | ||
| 218 | plist_t dict = plist_new_dict(); | 218 | plist_t dict = plist_new_dict(); |
| 219 | plist_dict_insert_item(dict, "command", plist_new_string("setIconState")); | 219 | plist_dict_set_item(dict, "command", plist_new_string("setIconState")); |
| 220 | plist_dict_insert_item(dict, "iconState", plist_copy(newstate)); | 220 | plist_dict_set_item(dict, "iconState", plist_copy(newstate)); |
| 221 | 221 | ||
| 222 | sbs_lock(client); | 222 | sbs_lock(client); |
| 223 | 223 | ||
| @@ -257,8 +257,8 @@ sbservices_error_t sbservices_get_icon_pngdata(sbservices_client_t client, const | |||
| 257 | sbservices_error_t res = SBSERVICES_E_UNKNOWN_ERROR; | 257 | sbservices_error_t res = SBSERVICES_E_UNKNOWN_ERROR; |
| 258 | 258 | ||
| 259 | plist_t dict = plist_new_dict(); | 259 | plist_t dict = plist_new_dict(); |
| 260 | plist_dict_insert_item(dict, "command", plist_new_string("getIconPNGData")); | 260 | plist_dict_set_item(dict, "command", plist_new_string("getIconPNGData")); |
| 261 | plist_dict_insert_item(dict, "bundleId", plist_new_string(bundleId)); | 261 | plist_dict_set_item(dict, "bundleId", plist_new_string(bundleId)); |
| 262 | 262 | ||
| 263 | sbs_lock(client); | 263 | sbs_lock(client); |
| 264 | 264 | ||
| @@ -303,7 +303,7 @@ sbservices_error_t sbservices_get_interface_orientation(sbservices_client_t clie | |||
| 303 | sbservices_error_t res = SBSERVICES_E_UNKNOWN_ERROR; | 303 | sbservices_error_t res = SBSERVICES_E_UNKNOWN_ERROR; |
| 304 | 304 | ||
| 305 | plist_t dict = plist_new_dict(); | 305 | plist_t dict = plist_new_dict(); |
| 306 | plist_dict_insert_item(dict, "command", plist_new_string("getInterfaceOrientation")); | 306 | plist_dict_set_item(dict, "command", plist_new_string("getInterfaceOrientation")); |
| 307 | 307 | ||
| 308 | sbs_lock(client); | 308 | sbs_lock(client); |
| 309 | 309 | ||
| @@ -355,7 +355,7 @@ sbservices_error_t sbservices_get_home_screen_wallpaper_pngdata(sbservices_clien | |||
| 355 | sbservices_error_t res = SBSERVICES_E_UNKNOWN_ERROR; | 355 | sbservices_error_t res = SBSERVICES_E_UNKNOWN_ERROR; |
| 356 | 356 | ||
| 357 | plist_t dict = plist_new_dict(); | 357 | plist_t dict = plist_new_dict(); |
| 358 | plist_dict_insert_item(dict, "command", plist_new_string("getHomeScreenWallpaperPNGData")); | 358 | plist_dict_set_item(dict, "command", plist_new_string("getHomeScreenWallpaperPNGData")); |
| 359 | 359 | ||
| 360 | sbs_lock(client); | 360 | sbs_lock(client); |
| 361 | 361 | ||
diff --git a/src/screenshotr.c b/src/screenshotr.c index 5367450..a1b5759 100644 --- a/src/screenshotr.c +++ b/src/screenshotr.c | |||
| @@ -162,7 +162,7 @@ screenshotr_error_t screenshotr_take_screenshot(screenshotr_client_t client, cha | |||
| 162 | screenshotr_error_t res = SCREENSHOTR_E_UNKNOWN_ERROR; | 162 | screenshotr_error_t res = SCREENSHOTR_E_UNKNOWN_ERROR; |
| 163 | 163 | ||
| 164 | plist_t dict = plist_new_dict(); | 164 | plist_t dict = plist_new_dict(); |
| 165 | plist_dict_insert_item(dict, "MessageType", plist_new_string("ScreenShotRequest")); | 165 | plist_dict_set_item(dict, "MessageType", plist_new_string("ScreenShotRequest")); |
| 166 | 166 | ||
| 167 | res = screenshotr_error(device_link_service_send_process_message(client->parent, dict)); | 167 | res = screenshotr_error(device_link_service_send_process_message(client->parent, dict)); |
| 168 | plist_free(dict); | 168 | plist_free(dict); |
diff --git a/src/webinspector.c b/src/webinspector.c index c042df9..14a8bd8 100644 --- a/src/webinspector.c +++ b/src/webinspector.c | |||
| @@ -178,12 +178,12 @@ webinspector_error_t webinspector_send(webinspector_client_t client, plist_t pli | |||
| 178 | plist_t outplist = plist_new_dict(); | 178 | plist_t outplist = plist_new_dict(); |
| 179 | if (!is_final_message) { | 179 | if (!is_final_message) { |
| 180 | /* split packet into partial chunks */ | 180 | /* split packet into partial chunks */ |
| 181 | plist_dict_insert_item(outplist, "WIRPartialMessageKey", plist_new_data(packet + offset, WEBINSPECTOR_PARTIAL_PACKET_CHUNK_SIZE)); | 181 | plist_dict_set_item(outplist, "WIRPartialMessageKey", plist_new_data(packet + offset, WEBINSPECTOR_PARTIAL_PACKET_CHUNK_SIZE)); |
| 182 | offset += WEBINSPECTOR_PARTIAL_PACKET_CHUNK_SIZE; | 182 | offset += WEBINSPECTOR_PARTIAL_PACKET_CHUNK_SIZE; |
| 183 | packet_length -= WEBINSPECTOR_PARTIAL_PACKET_CHUNK_SIZE; | 183 | packet_length -= WEBINSPECTOR_PARTIAL_PACKET_CHUNK_SIZE; |
| 184 | } else { | 184 | } else { |
| 185 | /* send final chunk */ | 185 | /* send final chunk */ |
| 186 | plist_dict_insert_item(outplist, "WIRFinalMessageKey", plist_new_data(packet + offset, packet_length)); | 186 | plist_dict_set_item(outplist, "WIRFinalMessageKey", plist_new_data(packet + offset, packet_length)); |
| 187 | offset += packet_length; | 187 | offset += packet_length; |
| 188 | packet_length -= packet_length; | 188 | packet_length -= packet_length; |
| 189 | } | 189 | } |
diff --git a/tools/idevicebackup.c b/tools/idevicebackup.c index 8f5362c..0d7ba92 100644 --- a/tools/idevicebackup.c +++ b/tools/idevicebackup.c | |||
| @@ -298,42 +298,42 @@ static plist_t mobilebackup_factory_info_plist_new(const char* udid) | |||
| 298 | 298 | ||
| 299 | /* set fields we understand */ | 299 | /* set fields we understand */ |
| 300 | value_node = plist_dict_get_item(root_node, "BuildVersion"); | 300 | value_node = plist_dict_get_item(root_node, "BuildVersion"); |
| 301 | plist_dict_insert_item(ret, "Build Version", plist_copy(value_node)); | 301 | plist_dict_set_item(ret, "Build Version", plist_copy(value_node)); |
| 302 | 302 | ||
| 303 | value_node = plist_dict_get_item(root_node, "DeviceName"); | 303 | value_node = plist_dict_get_item(root_node, "DeviceName"); |
| 304 | plist_dict_insert_item(ret, "Device Name", plist_copy(value_node)); | 304 | plist_dict_set_item(ret, "Device Name", plist_copy(value_node)); |
| 305 | plist_dict_insert_item(ret, "Display Name", plist_copy(value_node)); | 305 | plist_dict_set_item(ret, "Display Name", plist_copy(value_node)); |
| 306 | 306 | ||
| 307 | /* FIXME: How is the GUID generated? */ | 307 | /* FIXME: How is the GUID generated? */ |
| 308 | plist_dict_insert_item(ret, "GUID", plist_new_string("---")); | 308 | plist_dict_set_item(ret, "GUID", plist_new_string("---")); |
| 309 | 309 | ||
| 310 | value_node = plist_dict_get_item(root_node, "InternationalMobileEquipmentIdentity"); | 310 | value_node = plist_dict_get_item(root_node, "InternationalMobileEquipmentIdentity"); |
| 311 | if (value_node) | 311 | if (value_node) |
| 312 | plist_dict_insert_item(ret, "IMEI", plist_copy(value_node)); | 312 | plist_dict_set_item(ret, "IMEI", plist_copy(value_node)); |
| 313 | 313 | ||
| 314 | plist_dict_insert_item(ret, "Last Backup Date", plist_new_date(time(NULL), 0)); | 314 | plist_dict_set_item(ret, "Last Backup Date", plist_new_date(time(NULL), 0)); |
| 315 | 315 | ||
| 316 | value_node = plist_dict_get_item(root_node, "ProductType"); | 316 | value_node = plist_dict_get_item(root_node, "ProductType"); |
| 317 | plist_dict_insert_item(ret, "Product Type", plist_copy(value_node)); | 317 | plist_dict_set_item(ret, "Product Type", plist_copy(value_node)); |
| 318 | 318 | ||
| 319 | value_node = plist_dict_get_item(root_node, "ProductVersion"); | 319 | value_node = plist_dict_get_item(root_node, "ProductVersion"); |
| 320 | plist_dict_insert_item(ret, "Product Version", plist_copy(value_node)); | 320 | plist_dict_set_item(ret, "Product Version", plist_copy(value_node)); |
| 321 | 321 | ||
| 322 | value_node = plist_dict_get_item(root_node, "SerialNumber"); | 322 | value_node = plist_dict_get_item(root_node, "SerialNumber"); |
| 323 | plist_dict_insert_item(ret, "Serial Number", plist_copy(value_node)); | 323 | plist_dict_set_item(ret, "Serial Number", plist_copy(value_node)); |
| 324 | 324 | ||
| 325 | value_node = plist_dict_get_item(root_node, "UniqueDeviceID"); | 325 | value_node = plist_dict_get_item(root_node, "UniqueDeviceID"); |
| 326 | plist_dict_insert_item(ret, "Target Identifier", plist_new_string(udid)); | 326 | plist_dict_set_item(ret, "Target Identifier", plist_new_string(udid)); |
| 327 | 327 | ||
| 328 | /* uppercase */ | 328 | /* uppercase */ |
| 329 | udid_uppercase = str_toupper((char*)udid); | 329 | udid_uppercase = str_toupper((char*)udid); |
| 330 | plist_dict_insert_item(ret, "Unique Identifier", plist_new_string(udid_uppercase)); | 330 | plist_dict_set_item(ret, "Unique Identifier", plist_new_string(udid_uppercase)); |
| 331 | free(udid_uppercase); | 331 | free(udid_uppercase); |
| 332 | 332 | ||
| 333 | /* FIXME: Embed files as <data> nodes */ | 333 | /* FIXME: Embed files as <data> nodes */ |
| 334 | plist_t files = plist_new_dict(); | 334 | plist_t files = plist_new_dict(); |
| 335 | plist_dict_insert_item(ret, "iTunes Files", files); | 335 | plist_dict_set_item(ret, "iTunes Files", files); |
| 336 | plist_dict_insert_item(ret, "iTunes Version", plist_new_string("9.0.2")); | 336 | plist_dict_set_item(ret, "iTunes Version", plist_new_string("9.0.2")); |
| 337 | 337 | ||
| 338 | plist_free(root_node); | 338 | plist_free(root_node); |
| 339 | 339 | ||
| @@ -466,7 +466,7 @@ static void mobilebackup_write_status(const char *path, int status) | |||
| 466 | { | 466 | { |
| 467 | struct stat st; | 467 | struct stat st; |
| 468 | plist_t status_plist = plist_new_dict(); | 468 | plist_t status_plist = plist_new_dict(); |
| 469 | plist_dict_insert_item(status_plist, "Backup Success", plist_new_bool(status)); | 469 | plist_dict_set_item(status_plist, "Backup Success", plist_new_bool(status)); |
| 470 | char *file_path = mobilebackup_build_path(path, "Status", ".plist"); | 470 | char *file_path = mobilebackup_build_path(path, "Status", ".plist"); |
| 471 | 471 | ||
| 472 | if (stat(file_path, &st) == 0) | 472 | if (stat(file_path, &st) == 0) |
| @@ -1509,12 +1509,12 @@ files_out: | |||
| 1509 | printf("Restoring file %s %d/%d (%d%%)... ", file_path, cur_file, total_files, (cur_file*100/total_files)); | 1509 | printf("Restoring file %s %d/%d (%d%%)... ", file_path, cur_file, total_files, (cur_file*100/total_files)); |
| 1510 | 1510 | ||
| 1511 | /* add additional device link file information keys */ | 1511 | /* add additional device link file information keys */ |
| 1512 | plist_dict_insert_item(file_info, "DLFileAttributesKey", plist_copy(node)); | 1512 | plist_dict_set_item(file_info, "DLFileAttributesKey", plist_copy(node)); |
| 1513 | plist_dict_insert_item(file_info, "DLFileSource", plist_new_string(file_info_path)); | 1513 | plist_dict_set_item(file_info, "DLFileSource", plist_new_string(file_info_path)); |
| 1514 | plist_dict_insert_item(file_info, "DLFileDest", plist_new_string("/tmp/RestoreFile.plist")); | 1514 | plist_dict_set_item(file_info, "DLFileDest", plist_new_string("/tmp/RestoreFile.plist")); |
| 1515 | plist_dict_insert_item(file_info, "DLFileIsEncrypted", plist_new_bool(is_encrypted)); | 1515 | plist_dict_set_item(file_info, "DLFileIsEncrypted", plist_new_bool(is_encrypted)); |
| 1516 | plist_dict_insert_item(file_info, "DLFileOffsetKey", plist_new_uint(file_offset)); | 1516 | plist_dict_set_item(file_info, "DLFileOffsetKey", plist_new_uint(file_offset)); |
| 1517 | plist_dict_insert_item(file_info, "DLFileStatusKey", plist_new_uint(file_status)); | 1517 | plist_dict_set_item(file_info, "DLFileStatusKey", plist_new_uint(file_status)); |
| 1518 | 1518 | ||
| 1519 | /* read data from file */ | 1519 | /* read data from file */ |
| 1520 | free(file_info_path); | 1520 | free(file_info_path); |
| @@ -1531,10 +1531,10 @@ files_out: | |||
| 1531 | file_status = DEVICE_LINK_FILE_STATUS_HUNK; | 1531 | file_status = DEVICE_LINK_FILE_STATUS_HUNK; |
| 1532 | 1532 | ||
| 1533 | plist_dict_remove_item(file_info, "DLFileOffsetKey"); | 1533 | plist_dict_remove_item(file_info, "DLFileOffsetKey"); |
| 1534 | plist_dict_insert_item(file_info, "DLFileOffsetKey", plist_new_uint(file_offset)); | 1534 | plist_dict_set_item(file_info, "DLFileOffsetKey", plist_new_uint(file_offset)); |
| 1535 | 1535 | ||
| 1536 | plist_dict_remove_item(file_info, "DLFileStatusKey"); | 1536 | plist_dict_remove_item(file_info, "DLFileStatusKey"); |
| 1537 | plist_dict_insert_item(file_info, "DLFileStatusKey", plist_new_uint(file_status)); | 1537 | plist_dict_set_item(file_info, "DLFileStatusKey", plist_new_uint(file_status)); |
| 1538 | 1538 | ||
| 1539 | send_file_node = plist_new_array(); | 1539 | send_file_node = plist_new_array(); |
| 1540 | 1540 | ||
| @@ -1615,8 +1615,8 @@ files_out: | |||
| 1615 | tmp_node = plist_dict_get_item(node, "AppInfo"); | 1615 | tmp_node = plist_dict_get_item(node, "AppInfo"); |
| 1616 | 1616 | ||
| 1617 | dict = plist_new_dict(); | 1617 | dict = plist_new_dict(); |
| 1618 | plist_dict_insert_item(dict, "AppInfo", plist_copy(tmp_node)); | 1618 | plist_dict_set_item(dict, "AppInfo", plist_copy(tmp_node)); |
| 1619 | plist_dict_insert_item(dict, "BackupMessageTypeKey", plist_new_string("BackupMessageRestoreApplicationSent")); | 1619 | plist_dict_set_item(dict, "BackupMessageTypeKey", plist_new_string("BackupMessageRestoreApplicationSent")); |
| 1620 | 1620 | ||
| 1621 | array = plist_new_array(); | 1621 | array = plist_new_array(); |
| 1622 | plist_array_append_item(array, plist_new_string("DLMessageProcessMessage")); | 1622 | plist_array_append_item(array, plist_new_string("DLMessageProcessMessage")); |
diff --git a/tools/idevicebackup2.c b/tools/idevicebackup2.c index 8efc2c8..a9bf071 100644 --- a/tools/idevicebackup2.c +++ b/tools/idevicebackup2.c | |||
| @@ -275,56 +275,56 @@ static plist_t mobilebackup_factory_info_plist_new(const char* udid, lockdownd_c | |||
| 275 | 275 | ||
| 276 | /* set fields we understand */ | 276 | /* set fields we understand */ |
| 277 | value_node = plist_dict_get_item(root_node, "BuildVersion"); | 277 | value_node = plist_dict_get_item(root_node, "BuildVersion"); |
| 278 | plist_dict_insert_item(ret, "Build Version", plist_copy(value_node)); | 278 | plist_dict_set_item(ret, "Build Version", plist_copy(value_node)); |
| 279 | 279 | ||
| 280 | value_node = plist_dict_get_item(root_node, "DeviceName"); | 280 | value_node = plist_dict_get_item(root_node, "DeviceName"); |
| 281 | plist_dict_insert_item(ret, "Device Name", plist_copy(value_node)); | 281 | plist_dict_set_item(ret, "Device Name", plist_copy(value_node)); |
| 282 | plist_dict_insert_item(ret, "Display Name", plist_copy(value_node)); | 282 | plist_dict_set_item(ret, "Display Name", plist_copy(value_node)); |
| 283 | 283 | ||
| 284 | /* FIXME: How is the GUID generated? */ | 284 | /* FIXME: How is the GUID generated? */ |
| 285 | plist_dict_insert_item(ret, "GUID", plist_new_string("---")); | 285 | plist_dict_set_item(ret, "GUID", plist_new_string("---")); |
| 286 | 286 | ||
| 287 | value_node = plist_dict_get_item(root_node, "IntegratedCircuitCardIdentity"); | 287 | value_node = plist_dict_get_item(root_node, "IntegratedCircuitCardIdentity"); |
| 288 | if (value_node) | 288 | if (value_node) |
| 289 | plist_dict_insert_item(ret, "ICCID", plist_copy(value_node)); | 289 | plist_dict_set_item(ret, "ICCID", plist_copy(value_node)); |
| 290 | 290 | ||
| 291 | value_node = plist_dict_get_item(root_node, "InternationalMobileEquipmentIdentity"); | 291 | value_node = plist_dict_get_item(root_node, "InternationalMobileEquipmentIdentity"); |
| 292 | if (value_node) | 292 | if (value_node) |
| 293 | plist_dict_insert_item(ret, "IMEI", plist_copy(value_node)); | 293 | plist_dict_set_item(ret, "IMEI", plist_copy(value_node)); |
| 294 | 294 | ||
| 295 | plist_dict_insert_item(ret, "Last Backup Date", plist_new_date(time(NULL), 0)); | 295 | plist_dict_set_item(ret, "Last Backup Date", plist_new_date(time(NULL), 0)); |
| 296 | 296 | ||
| 297 | value_node = plist_dict_get_item(root_node, "PhoneNumber"); | 297 | value_node = plist_dict_get_item(root_node, "PhoneNumber"); |
| 298 | if (value_node && (plist_get_node_type(value_node) == PLIST_STRING)) { | 298 | if (value_node && (plist_get_node_type(value_node) == PLIST_STRING)) { |
| 299 | plist_dict_insert_item(ret, "Phone Number", plist_copy(value_node)); | 299 | plist_dict_set_item(ret, "Phone Number", plist_copy(value_node)); |
| 300 | } | 300 | } |
| 301 | 301 | ||
| 302 | value_node = plist_dict_get_item(root_node, "ProductType"); | 302 | value_node = plist_dict_get_item(root_node, "ProductType"); |
| 303 | plist_dict_insert_item(ret, "Product Type", plist_copy(value_node)); | 303 | plist_dict_set_item(ret, "Product Type", plist_copy(value_node)); |
| 304 | 304 | ||
| 305 | value_node = plist_dict_get_item(root_node, "ProductVersion"); | 305 | value_node = plist_dict_get_item(root_node, "ProductVersion"); |
| 306 | plist_dict_insert_item(ret, "Product Version", plist_copy(value_node)); | 306 | plist_dict_set_item(ret, "Product Version", plist_copy(value_node)); |
| 307 | 307 | ||
| 308 | value_node = plist_dict_get_item(root_node, "SerialNumber"); | 308 | value_node = plist_dict_get_item(root_node, "SerialNumber"); |
| 309 | plist_dict_insert_item(ret, "Serial Number", plist_copy(value_node)); | 309 | plist_dict_set_item(ret, "Serial Number", plist_copy(value_node)); |
| 310 | 310 | ||
| 311 | /* FIXME Sync Settings? */ | 311 | /* FIXME Sync Settings? */ |
| 312 | 312 | ||
| 313 | value_node = plist_dict_get_item(root_node, "UniqueDeviceID"); | 313 | value_node = plist_dict_get_item(root_node, "UniqueDeviceID"); |
| 314 | plist_dict_insert_item(ret, "Target Identifier", plist_new_string(udid)); | 314 | plist_dict_set_item(ret, "Target Identifier", plist_new_string(udid)); |
| 315 | 315 | ||
| 316 | plist_dict_insert_item(ret, "Target Type", plist_new_string("Device")); | 316 | plist_dict_set_item(ret, "Target Type", plist_new_string("Device")); |
| 317 | 317 | ||
| 318 | /* uppercase */ | 318 | /* uppercase */ |
| 319 | udid_uppercase = str_toupper((char*)udid); | 319 | udid_uppercase = str_toupper((char*)udid); |
| 320 | plist_dict_insert_item(ret, "Unique Identifier", plist_new_string(udid_uppercase)); | 320 | plist_dict_set_item(ret, "Unique Identifier", plist_new_string(udid_uppercase)); |
| 321 | free(udid_uppercase); | 321 | free(udid_uppercase); |
| 322 | 322 | ||
| 323 | char *data_buf = NULL; | 323 | char *data_buf = NULL; |
| 324 | uint64_t data_size = 0; | 324 | uint64_t data_size = 0; |
| 325 | mobilebackup_afc_get_file_contents(afc, "/Books/iBooksData2.plist", &data_buf, &data_size); | 325 | mobilebackup_afc_get_file_contents(afc, "/Books/iBooksData2.plist", &data_buf, &data_size); |
| 326 | if (data_buf) { | 326 | if (data_buf) { |
| 327 | plist_dict_insert_item(ret, "iBooks Data 2", plist_new_data(data_buf, data_size)); | 327 | plist_dict_set_item(ret, "iBooks Data 2", plist_new_data(data_buf, data_size)); |
| 328 | free(data_buf); | 328 | free(data_buf); |
| 329 | } | 329 | } |
| 330 | 330 | ||
| @@ -352,17 +352,17 @@ static plist_t mobilebackup_factory_info_plist_new(const char* udid, lockdownd_c | |||
| 352 | mobilebackup_afc_get_file_contents(afc, fname, &data_buf, &data_size); | 352 | mobilebackup_afc_get_file_contents(afc, fname, &data_buf, &data_size); |
| 353 | free(fname); | 353 | free(fname); |
| 354 | if (data_buf) { | 354 | if (data_buf) { |
| 355 | plist_dict_insert_item(files, itunesfiles[i], plist_new_data(data_buf, data_size)); | 355 | plist_dict_set_item(files, itunesfiles[i], plist_new_data(data_buf, data_size)); |
| 356 | free(data_buf); | 356 | free(data_buf); |
| 357 | } | 357 | } |
| 358 | } | 358 | } |
| 359 | plist_dict_insert_item(ret, "iTunes Files", files); | 359 | plist_dict_set_item(ret, "iTunes Files", files); |
| 360 | 360 | ||
| 361 | plist_t itunes_settings = NULL; | 361 | plist_t itunes_settings = NULL; |
| 362 | lockdownd_get_value(lockdown, "com.apple.iTunes", NULL, &itunes_settings); | 362 | lockdownd_get_value(lockdown, "com.apple.iTunes", NULL, &itunes_settings); |
| 363 | plist_dict_insert_item(ret, "iTunes Settings", itunes_settings ? itunes_settings : plist_new_dict()); | 363 | plist_dict_set_item(ret, "iTunes Settings", itunes_settings ? itunes_settings : plist_new_dict()); |
| 364 | 364 | ||
| 365 | plist_dict_insert_item(ret, "iTunes Version", plist_new_string("10.0.1")); | 365 | plist_dict_set_item(ret, "iTunes Version", plist_new_string("10.0.1")); |
| 366 | 366 | ||
| 367 | plist_free(root_node); | 367 | plist_free(root_node); |
| 368 | 368 | ||
| @@ -589,9 +589,9 @@ static void mb2_multi_status_add_file_error(plist_t status_dict, const char *pat | |||
| 589 | { | 589 | { |
| 590 | if (!status_dict) return; | 590 | if (!status_dict) return; |
| 591 | plist_t filedict = plist_new_dict(); | 591 | plist_t filedict = plist_new_dict(); |
| 592 | plist_dict_insert_item(filedict, "DLFileErrorString", plist_new_string(error_message)); | 592 | plist_dict_set_item(filedict, "DLFileErrorString", plist_new_string(error_message)); |
| 593 | plist_dict_insert_item(filedict, "DLFileErrorCode", plist_new_uint(error_code)); | 593 | plist_dict_set_item(filedict, "DLFileErrorCode", plist_new_uint(error_code)); |
| 594 | plist_dict_insert_item(status_dict, path, filedict); | 594 | plist_dict_set_item(status_dict, path, filedict); |
| 595 | } | 595 | } |
| 596 | 596 | ||
| 597 | static int errno_to_device_error(int errno_value) | 597 | static int errno_to_device_error(int errno_value) |
| @@ -1055,11 +1055,11 @@ static void mb2_handle_list_directory(mobilebackup2_client_t mobilebackup2, plis | |||
| 1055 | } else if (S_ISREG(st.st_mode)) { | 1055 | } else if (S_ISREG(st.st_mode)) { |
| 1056 | ftype = "DLFileTypeRegular"; | 1056 | ftype = "DLFileTypeRegular"; |
| 1057 | } | 1057 | } |
| 1058 | plist_dict_insert_item(fdict, "DLFileType", plist_new_string(ftype)); | 1058 | plist_dict_set_item(fdict, "DLFileType", plist_new_string(ftype)); |
| 1059 | plist_dict_insert_item(fdict, "DLFileSize", plist_new_uint(st.st_size)); | 1059 | plist_dict_set_item(fdict, "DLFileSize", plist_new_uint(st.st_size)); |
| 1060 | plist_dict_insert_item(fdict, "DLFileModificationDate", plist_new_date(st.st_mtime, 0)); | 1060 | plist_dict_set_item(fdict, "DLFileModificationDate", plist_new_date(st.st_mtime, 0)); |
| 1061 | 1061 | ||
| 1062 | plist_dict_insert_item(dirlist, ep->d_name, fdict); | 1062 | plist_dict_set_item(dirlist, ep->d_name, fdict); |
| 1063 | free(fpath); | 1063 | free(fpath); |
| 1064 | } | 1064 | } |
| 1065 | } | 1065 | } |
| @@ -1719,7 +1719,7 @@ checkpoint: | |||
| 1719 | switch(cmd) { | 1719 | switch(cmd) { |
| 1720 | case CMD_CLOUD: | 1720 | case CMD_CLOUD: |
| 1721 | opts = plist_new_dict(); | 1721 | opts = plist_new_dict(); |
| 1722 | plist_dict_insert_item(opts, "CloudBackupState", plist_new_bool(cmd_flags & CMD_FLAG_CLOUD_ENABLE ? 1: 0)); | 1722 | plist_dict_set_item(opts, "CloudBackupState", plist_new_bool(cmd_flags & CMD_FLAG_CLOUD_ENABLE ? 1: 0)); |
| 1723 | err = mobilebackup2_send_request(mobilebackup2, "EnableCloudBackup", udid, source_udid, opts); | 1723 | err = mobilebackup2_send_request(mobilebackup2, "EnableCloudBackup", udid, source_udid, opts); |
| 1724 | plist_free(opts); | 1724 | plist_free(opts); |
| 1725 | opts = NULL; | 1725 | opts = NULL; |
| @@ -1767,7 +1767,7 @@ checkpoint: | |||
| 1767 | if (cmd_flags & CMD_FLAG_FORCE_FULL_BACKUP) { | 1767 | if (cmd_flags & CMD_FLAG_FORCE_FULL_BACKUP) { |
| 1768 | PRINT_VERBOSE(1, "Enforcing full backup from device.\n"); | 1768 | PRINT_VERBOSE(1, "Enforcing full backup from device.\n"); |
| 1769 | opts = plist_new_dict(); | 1769 | opts = plist_new_dict(); |
| 1770 | plist_dict_insert_item(opts, "ForceFullBackup", plist_new_bool(1)); | 1770 | plist_dict_set_item(opts, "ForceFullBackup", plist_new_bool(1)); |
| 1771 | } | 1771 | } |
| 1772 | /* request backup from device with manifest from last backup */ | 1772 | /* request backup from device with manifest from last backup */ |
| 1773 | if (willEncrypt) { | 1773 | if (willEncrypt) { |
| @@ -1809,21 +1809,21 @@ checkpoint: | |||
| 1809 | PRINT_VERBOSE(1, "Starting Restore...\n"); | 1809 | PRINT_VERBOSE(1, "Starting Restore...\n"); |
| 1810 | 1810 | ||
| 1811 | opts = plist_new_dict(); | 1811 | opts = plist_new_dict(); |
| 1812 | plist_dict_insert_item(opts, "RestoreSystemFiles", plist_new_bool(cmd_flags & CMD_FLAG_RESTORE_SYSTEM_FILES)); | 1812 | plist_dict_set_item(opts, "RestoreSystemFiles", plist_new_bool(cmd_flags & CMD_FLAG_RESTORE_SYSTEM_FILES)); |
| 1813 | PRINT_VERBOSE(1, "Restoring system files: %s\n", (cmd_flags & CMD_FLAG_RESTORE_SYSTEM_FILES ? "Yes":"No")); | 1813 | PRINT_VERBOSE(1, "Restoring system files: %s\n", (cmd_flags & CMD_FLAG_RESTORE_SYSTEM_FILES ? "Yes":"No")); |
| 1814 | if ((cmd_flags & CMD_FLAG_RESTORE_REBOOT) == 0) | 1814 | if ((cmd_flags & CMD_FLAG_RESTORE_REBOOT) == 0) |
| 1815 | plist_dict_insert_item(opts, "RestoreShouldReboot", plist_new_bool(0)); | 1815 | plist_dict_set_item(opts, "RestoreShouldReboot", plist_new_bool(0)); |
| 1816 | PRINT_VERBOSE(1, "Rebooting after restore: %s\n", (cmd_flags & CMD_FLAG_RESTORE_REBOOT ? "Yes":"No")); | 1816 | PRINT_VERBOSE(1, "Rebooting after restore: %s\n", (cmd_flags & CMD_FLAG_RESTORE_REBOOT ? "Yes":"No")); |
| 1817 | if ((cmd_flags & CMD_FLAG_RESTORE_COPY_BACKUP) == 0) | 1817 | if ((cmd_flags & CMD_FLAG_RESTORE_COPY_BACKUP) == 0) |
| 1818 | plist_dict_insert_item(opts, "RestoreDontCopyBackup", plist_new_bool(1)); | 1818 | plist_dict_set_item(opts, "RestoreDontCopyBackup", plist_new_bool(1)); |
| 1819 | PRINT_VERBOSE(1, "Don't copy backup: %s\n", ((cmd_flags & CMD_FLAG_RESTORE_COPY_BACKUP) == 0 ? "Yes":"No")); | 1819 | PRINT_VERBOSE(1, "Don't copy backup: %s\n", ((cmd_flags & CMD_FLAG_RESTORE_COPY_BACKUP) == 0 ? "Yes":"No")); |
| 1820 | plist_dict_insert_item(opts, "RestorePreserveSettings", plist_new_bool((cmd_flags & CMD_FLAG_RESTORE_SETTINGS) == 0)); | 1820 | plist_dict_set_item(opts, "RestorePreserveSettings", plist_new_bool((cmd_flags & CMD_FLAG_RESTORE_SETTINGS) == 0)); |
| 1821 | PRINT_VERBOSE(1, "Preserve settings of device: %s\n", ((cmd_flags & CMD_FLAG_RESTORE_SETTINGS) == 0 ? "Yes":"No")); | 1821 | PRINT_VERBOSE(1, "Preserve settings of device: %s\n", ((cmd_flags & CMD_FLAG_RESTORE_SETTINGS) == 0 ? "Yes":"No")); |
| 1822 | if (cmd_flags & CMD_FLAG_RESTORE_REMOVE_ITEMS) | 1822 | if (cmd_flags & CMD_FLAG_RESTORE_REMOVE_ITEMS) |
| 1823 | plist_dict_insert_item(opts, "RemoveItemsNotRestored", plist_new_bool(1)); | 1823 | plist_dict_set_item(opts, "RemoveItemsNotRestored", plist_new_bool(1)); |
| 1824 | PRINT_VERBOSE(1, "Remove items that are not restored: %s\n", ((cmd_flags & CMD_FLAG_RESTORE_REMOVE_ITEMS) ? "Yes":"No")); | 1824 | PRINT_VERBOSE(1, "Remove items that are not restored: %s\n", ((cmd_flags & CMD_FLAG_RESTORE_REMOVE_ITEMS) ? "Yes":"No")); |
| 1825 | if (backup_password != NULL) { | 1825 | if (backup_password != NULL) { |
| 1826 | plist_dict_insert_item(opts, "Password", plist_new_string(backup_password)); | 1826 | plist_dict_set_item(opts, "Password", plist_new_string(backup_password)); |
| 1827 | } | 1827 | } |
| 1828 | PRINT_VERBOSE(1, "Backup password: %s\n", (backup_password == NULL ? "No":"Yes")); | 1828 | PRINT_VERBOSE(1, "Backup password: %s\n", (backup_password == NULL ? "No":"Yes")); |
| 1829 | 1829 | ||
| @@ -1860,7 +1860,7 @@ checkpoint: | |||
| 1860 | PRINT_VERBOSE(1, "Starting to unpack backup...\n"); | 1860 | PRINT_VERBOSE(1, "Starting to unpack backup...\n"); |
| 1861 | if (backup_password != NULL) { | 1861 | if (backup_password != NULL) { |
| 1862 | opts = plist_new_dict(); | 1862 | opts = plist_new_dict(); |
| 1863 | plist_dict_insert_item(opts, "Password", plist_new_string(backup_password)); | 1863 | plist_dict_set_item(opts, "Password", plist_new_string(backup_password)); |
| 1864 | } | 1864 | } |
| 1865 | PRINT_VERBOSE(1, "Backup password: %s\n", (backup_password == NULL ? "No":"Yes")); | 1865 | PRINT_VERBOSE(1, "Backup password: %s\n", (backup_password == NULL ? "No":"Yes")); |
| 1866 | err = mobilebackup2_send_request(mobilebackup2, "Unback", udid, source_udid, opts); | 1866 | err = mobilebackup2_send_request(mobilebackup2, "Unback", udid, source_udid, opts); |
| @@ -1874,7 +1874,7 @@ checkpoint: | |||
| 1874 | break; | 1874 | break; |
| 1875 | case CMD_CHANGEPW: | 1875 | case CMD_CHANGEPW: |
| 1876 | opts = plist_new_dict(); | 1876 | opts = plist_new_dict(); |
| 1877 | plist_dict_insert_item(opts, "TargetIdentifier", plist_new_string(udid)); | 1877 | plist_dict_set_item(opts, "TargetIdentifier", plist_new_string(udid)); |
| 1878 | if (cmd_flags & CMD_FLAG_ENCRYPTION_ENABLE) { | 1878 | if (cmd_flags & CMD_FLAG_ENCRYPTION_ENABLE) { |
| 1879 | if (!willEncrypt) { | 1879 | if (!willEncrypt) { |
| 1880 | if (!newpw) { | 1880 | if (!newpw) { |
| @@ -1924,10 +1924,10 @@ checkpoint: | |||
| 1924 | } | 1924 | } |
| 1925 | } | 1925 | } |
| 1926 | if (newpw) { | 1926 | if (newpw) { |
| 1927 | plist_dict_insert_item(opts, "NewPassword", plist_new_string(newpw)); | 1927 | plist_dict_set_item(opts, "NewPassword", plist_new_string(newpw)); |
| 1928 | } | 1928 | } |
| 1929 | if (backup_password) { | 1929 | if (backup_password) { |
| 1930 | plist_dict_insert_item(opts, "OldPassword", plist_new_string(backup_password)); | 1930 | plist_dict_set_item(opts, "OldPassword", plist_new_string(backup_password)); |
| 1931 | } | 1931 | } |
| 1932 | if (newpw || backup_password) { | 1932 | if (newpw || backup_password) { |
| 1933 | mobilebackup2_send_message(mobilebackup2, "ChangePassword", opts); | 1933 | mobilebackup2_send_message(mobilebackup2, "ChangePassword", opts); |
