summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2014-03-20 23:00:20 +0100
committerGravatar Martin Szulecki2014-03-20 23:00:20 +0100
commit88ce6113593158944630435678e689bf155d9a03 (patch)
tree0757287665b7e9c7263d77fd269b0777e8228d25
parenta34a537d1408f8692daeadd5e1f5859ff13a3473 (diff)
downloadlibimobiledevice-88ce6113593158944630435678e689bf155d9a03.tar.gz
libimobiledevice-88ce6113593158944630435678e689bf155d9a03.tar.bz2
Bump dependency to libplist 1.11 and remove use of "plist_dict_insert_item()"
-rw-r--r--common/userpref.c4
-rw-r--r--configure.ac2
-rw-r--r--dev/ideviceheartbeat.c2
-rw-r--r--src/diagnostics_relay.c28
-rw-r--r--src/file_relay.c2
-rw-r--r--src/house_arrest.c4
-rw-r--r--src/installation_proxy.c14
-rw-r--r--src/lockdown.c78
-rw-r--r--src/misagent.c16
-rw-r--r--src/mobile_image_mounter.c20
-rw-r--r--src/mobilebackup.c24
-rw-r--r--src/mobilebackup2.c14
-rw-r--r--src/mobilesync.c4
-rw-r--r--src/notification_proxy.c10
-rw-r--r--src/restore.c18
-rw-r--r--src/sbservices.c16
-rw-r--r--src/screenshotr.c2
-rw-r--r--src/webinspector.c4
-rw-r--r--tools/idevicebackup.c48
-rw-r--r--tools/idevicebackup2.c76
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
plist_read_from_filename(&config, config_file);
if (!config) {
config = plist_new_dict();
- plist_dict_insert_item(config, key, value);
+ plist_dict_set_item(config, key, value);
} else {
plist_t n = plist_dict_get_item(config, key);
if (n) {
plist_dict_remove_item(config, key);
}
- plist_dict_insert_item(config, key, value);
+ plist_dict_set_item(config, key, value);
remove(config_file);
}
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
LIBIMOBILEDEVICE_SO_VERSION=4:1:0
dnl Minimum package versions
-LIBPLIST_VERSION=1.8
+LIBPLIST_VERSION=1.11
LIBUSBMUXD_VERSION=1.0.8
LIBPLISTMM_VERSION=1.8
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[])
/* answer with a "pong" message */
message = plist_new_dict();
- plist_dict_insert_item(message, "Command", plist_new_string("Polo"));
+ plist_dict_set_item(message, "Command", plist_new_string("Polo"));
heartbeat_send(heartbeat, message);
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
diagnostics_relay_error_t ret = DIAGNOSTICS_RELAY_E_UNKNOWN_ERROR;
plist_t dict = plist_new_dict();
- plist_dict_insert_item(dict, "Request", plist_new_string("Goodbye"));
+ plist_dict_set_item(dict, "Request", plist_new_string("Goodbye"));
ret = diagnostics_relay_send(client, dict);
plist_free(dict);
@@ -261,7 +261,7 @@ diagnostics_relay_error_t diagnostics_relay_sleep(diagnostics_relay_client_t cli
plist_t dict = plist_new_dict();
- plist_dict_insert_item(dict,"Request", plist_new_string("Sleep"));
+ plist_dict_set_item(dict,"Request", plist_new_string("Sleep"));
ret = diagnostics_relay_send(client, dict);
plist_free(dict);
dict = NULL;
@@ -292,18 +292,18 @@ static diagnostics_relay_error_t internal_diagnostics_relay_action(diagnostics_r
diagnostics_relay_error_t ret = DIAGNOSTICS_RELAY_E_UNKNOWN_ERROR;
plist_t dict = plist_new_dict();
- plist_dict_insert_item(dict,"Request", plist_new_string(name));
+ plist_dict_set_item(dict,"Request", plist_new_string(name));
if (flags & DIAGNOSTICS_RELAY_ACTION_FLAG_WAIT_FOR_DISCONNECT) {
- plist_dict_insert_item(dict, "WaitForDisconnect", plist_new_bool(1));
+ plist_dict_set_item(dict, "WaitForDisconnect", plist_new_bool(1));
}
if (flags & DIAGNOSTICS_RELAY_ACTION_FLAG_DISPLAY_PASS) {
- plist_dict_insert_item(dict, "DisplayPass", plist_new_bool(1));
+ plist_dict_set_item(dict, "DisplayPass", plist_new_bool(1));
}
if (flags & DIAGNOSTICS_RELAY_ACTION_FLAG_DISPLAY_FAIL) {
- plist_dict_insert_item(dict, "DisplayFail", plist_new_bool(1));
+ plist_dict_set_item(dict, "DisplayFail", plist_new_bool(1));
}
ret = diagnostics_relay_send(client, dict);
@@ -376,7 +376,7 @@ diagnostics_relay_error_t diagnostics_relay_request_diagnostics(diagnostics_rela
diagnostics_relay_error_t ret = DIAGNOSTICS_RELAY_E_UNKNOWN_ERROR;
plist_t dict = plist_new_dict();
- plist_dict_insert_item(dict,"Request", plist_new_string(type));
+ plist_dict_set_item(dict,"Request", plist_new_string(type));
ret = diagnostics_relay_send(client, dict);
plist_free(dict);
dict = NULL;
@@ -417,8 +417,8 @@ diagnostics_relay_error_t diagnostics_relay_query_mobilegestalt(diagnostics_rela
diagnostics_relay_error_t ret = DIAGNOSTICS_RELAY_E_UNKNOWN_ERROR;
plist_t dict = plist_new_dict();
- plist_dict_insert_item(dict,"MobileGestaltKeys", plist_copy(keys));
- plist_dict_insert_item(dict,"Request", plist_new_string("MobileGestalt"));
+ plist_dict_set_item(dict,"MobileGestaltKeys", plist_copy(keys));
+ plist_dict_set_item(dict,"Request", plist_new_string("MobileGestalt"));
ret = diagnostics_relay_send(client, dict);
plist_free(dict);
dict = NULL;
@@ -460,10 +460,10 @@ diagnostics_relay_error_t diagnostics_relay_query_ioregistry_entry(diagnostics_r
plist_t dict = plist_new_dict();
if (name)
- plist_dict_insert_item(dict,"EntryName", plist_new_string(name));
+ plist_dict_set_item(dict,"EntryName", plist_new_string(name));
if (class)
- plist_dict_insert_item(dict,"EntryClass", plist_new_string(class));
- plist_dict_insert_item(dict,"Request", plist_new_string("IORegistry"));
+ plist_dict_set_item(dict,"EntryClass", plist_new_string(class));
+ plist_dict_set_item(dict,"Request", plist_new_string("IORegistry"));
ret = diagnostics_relay_send(client, dict);
plist_free(dict);
dict = NULL;
@@ -504,8 +504,8 @@ diagnostics_relay_error_t diagnostics_relay_query_ioregistry_plane(diagnostics_r
diagnostics_relay_error_t ret = DIAGNOSTICS_RELAY_E_UNKNOWN_ERROR;
plist_t dict = plist_new_dict();
- plist_dict_insert_item(dict,"CurrentPlane", plist_new_string(plane));
- plist_dict_insert_item(dict,"Request", plist_new_string("IORegistry"));
+ plist_dict_set_item(dict,"CurrentPlane", plist_new_string(plane));
+ plist_dict_set_item(dict,"Request", plist_new_string("IORegistry"));
ret = diagnostics_relay_send(client, dict);
plist_free(dict);
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
i++;
}
plist_t dict = plist_new_dict();
- plist_dict_insert_item(dict, "Sources", array);
+ plist_dict_set_item(dict, "Sources", array);
if (property_list_service_send_xml_plist(client->parent, dict) != PROPERTY_LIST_SERVICE_E_SUCCESS) {
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
house_arrest_error_t res = HOUSE_ARREST_E_UNKNOWN_ERROR;
plist_t dict = plist_new_dict();
- plist_dict_insert_item(dict, "Command", plist_new_string(command));
- plist_dict_insert_item(dict, "Identifier", plist_new_string(appid));
+ plist_dict_set_item(dict, "Command", plist_new_string(command));
+ plist_dict_set_item(dict, "Identifier", plist_new_string(appid));
res = house_arrest_send_request(client, dict);
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
plist_t dict = plist_new_dict();
if (appid) {
- plist_dict_insert_item(dict, "ApplicationIdentifier", plist_new_string(appid));
+ plist_dict_set_item(dict, "ApplicationIdentifier", plist_new_string(appid));
}
if (client_options && (plist_dict_get_size(client_options) > 0)) {
- plist_dict_insert_item(dict, "ClientOptions", plist_copy(client_options));
+ plist_dict_set_item(dict, "ClientOptions", plist_copy(client_options));
}
- plist_dict_insert_item(dict, "Command", plist_new_string(command));
+ plist_dict_set_item(dict, "Command", plist_new_string(command));
if (package_path) {
- plist_dict_insert_item(dict, "PackagePath", plist_new_string(package_path));
+ plist_dict_set_item(dict, "PackagePath", plist_new_string(package_path));
}
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, ...)
char *key = strdup(arg);
if (!strcmp(key, "SkipUninstall")) {
int intval = va_arg(args, int);
- plist_dict_insert_item(client_options, key, plist_new_bool(intval));
+ plist_dict_set_item(client_options, key, plist_new_bool(intval));
} else if (!strcmp(key, "ApplicationSINF") || !strcmp(key, "iTunesMetadata") || !strcmp(key, "ReturnAttributes")) {
plist_t plistval = va_arg(args, plist_t);
if (!plistval) {
free(key);
break;
}
- plist_dict_insert_item(client_options, key, plist_copy(plistval));
+ plist_dict_set_item(client_options, key, plist_copy(plistval));
} else {
char *strval = va_arg(args, char*);
if (!strval) {
free(key);
break;
}
- plist_dict_insert_item(client_options, key, plist_new_string(strval));
+ plist_dict_set_item(client_options, key, plist_new_string(strval));
}
free(key);
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)
{
if (plist && label) {
if (plist_get_node_type(plist) == PLIST_DICT)
- plist_dict_insert_item(plist, "Label", plist_new_string(label));
+ plist_dict_set_item(plist, "Label", plist_new_string(label));
}
}
@@ -186,8 +186,8 @@ lockdownd_error_t lockdownd_stop_session(lockdownd_client_t client, const char *
plist_t dict = plist_new_dict();
plist_dict_add_label(dict, client->label);
- plist_dict_insert_item(dict,"Request", plist_new_string("StopSession"));
- plist_dict_insert_item(dict,"SessionID", plist_new_string(session_id));
+ plist_dict_set_item(dict,"Request", plist_new_string("StopSession"));
+ plist_dict_set_item(dict,"SessionID", plist_new_string(session_id));
debug_info("stopping session %s", session_id);
@@ -368,7 +368,7 @@ lockdownd_error_t lockdownd_query_type(lockdownd_client_t client, char **type)
plist_t dict = plist_new_dict();
plist_dict_add_label(dict, client->label);
- plist_dict_insert_item(dict,"Request", plist_new_string("QueryType"));
+ plist_dict_set_item(dict,"Request", plist_new_string("QueryType"));
debug_info("called");
ret = lockdownd_send(client, dict);
@@ -426,12 +426,12 @@ lockdownd_error_t lockdownd_get_value(lockdownd_client_t client, const char *dom
dict = plist_new_dict();
plist_dict_add_label(dict, client->label);
if (domain) {
- plist_dict_insert_item(dict,"Domain", plist_new_string(domain));
+ plist_dict_set_item(dict,"Domain", plist_new_string(domain));
}
if (key) {
- plist_dict_insert_item(dict,"Key", plist_new_string(key));
+ plist_dict_set_item(dict,"Key", plist_new_string(key));
}
- plist_dict_insert_item(dict,"Request", plist_new_string("GetValue"));
+ plist_dict_set_item(dict,"Request", plist_new_string("GetValue"));
/* send to device */
ret = lockdownd_send(client, dict);
@@ -490,13 +490,13 @@ lockdownd_error_t lockdownd_set_value(lockdownd_client_t client, const char *dom
dict = plist_new_dict();
plist_dict_add_label(dict, client->label);
if (domain) {
- plist_dict_insert_item(dict,"Domain", plist_new_string(domain));
+ plist_dict_set_item(dict,"Domain", plist_new_string(domain));
}
if (key) {
- plist_dict_insert_item(dict,"Key", plist_new_string(key));
+ plist_dict_set_item(dict,"Key", plist_new_string(key));
}
- plist_dict_insert_item(dict,"Request", plist_new_string("SetValue"));
- plist_dict_insert_item(dict,"Value", value);
+ plist_dict_set_item(dict,"Request", plist_new_string("SetValue"));
+ plist_dict_set_item(dict,"Value", value);
/* send to device */
ret = lockdownd_send(client, dict);
@@ -549,12 +549,12 @@ lockdownd_error_t lockdownd_remove_value(lockdownd_client_t client, const char *
dict = plist_new_dict();
plist_dict_add_label(dict, client->label);
if (domain) {
- plist_dict_insert_item(dict,"Domain", plist_new_string(domain));
+ plist_dict_set_item(dict,"Domain", plist_new_string(domain));
}
if (key) {
- plist_dict_insert_item(dict,"Key", plist_new_string(key));
+ plist_dict_set_item(dict,"Key", plist_new_string(key));
}
- plist_dict_insert_item(dict,"Request", plist_new_string("RemoveValue"));
+ plist_dict_set_item(dict,"Request", plist_new_string("RemoveValue"));
/* send to device */
ret = lockdownd_send(client, dict);
@@ -818,11 +818,11 @@ static plist_t lockdownd_pair_record_to_plist(lockdownd_pair_record_t pair_recor
/* setup request plist */
plist_t dict = plist_new_dict();
- plist_dict_insert_item(dict, "DeviceCertificate", plist_new_data(pair_record->device_certificate, strlen(pair_record->device_certificate)));
- plist_dict_insert_item(dict, "HostCertificate", plist_new_data(pair_record->host_certificate, strlen(pair_record->host_certificate)));
- plist_dict_insert_item(dict, "HostID", plist_new_string(pair_record->host_id));
- plist_dict_insert_item(dict, "RootCertificate", plist_new_data(pair_record->root_certificate, strlen(pair_record->root_certificate)));
- plist_dict_insert_item(dict, "SystemBUID", plist_new_string(pair_record->system_buid));
+ plist_dict_set_item(dict, "DeviceCertificate", plist_new_data(pair_record->device_certificate, strlen(pair_record->device_certificate)));
+ plist_dict_set_item(dict, "HostCertificate", plist_new_data(pair_record->host_certificate, strlen(pair_record->host_certificate)));
+ plist_dict_set_item(dict, "HostID", plist_new_string(pair_record->host_id));
+ plist_dict_set_item(dict, "RootCertificate", plist_new_data(pair_record->root_certificate, strlen(pair_record->root_certificate)));
+ plist_dict_set_item(dict, "SystemBUID", plist_new_string(pair_record->system_buid));
return dict;
}
@@ -878,11 +878,11 @@ static lockdownd_error_t generate_pair_record_plist(lockdownd_client_t client, p
/* setup request plist */
*pair_record_plist = plist_new_dict();
- plist_dict_insert_item(*pair_record_plist, "DeviceCertificate", plist_new_data((const char*)device_cert.data, device_cert.size));
- plist_dict_insert_item(*pair_record_plist, "HostCertificate", plist_new_data((const char*)host_cert.data, host_cert.size));
- plist_dict_insert_item(*pair_record_plist, "HostID", plist_new_string(host_id));
- plist_dict_insert_item(*pair_record_plist, "RootCertificate", plist_new_data((const char*)root_cert.data, root_cert.size));
- plist_dict_insert_item(*pair_record_plist, "SystemBUID", plist_new_string(system_buid));
+ plist_dict_set_item(*pair_record_plist, "DeviceCertificate", plist_new_data((const char*)device_cert.data, device_cert.size));
+ plist_dict_set_item(*pair_record_plist, "HostCertificate", plist_new_data((const char*)host_cert.data, host_cert.size));
+ plist_dict_set_item(*pair_record_plist, "HostID", plist_new_string(host_id));
+ plist_dict_set_item(*pair_record_plist, "RootCertificate", plist_new_data((const char*)root_cert.data, root_cert.size));
+ plist_dict_set_item(*pair_record_plist, "SystemBUID", plist_new_string(system_buid));
leave:
if (host_id)
@@ -962,13 +962,13 @@ static lockdownd_error_t lockdownd_do_pair(lockdownd_client_t client, lockdownd_
/* setup pair request plist */
dict = plist_new_dict();
plist_dict_add_label(dict, client->label);
- plist_dict_insert_item(dict, "PairRecord", plist_copy(dict_record));
- plist_dict_insert_item(dict, "Request", plist_new_string(verb));
- plist_dict_insert_item(dict, "ProtocolVersion", plist_new_string(LOCKDOWN_PROTOCOL_VERSION));
+ plist_dict_set_item(dict, "PairRecord", plist_copy(dict_record));
+ plist_dict_set_item(dict, "Request", plist_new_string(verb));
+ plist_dict_set_item(dict, "ProtocolVersion", plist_new_string(LOCKDOWN_PROTOCOL_VERSION));
plist_t options = plist_new_dict();
- plist_dict_insert_item(options, "ExtendedPairingErrors", plist_new_bool(1));
- plist_dict_insert_item(dict, "PairingOptions", options);
+ plist_dict_set_item(options, "ExtendedPairingErrors", plist_new_bool(1));
+ plist_dict_set_item(dict, "PairingOptions", options);
/* send to device */
ret = lockdownd_send(client, dict);
@@ -1144,7 +1144,7 @@ lockdownd_error_t lockdownd_enter_recovery(lockdownd_client_t client)
plist_t dict = plist_new_dict();
plist_dict_add_label(dict, client->label);
- plist_dict_insert_item(dict,"Request", plist_new_string("EnterRecovery"));
+ plist_dict_set_item(dict,"Request", plist_new_string("EnterRecovery"));
debug_info("telling device to enter recovery mode");
@@ -1181,7 +1181,7 @@ lockdownd_error_t lockdownd_goodbye(lockdownd_client_t client)
plist_t dict = plist_new_dict();
plist_dict_add_label(dict, client->label);
- plist_dict_insert_item(dict,"Request", plist_new_string("Goodbye"));
+ plist_dict_set_item(dict,"Request", plist_new_string("Goodbye"));
debug_info("called");
@@ -1560,18 +1560,18 @@ lockdownd_error_t lockdownd_start_session(lockdownd_client_t client, const char
/* setup request plist */
dict = plist_new_dict();
plist_dict_add_label(dict, client->label);
- plist_dict_insert_item(dict,"Request", plist_new_string("StartSession"));
+ plist_dict_set_item(dict,"Request", plist_new_string("StartSession"));
/* add host id */
if (host_id) {
- plist_dict_insert_item(dict, "HostID", plist_new_string(host_id));
+ plist_dict_set_item(dict, "HostID", plist_new_string(host_id));
}
/* add system buid */
char *system_buid = NULL;
userpref_get_system_buid(&system_buid);
if (system_buid) {
- plist_dict_insert_item(dict, "SystemBUID", plist_new_string(system_buid));
+ plist_dict_set_item(dict, "SystemBUID", plist_new_string(system_buid));
if (system_buid) {
free(system_buid);
system_buid = NULL;
@@ -1685,8 +1685,8 @@ lockdownd_error_t lockdownd_start_service(lockdownd_client_t client, const char
dict = plist_new_dict();
plist_dict_add_label(dict, client->label);
- plist_dict_insert_item(dict,"Request", plist_new_string("StartService"));
- plist_dict_insert_item(dict,"Service", plist_new_string(identifier));
+ plist_dict_set_item(dict,"Request", plist_new_string("StartService"));
+ plist_dict_set_item(dict,"Service", plist_new_string(identifier));
/* send to device */
ret = lockdownd_send(client, dict);
@@ -1785,8 +1785,8 @@ lockdownd_error_t lockdownd_activate(lockdownd_client_t client, plist_t activati
plist_t dict = plist_new_dict();
plist_dict_add_label(dict, client->label);
- plist_dict_insert_item(dict,"Request", plist_new_string("Activate"));
- plist_dict_insert_item(dict,"ActivationRecord", plist_copy(activation_record));
+ plist_dict_set_item(dict,"Request", plist_new_string("Activate"));
+ plist_dict_set_item(dict,"ActivationRecord", plist_copy(activation_record));
ret = lockdownd_send(client, dict);
plist_free(dict);
@@ -1843,7 +1843,7 @@ lockdownd_error_t lockdownd_deactivate(lockdownd_client_t client)
plist_t dict = plist_new_dict();
plist_dict_add_label(dict, client->label);
- plist_dict_insert_item(dict,"Request", plist_new_string("Deactivate"));
+ plist_dict_set_item(dict,"Request", plist_new_string("Deactivate"));
ret = lockdownd_send(client, dict);
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)
client->last_error = MISAGENT_E_UNKNOWN_ERROR;
plist_t dict = plist_new_dict();
- plist_dict_insert_item(dict, "MessageType", plist_new_string("Install"));
- plist_dict_insert_item(dict, "Profile", plist_copy(profile));
- plist_dict_insert_item(dict, "ProfileType", plist_new_string("Provisioning"));
+ plist_dict_set_item(dict, "MessageType", plist_new_string("Install"));
+ plist_dict_set_item(dict, "Profile", plist_copy(profile));
+ plist_dict_set_item(dict, "ProfileType", plist_new_string("Provisioning"));
misagent_error_t res = misagent_error(property_list_service_send_xml_plist(client->parent, dict));
plist_free(dict);
@@ -227,8 +227,8 @@ misagent_error_t misagent_copy(misagent_client_t client, plist_t* profiles)
client->last_error = MISAGENT_E_UNKNOWN_ERROR;
plist_t dict = plist_new_dict();
- plist_dict_insert_item(dict, "MessageType", plist_new_string("Copy"));
- plist_dict_insert_item(dict, "ProfileType", plist_new_string("Provisioning"));
+ plist_dict_set_item(dict, "MessageType", plist_new_string("Copy"));
+ plist_dict_set_item(dict, "ProfileType", plist_new_string("Provisioning"));
misagent_error_t res = misagent_error(property_list_service_send_xml_plist(client->parent, dict));
plist_free(dict);
@@ -278,9 +278,9 @@ misagent_error_t misagent_remove(misagent_client_t client, const char* profileID
client->last_error = MISAGENT_E_UNKNOWN_ERROR;
plist_t dict = plist_new_dict();
- plist_dict_insert_item(dict, "MessageType", plist_new_string("Remove"));
- plist_dict_insert_item(dict, "ProfileID", plist_new_string(profileID));
- plist_dict_insert_item(dict, "ProfileType", plist_new_string("Provisioning"));
+ plist_dict_set_item(dict, "MessageType", plist_new_string("Remove"));
+ plist_dict_set_item(dict, "ProfileID", plist_new_string(profileID));
+ plist_dict_set_item(dict, "ProfileType", plist_new_string("Provisioning"));
misagent_error_t res = misagent_error(property_list_service_send_xml_plist(client->parent, dict));
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
mobile_image_mounter_lock(client);
plist_t dict = plist_new_dict();
- plist_dict_insert_item(dict,"Command", plist_new_string("LookupImage"));
- plist_dict_insert_item(dict,"ImageType", plist_new_string(image_type));
+ plist_dict_set_item(dict,"Command", plist_new_string("LookupImage"));
+ plist_dict_set_item(dict,"ImageType", plist_new_string(image_type));
mobile_image_mounter_error_t res = mobile_image_mounter_error(property_list_service_send_xml_plist(client->parent, dict));
plist_free(dict);
@@ -211,9 +211,9 @@ mobile_image_mounter_error_t mobile_image_mounter_upload_image(mobile_image_moun
plist_t result = NULL;
plist_t dict = plist_new_dict();
- plist_dict_insert_item(dict, "Command", plist_new_string("ReceiveBytes"));
- plist_dict_insert_item(dict, "ImageSize", plist_new_uint(image_size));
- plist_dict_insert_item(dict, "ImageType", plist_new_string(image_type));
+ plist_dict_set_item(dict, "Command", plist_new_string("ReceiveBytes"));
+ plist_dict_set_item(dict, "ImageSize", plist_new_uint(image_size));
+ plist_dict_set_item(dict, "ImageType", plist_new_string(image_type));
mobile_image_mounter_error_t res = mobile_image_mounter_error(property_list_service_send_xml_plist(client->parent, dict));
plist_free(dict);
@@ -340,10 +340,10 @@ mobile_image_mounter_error_t mobile_image_mounter_mount_image(mobile_image_mount
mobile_image_mounter_lock(client);
plist_t dict = plist_new_dict();
- plist_dict_insert_item(dict, "Command", plist_new_string("MountImage"));
- plist_dict_insert_item(dict, "ImagePath", plist_new_string(image_path));
- plist_dict_insert_item(dict, "ImageSignature", plist_new_data(image_signature, signature_length));
- plist_dict_insert_item(dict, "ImageType", plist_new_string(image_type));
+ plist_dict_set_item(dict, "Command", plist_new_string("MountImage"));
+ plist_dict_set_item(dict, "ImagePath", plist_new_string(image_path));
+ plist_dict_set_item(dict, "ImageSignature", plist_new_data(image_signature, signature_length));
+ plist_dict_set_item(dict, "ImageType", plist_new_string(image_type));
mobile_image_mounter_error_t res = mobile_image_mounter_error(property_list_service_send_xml_plist(client->parent, dict));
plist_free(dict);
@@ -382,7 +382,7 @@ mobile_image_mounter_error_t mobile_image_mounter_hangup(mobile_image_mounter_cl
mobile_image_mounter_lock(client);
plist_t dict = plist_new_dict();
- plist_dict_insert_item(dict, "Command", plist_new_string("Hangup"));
+ plist_dict_set_item(dict, "Command", plist_new_string("Hangup"));
mobile_image_mounter_error_t res = mobile_image_mounter_error(property_list_service_send_xml_plist(client->parent, dict));
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
} else {
dict = plist_new_dict();
}
- plist_dict_insert_item(dict, "BackupMessageTypeKey", plist_new_string(message));
+ plist_dict_set_item(dict, "BackupMessageTypeKey", plist_new_string(message));
/* send it as DLMessageProcessMessage */
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
/* construct request plist */
plist_t dict = plist_new_dict();
if (backup_manifest)
- plist_dict_insert_item(dict, "BackupManifestKey", plist_copy(backup_manifest));
- plist_dict_insert_item(dict, "BackupComputerBasePathKey", plist_new_string(base_path));
- plist_dict_insert_item(dict, "BackupMessageTypeKey", plist_new_string("BackupMessageBackupRequest"));
- plist_dict_insert_item(dict, "BackupProtocolVersion", plist_new_string(proto_version));
+ plist_dict_set_item(dict, "BackupManifestKey", plist_copy(backup_manifest));
+ plist_dict_set_item(dict, "BackupComputerBasePathKey", plist_new_string(base_path));
+ plist_dict_set_item(dict, "BackupMessageTypeKey", plist_new_string("BackupMessageBackupRequest"));
+ plist_dict_set_item(dict, "BackupProtocolVersion", plist_new_string(proto_version));
/* send request */
err = mobilebackup_send_message(client, NULL, dict);
@@ -409,13 +409,13 @@ mobilebackup_error_t mobilebackup_request_restore(mobilebackup_client_t client,
/* construct request plist */
plist_t dict = plist_new_dict();
- plist_dict_insert_item(dict, "BackupManifestKey", plist_copy(backup_manifest));
- plist_dict_insert_item(dict, "BackupMessageTypeKey", plist_new_string("kBackupMessageRestoreRequest"));
- plist_dict_insert_item(dict, "BackupProtocolVersion", plist_new_string(proto_version));
+ plist_dict_set_item(dict, "BackupManifestKey", plist_copy(backup_manifest));
+ plist_dict_set_item(dict, "BackupMessageTypeKey", plist_new_string("kBackupMessageRestoreRequest"));
+ plist_dict_set_item(dict, "BackupProtocolVersion", plist_new_string(proto_version));
/* add flags */
- plist_dict_insert_item(dict, "BackupNotifySpringBoard", plist_new_bool(IS_FLAG_SET(flags, MB_RESTORE_NOTIFY_SPRINGBOARD)));
- plist_dict_insert_item(dict, "BackupPreserveSettings", plist_new_bool(IS_FLAG_SET(flags, MB_RESTORE_PRESERVE_SETTINGS)));
- plist_dict_insert_item(dict, "BackupPreserveCameraRoll", plist_new_bool(IS_FLAG_SET(flags, MB_RESTORE_PRESERVE_CAMERA_ROLL)));
+ plist_dict_set_item(dict, "BackupNotifySpringBoard", plist_new_bool(IS_FLAG_SET(flags, MB_RESTORE_NOTIFY_SPRINGBOARD)));
+ plist_dict_set_item(dict, "BackupPreserveSettings", plist_new_bool(IS_FLAG_SET(flags, MB_RESTORE_PRESERVE_SETTINGS)));
+ plist_dict_set_item(dict, "BackupPreserveCameraRoll", plist_new_bool(IS_FLAG_SET(flags, MB_RESTORE_PRESERVE_CAMERA_ROLL)));
/* send request */
err = mobilebackup_send_message(client, NULL, dict);
@@ -572,7 +572,7 @@ mobilebackup_error_t mobilebackup_send_error(mobilebackup_client_t client, const
/* construct error plist */
plist_t dict = plist_new_dict();
- plist_dict_insert_item(dict, "BackupErrorReasonKey", plist_new_string(reason));
+ plist_dict_set_item(dict, "BackupErrorReasonKey", plist_new_string(reason));
err = mobilebackup_send_message(client, "BackupMessageError", dict);
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,
} else {
dict = plist_new_dict();
}
- plist_dict_insert_item(dict, "MessageName", plist_new_string(message));
+ plist_dict_set_item(dict, "MessageName", plist_new_string(message));
/* send it as DLMessageProcessMessage */
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
for (i = 0; i < count; i++) {
plist_array_append_item(array, plist_new_real(local_versions[i]));
}
- plist_dict_insert_item(dict, "SupportedProtocolVersions", array);
+ plist_dict_set_item(dict, "SupportedProtocolVersions", array);
mobilebackup2_error_t err = mobilebackup2_send_message(client, "Hello", dict);
plist_free(dict);
@@ -451,23 +451,23 @@ mobilebackup2_error_t mobilebackup2_send_request(mobilebackup2_client_t client,
return MOBILEBACKUP2_E_INVALID_ARG;
plist_t dict = plist_new_dict();
- plist_dict_insert_item(dict, "TargetIdentifier", plist_new_string(target_identifier));
+ plist_dict_set_item(dict, "TargetIdentifier", plist_new_string(target_identifier));
if (source_identifier) {
- plist_dict_insert_item(dict, "SourceIdentifier", plist_new_string(source_identifier));
+ plist_dict_set_item(dict, "SourceIdentifier", plist_new_string(source_identifier));
}
if (options) {
- plist_dict_insert_item(dict, "Options", plist_copy(options));
+ plist_dict_set_item(dict, "Options", plist_copy(options));
}
if (!strcmp(request, "Unback") && options) {
plist_t node = plist_dict_get_item(options, "Password");
if (node) {
- plist_dict_insert_item(dict, "Password", plist_copy(node));
+ plist_dict_set_item(dict, "Password", plist_copy(node));
}
}
if (!strcmp(request, "EnableCloudBackup") && options) {
plist_t node = plist_dict_get_item(options, "CloudBackupState");
if (node) {
- plist_dict_insert_item(dict, "CloudBackupState", plist_copy(node));
+ plist_dict_set_item(dict, "CloudBackupState", plist_copy(node));
}
}
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, ...)
plist_array_append_item(array, plist_new_string(entity_names[i]));
}
- plist_dict_insert_item(actions, key, array);
+ plist_dict_set_item(actions, key, array);
} else if (!strcmp(key, "SyncDeviceLinkAllRecordsOfPulledEntityTypeSentKey")) {
int link_records = va_arg(args, int);
- plist_dict_insert_item(actions, key, plist_new_bool(link_records));
+ plist_dict_set_item(actions, key, plist_new_bool(link_records));
}
free(key);
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)
np_lock(client);
plist_t dict = plist_new_dict();
- plist_dict_insert_item(dict,"Command", plist_new_string("PostNotification"));
- plist_dict_insert_item(dict,"Name", plist_new_string(notification));
+ plist_dict_set_item(dict,"Command", plist_new_string("PostNotification"));
+ plist_dict_set_item(dict,"Name", plist_new_string(notification));
np_error_t res = np_error(property_list_service_send_xml_plist(client->parent, dict));
plist_free(dict);
dict = plist_new_dict();
- plist_dict_insert_item(dict,"Command", plist_new_string("Shutdown"));
+ plist_dict_set_item(dict,"Command", plist_new_string("Shutdown"));
res = np_error(property_list_service_send_xml_plist(client->parent, dict));
plist_free(dict);
@@ -237,8 +237,8 @@ np_error_t np_observe_notification( np_client_t client, const char *notification
np_lock(client);
plist_t dict = plist_new_dict();
- plist_dict_insert_item(dict,"Command", plist_new_string("ObserveNotification"));
- plist_dict_insert_item(dict,"Name", plist_new_string(notification));
+ plist_dict_set_item(dict,"Command", plist_new_string("ObserveNotification"));
+ plist_dict_set_item(dict,"Name", plist_new_string(notification));
np_error_t res = np_error(property_list_service_send_xml_plist(client->parent, dict));
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)
{
if (plist && label) {
if (plist_get_node_type(plist) == PLIST_DICT)
- plist_dict_insert_item(plist, "Label", plist_new_string(label));
+ plist_dict_set_item(plist, "Label", plist_new_string(label));
}
}
@@ -218,7 +218,7 @@ restored_error_t restored_query_type(restored_client_t client, char **type, uint
plist_t dict = plist_new_dict();
plist_dict_add_label(dict, client->label);
- plist_dict_insert_item(dict,"Request", plist_new_string("QueryType"));
+ plist_dict_set_item(dict,"Request", plist_new_string("QueryType"));
debug_info("called");
ret = restored_send(client, dict);
@@ -289,9 +289,9 @@ restored_error_t restored_query_value(restored_client_t client, const char *key,
dict = plist_new_dict();
plist_dict_add_label(dict, client->label);
if (key) {
- plist_dict_insert_item(dict,"QueryKey", plist_new_string(key));
+ plist_dict_set_item(dict,"QueryKey", plist_new_string(key));
}
- plist_dict_insert_item(dict,"Request", plist_new_string("QueryValue"));
+ plist_dict_set_item(dict,"Request", plist_new_string("QueryValue"));
/* send to device */
ret = restored_send(client, dict);
@@ -422,7 +422,7 @@ restored_error_t restored_goodbye(restored_client_t client)
plist_t dict = plist_new_dict();
plist_dict_add_label(dict, client->label);
- plist_dict_insert_item(dict,"Request", plist_new_string("Goodbye"));
+ plist_dict_set_item(dict,"Request", plist_new_string("Goodbye"));
debug_info("called");
@@ -465,11 +465,11 @@ restored_error_t restored_start_restore(restored_client_t client, plist_t option
dict = plist_new_dict();
plist_dict_add_label(dict, client->label);
- plist_dict_insert_item(dict,"Request", plist_new_string("StartRestore"));
+ plist_dict_set_item(dict,"Request", plist_new_string("StartRestore"));
if (options) {
- plist_dict_insert_item(dict, "RestoreOptions", plist_copy(options));
+ plist_dict_set_item(dict, "RestoreOptions", plist_copy(options));
}
- plist_dict_insert_item(dict,"RestoreProtocolVersion", plist_new_uint(version));
+ plist_dict_set_item(dict,"RestoreProtocolVersion", plist_new_uint(version));
/* send to device */
ret = restored_send(client, dict);
@@ -497,7 +497,7 @@ restored_error_t restored_reboot(restored_client_t client)
dict = plist_new_dict();
plist_dict_add_label(dict, client->label);
- plist_dict_insert_item(dict,"Request", plist_new_string("Reboot"));
+ plist_dict_set_item(dict,"Request", plist_new_string("Reboot"));
/* send to device */
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
sbservices_error_t res = SBSERVICES_E_UNKNOWN_ERROR;
plist_t dict = plist_new_dict();
- plist_dict_insert_item(dict, "command", plist_new_string("getIconState"));
+ plist_dict_set_item(dict, "command", plist_new_string("getIconState"));
if (format_version) {
- plist_dict_insert_item(dict, "formatVersion", plist_new_string(format_version));
+ plist_dict_set_item(dict, "formatVersion", plist_new_string(format_version));
}
sbs_lock(client);
@@ -216,8 +216,8 @@ sbservices_error_t sbservices_set_icon_state(sbservices_client_t client, plist_t
sbservices_error_t res = SBSERVICES_E_UNKNOWN_ERROR;
plist_t dict = plist_new_dict();
- plist_dict_insert_item(dict, "command", plist_new_string("setIconState"));
- plist_dict_insert_item(dict, "iconState", plist_copy(newstate));
+ plist_dict_set_item(dict, "command", plist_new_string("setIconState"));
+ plist_dict_set_item(dict, "iconState", plist_copy(newstate));
sbs_lock(client);
@@ -257,8 +257,8 @@ sbservices_error_t sbservices_get_icon_pngdata(sbservices_client_t client, const
sbservices_error_t res = SBSERVICES_E_UNKNOWN_ERROR;
plist_t dict = plist_new_dict();
- plist_dict_insert_item(dict, "command", plist_new_string("getIconPNGData"));
- plist_dict_insert_item(dict, "bundleId", plist_new_string(bundleId));
+ plist_dict_set_item(dict, "command", plist_new_string("getIconPNGData"));
+ plist_dict_set_item(dict, "bundleId", plist_new_string(bundleId));
sbs_lock(client);
@@ -303,7 +303,7 @@ sbservices_error_t sbservices_get_interface_orientation(sbservices_client_t clie
sbservices_error_t res = SBSERVICES_E_UNKNOWN_ERROR;
plist_t dict = plist_new_dict();
- plist_dict_insert_item(dict, "command", plist_new_string("getInterfaceOrientation"));
+ plist_dict_set_item(dict, "command", plist_new_string("getInterfaceOrientation"));
sbs_lock(client);
@@ -355,7 +355,7 @@ sbservices_error_t sbservices_get_home_screen_wallpaper_pngdata(sbservices_clien
sbservices_error_t res = SBSERVICES_E_UNKNOWN_ERROR;
plist_t dict = plist_new_dict();
- plist_dict_insert_item(dict, "command", plist_new_string("getHomeScreenWallpaperPNGData"));
+ plist_dict_set_item(dict, "command", plist_new_string("getHomeScreenWallpaperPNGData"));
sbs_lock(client);
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
screenshotr_error_t res = SCREENSHOTR_E_UNKNOWN_ERROR;
plist_t dict = plist_new_dict();
- plist_dict_insert_item(dict, "MessageType", plist_new_string("ScreenShotRequest"));
+ plist_dict_set_item(dict, "MessageType", plist_new_string("ScreenShotRequest"));
res = screenshotr_error(device_link_service_send_process_message(client->parent, dict));
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
plist_t outplist = plist_new_dict();
if (!is_final_message) {
/* split packet into partial chunks */
- plist_dict_insert_item(outplist, "WIRPartialMessageKey", plist_new_data(packet + offset, WEBINSPECTOR_PARTIAL_PACKET_CHUNK_SIZE));
+ plist_dict_set_item(outplist, "WIRPartialMessageKey", plist_new_data(packet + offset, WEBINSPECTOR_PARTIAL_PACKET_CHUNK_SIZE));
offset += WEBINSPECTOR_PARTIAL_PACKET_CHUNK_SIZE;
packet_length -= WEBINSPECTOR_PARTIAL_PACKET_CHUNK_SIZE;
} else {
/* send final chunk */
- plist_dict_insert_item(outplist, "WIRFinalMessageKey", plist_new_data(packet + offset, packet_length));
+ plist_dict_set_item(outplist, "WIRFinalMessageKey", plist_new_data(packet + offset, packet_length));
offset += packet_length;
packet_length -= packet_length;
}
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)
/* set fields we understand */
value_node = plist_dict_get_item(root_node, "BuildVersion");
- plist_dict_insert_item(ret, "Build Version", plist_copy(value_node));
+ plist_dict_set_item(ret, "Build Version", plist_copy(value_node));
value_node = plist_dict_get_item(root_node, "DeviceName");
- plist_dict_insert_item(ret, "Device Name", plist_copy(value_node));
- plist_dict_insert_item(ret, "Display Name", plist_copy(value_node));
+ plist_dict_set_item(ret, "Device Name", plist_copy(value_node));
+ plist_dict_set_item(ret, "Display Name", plist_copy(value_node));
/* FIXME: How is the GUID generated? */
- plist_dict_insert_item(ret, "GUID", plist_new_string("---"));
+ plist_dict_set_item(ret, "GUID", plist_new_string("---"));
value_node = plist_dict_get_item(root_node, "InternationalMobileEquipmentIdentity");
if (value_node)
- plist_dict_insert_item(ret, "IMEI", plist_copy(value_node));
+ plist_dict_set_item(ret, "IMEI", plist_copy(value_node));
- plist_dict_insert_item(ret, "Last Backup Date", plist_new_date(time(NULL), 0));
+ plist_dict_set_item(ret, "Last Backup Date", plist_new_date(time(NULL), 0));
value_node = plist_dict_get_item(root_node, "ProductType");
- plist_dict_insert_item(ret, "Product Type", plist_copy(value_node));
+ plist_dict_set_item(ret, "Product Type", plist_copy(value_node));
value_node = plist_dict_get_item(root_node, "ProductVersion");
- plist_dict_insert_item(ret, "Product Version", plist_copy(value_node));
+ plist_dict_set_item(ret, "Product Version", plist_copy(value_node));
value_node = plist_dict_get_item(root_node, "SerialNumber");
- plist_dict_insert_item(ret, "Serial Number", plist_copy(value_node));
+ plist_dict_set_item(ret, "Serial Number", plist_copy(value_node));
value_node = plist_dict_get_item(root_node, "UniqueDeviceID");
- plist_dict_insert_item(ret, "Target Identifier", plist_new_string(udid));
+ plist_dict_set_item(ret, "Target Identifier", plist_new_string(udid));
/* uppercase */
udid_uppercase = str_toupper((char*)udid);
- plist_dict_insert_item(ret, "Unique Identifier", plist_new_string(udid_uppercase));
+ plist_dict_set_item(ret, "Unique Identifier", plist_new_string(udid_uppercase));
free(udid_uppercase);
/* FIXME: Embed files as <data> nodes */
plist_t files = plist_new_dict();
- plist_dict_insert_item(ret, "iTunes Files", files);
- plist_dict_insert_item(ret, "iTunes Version", plist_new_string("9.0.2"));
+ plist_dict_set_item(ret, "iTunes Files", files);
+ plist_dict_set_item(ret, "iTunes Version", plist_new_string("9.0.2"));
plist_free(root_node);
@@ -466,7 +466,7 @@ static void mobilebackup_write_status(const char *path, int status)
{
struct stat st;
plist_t status_plist = plist_new_dict();
- plist_dict_insert_item(status_plist, "Backup Success", plist_new_bool(status));
+ plist_dict_set_item(status_plist, "Backup Success", plist_new_bool(status));
char *file_path = mobilebackup_build_path(path, "Status", ".plist");
if (stat(file_path, &st) == 0)
@@ -1509,12 +1509,12 @@ files_out:
printf("Restoring file %s %d/%d (%d%%)... ", file_path, cur_file, total_files, (cur_file*100/total_files));
/* add additional device link file information keys */
- plist_dict_insert_item(file_info, "DLFileAttributesKey", plist_copy(node));
- plist_dict_insert_item(file_info, "DLFileSource", plist_new_string(file_info_path));
- plist_dict_insert_item(file_info, "DLFileDest", plist_new_string("/tmp/RestoreFile.plist"));
- plist_dict_insert_item(file_info, "DLFileIsEncrypted", plist_new_bool(is_encrypted));
- plist_dict_insert_item(file_info, "DLFileOffsetKey", plist_new_uint(file_offset));
- plist_dict_insert_item(file_info, "DLFileStatusKey", plist_new_uint(file_status));
+ plist_dict_set_item(file_info, "DLFileAttributesKey", plist_copy(node));
+ plist_dict_set_item(file_info, "DLFileSource", plist_new_string(file_info_path));
+ plist_dict_set_item(file_info, "DLFileDest", plist_new_string("/tmp/RestoreFile.plist"));
+ plist_dict_set_item(file_info, "DLFileIsEncrypted", plist_new_bool(is_encrypted));
+ plist_dict_set_item(file_info, "DLFileOffsetKey", plist_new_uint(file_offset));
+ plist_dict_set_item(file_info, "DLFileStatusKey", plist_new_uint(file_status));
/* read data from file */
free(file_info_path);
@@ -1531,10 +1531,10 @@ files_out:
file_status = DEVICE_LINK_FILE_STATUS_HUNK;
plist_dict_remove_item(file_info, "DLFileOffsetKey");
- plist_dict_insert_item(file_info, "DLFileOffsetKey", plist_new_uint(file_offset));
+ plist_dict_set_item(file_info, "DLFileOffsetKey", plist_new_uint(file_offset));
plist_dict_remove_item(file_info, "DLFileStatusKey");
- plist_dict_insert_item(file_info, "DLFileStatusKey", plist_new_uint(file_status));
+ plist_dict_set_item(file_info, "DLFileStatusKey", plist_new_uint(file_status));
send_file_node = plist_new_array();
@@ -1615,8 +1615,8 @@ files_out:
tmp_node = plist_dict_get_item(node, "AppInfo");
dict = plist_new_dict();
- plist_dict_insert_item(dict, "AppInfo", plist_copy(tmp_node));
- plist_dict_insert_item(dict, "BackupMessageTypeKey", plist_new_string("BackupMessageRestoreApplicationSent"));
+ plist_dict_set_item(dict, "AppInfo", plist_copy(tmp_node));
+ plist_dict_set_item(dict, "BackupMessageTypeKey", plist_new_string("BackupMessageRestoreApplicationSent"));
array = plist_new_array();
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
/* set fields we understand */
value_node = plist_dict_get_item(root_node, "BuildVersion");
- plist_dict_insert_item(ret, "Build Version", plist_copy(value_node));
+ plist_dict_set_item(ret, "Build Version", plist_copy(value_node));
value_node = plist_dict_get_item(root_node, "DeviceName");
- plist_dict_insert_item(ret, "Device Name", plist_copy(value_node));
- plist_dict_insert_item(ret, "Display Name", plist_copy(value_node));
+ plist_dict_set_item(ret, "Device Name", plist_copy(value_node));
+ plist_dict_set_item(ret, "Display Name", plist_copy(value_node));
/* FIXME: How is the GUID generated? */
- plist_dict_insert_item(ret, "GUID", plist_new_string("---"));
+ plist_dict_set_item(ret, "GUID", plist_new_string("---"));
value_node = plist_dict_get_item(root_node, "IntegratedCircuitCardIdentity");
if (value_node)
- plist_dict_insert_item(ret, "ICCID", plist_copy(value_node));
+ plist_dict_set_item(ret, "ICCID", plist_copy(value_node));
value_node = plist_dict_get_item(root_node, "InternationalMobileEquipmentIdentity");
if (value_node)
- plist_dict_insert_item(ret, "IMEI", plist_copy(value_node));
+ plist_dict_set_item(ret, "IMEI", plist_copy(value_node));
- plist_dict_insert_item(ret, "Last Backup Date", plist_new_date(time(NULL), 0));
+ plist_dict_set_item(ret, "Last Backup Date", plist_new_date(time(NULL), 0));
value_node = plist_dict_get_item(root_node, "PhoneNumber");
if (value_node && (plist_get_node_type(value_node) == PLIST_STRING)) {
- plist_dict_insert_item(ret, "Phone Number", plist_copy(value_node));
+ plist_dict_set_item(ret, "Phone Number", plist_copy(value_node));
}
value_node = plist_dict_get_item(root_node, "ProductType");
- plist_dict_insert_item(ret, "Product Type", plist_copy(value_node));
+ plist_dict_set_item(ret, "Product Type", plist_copy(value_node));
value_node = plist_dict_get_item(root_node, "ProductVersion");
- plist_dict_insert_item(ret, "Product Version", plist_copy(value_node));
+ plist_dict_set_item(ret, "Product Version", plist_copy(value_node));
value_node = plist_dict_get_item(root_node, "SerialNumber");
- plist_dict_insert_item(ret, "Serial Number", plist_copy(value_node));
+ plist_dict_set_item(ret, "Serial Number", plist_copy(value_node));
/* FIXME Sync Settings? */
value_node = plist_dict_get_item(root_node, "UniqueDeviceID");
- plist_dict_insert_item(ret, "Target Identifier", plist_new_string(udid));
+ plist_dict_set_item(ret, "Target Identifier", plist_new_string(udid));
- plist_dict_insert_item(ret, "Target Type", plist_new_string("Device"));
+ plist_dict_set_item(ret, "Target Type", plist_new_string("Device"));
/* uppercase */
udid_uppercase = str_toupper((char*)udid);
- plist_dict_insert_item(ret, "Unique Identifier", plist_new_string(udid_uppercase));
+ plist_dict_set_item(ret, "Unique Identifier", plist_new_string(udid_uppercase));
free(udid_uppercase);
char *data_buf = NULL;
uint64_t data_size = 0;
mobilebackup_afc_get_file_contents(afc, "/Books/iBooksData2.plist", &data_buf, &data_size);
if (data_buf) {
- plist_dict_insert_item(ret, "iBooks Data 2", plist_new_data(data_buf, data_size));
+ plist_dict_set_item(ret, "iBooks Data 2", plist_new_data(data_buf, data_size));
free(data_buf);
}
@@ -352,17 +352,17 @@ static plist_t mobilebackup_factory_info_plist_new(const char* udid, lockdownd_c
mobilebackup_afc_get_file_contents(afc, fname, &data_buf, &data_size);
free(fname);
if (data_buf) {
- plist_dict_insert_item(files, itunesfiles[i], plist_new_data(data_buf, data_size));
+ plist_dict_set_item(files, itunesfiles[i], plist_new_data(data_buf, data_size));
free(data_buf);
}
}
- plist_dict_insert_item(ret, "iTunes Files", files);
+ plist_dict_set_item(ret, "iTunes Files", files);
plist_t itunes_settings = NULL;
lockdownd_get_value(lockdown, "com.apple.iTunes", NULL, &itunes_settings);
- plist_dict_insert_item(ret, "iTunes Settings", itunes_settings ? itunes_settings : plist_new_dict());
+ plist_dict_set_item(ret, "iTunes Settings", itunes_settings ? itunes_settings : plist_new_dict());
- plist_dict_insert_item(ret, "iTunes Version", plist_new_string("10.0.1"));
+ plist_dict_set_item(ret, "iTunes Version", plist_new_string("10.0.1"));
plist_free(root_node);
@@ -589,9 +589,9 @@ static void mb2_multi_status_add_file_error(plist_t status_dict, const char *pat
{
if (!status_dict) return;
plist_t filedict = plist_new_dict();
- plist_dict_insert_item(filedict, "DLFileErrorString", plist_new_string(error_message));
- plist_dict_insert_item(filedict, "DLFileErrorCode", plist_new_uint(error_code));
- plist_dict_insert_item(status_dict, path, filedict);
+ plist_dict_set_item(filedict, "DLFileErrorString", plist_new_string(error_message));
+ plist_dict_set_item(filedict, "DLFileErrorCode", plist_new_uint(error_code));
+ plist_dict_set_item(status_dict, path, filedict);
}
static int errno_to_device_error(int errno_value)
@@ -1055,11 +1055,11 @@ static void mb2_handle_list_directory(mobilebackup2_client_t mobilebackup2, plis
} else if (S_ISREG(st.st_mode)) {
ftype = "DLFileTypeRegular";
}
- plist_dict_insert_item(fdict, "DLFileType", plist_new_string(ftype));
- plist_dict_insert_item(fdict, "DLFileSize", plist_new_uint(st.st_size));
- plist_dict_insert_item(fdict, "DLFileModificationDate", plist_new_date(st.st_mtime, 0));
+ plist_dict_set_item(fdict, "DLFileType", plist_new_string(ftype));
+ plist_dict_set_item(fdict, "DLFileSize", plist_new_uint(st.st_size));
+ plist_dict_set_item(fdict, "DLFileModificationDate", plist_new_date(st.st_mtime, 0));
- plist_dict_insert_item(dirlist, ep->d_name, fdict);
+ plist_dict_set_item(dirlist, ep->d_name, fdict);
free(fpath);
}
}
@@ -1719,7 +1719,7 @@ checkpoint:
switch(cmd) {
case CMD_CLOUD:
opts = plist_new_dict();
- plist_dict_insert_item(opts, "CloudBackupState", plist_new_bool(cmd_flags & CMD_FLAG_CLOUD_ENABLE ? 1: 0));
+ plist_dict_set_item(opts, "CloudBackupState", plist_new_bool(cmd_flags & CMD_FLAG_CLOUD_ENABLE ? 1: 0));
err = mobilebackup2_send_request(mobilebackup2, "EnableCloudBackup", udid, source_udid, opts);
plist_free(opts);
opts = NULL;
@@ -1767,7 +1767,7 @@ checkpoint:
if (cmd_flags & CMD_FLAG_FORCE_FULL_BACKUP) {
PRINT_VERBOSE(1, "Enforcing full backup from device.\n");
opts = plist_new_dict();
- plist_dict_insert_item(opts, "ForceFullBackup", plist_new_bool(1));
+ plist_dict_set_item(opts, "ForceFullBackup", plist_new_bool(1));
}
/* request backup from device with manifest from last backup */
if (willEncrypt) {
@@ -1809,21 +1809,21 @@ checkpoint:
PRINT_VERBOSE(1, "Starting Restore...\n");
opts = plist_new_dict();
- plist_dict_insert_item(opts, "RestoreSystemFiles", plist_new_bool(cmd_flags & CMD_FLAG_RESTORE_SYSTEM_FILES));
+ plist_dict_set_item(opts, "RestoreSystemFiles", plist_new_bool(cmd_flags & CMD_FLAG_RESTORE_SYSTEM_FILES));
PRINT_VERBOSE(1, "Restoring system files: %s\n", (cmd_flags & CMD_FLAG_RESTORE_SYSTEM_FILES ? "Yes":"No"));
if ((cmd_flags & CMD_FLAG_RESTORE_REBOOT) == 0)
- plist_dict_insert_item(opts, "RestoreShouldReboot", plist_new_bool(0));
+ plist_dict_set_item(opts, "RestoreShouldReboot", plist_new_bool(0));
PRINT_VERBOSE(1, "Rebooting after restore: %s\n", (cmd_flags & CMD_FLAG_RESTORE_REBOOT ? "Yes":"No"));
if ((cmd_flags & CMD_FLAG_RESTORE_COPY_BACKUP) == 0)
- plist_dict_insert_item(opts, "RestoreDontCopyBackup", plist_new_bool(1));
+ plist_dict_set_item(opts, "RestoreDontCopyBackup", plist_new_bool(1));
PRINT_VERBOSE(1, "Don't copy backup: %s\n", ((cmd_flags & CMD_FLAG_RESTORE_COPY_BACKUP) == 0 ? "Yes":"No"));
- plist_dict_insert_item(opts, "RestorePreserveSettings", plist_new_bool((cmd_flags & CMD_FLAG_RESTORE_SETTINGS) == 0));
+ plist_dict_set_item(opts, "RestorePreserveSettings", plist_new_bool((cmd_flags & CMD_FLAG_RESTORE_SETTINGS) == 0));
PRINT_VERBOSE(1, "Preserve settings of device: %s\n", ((cmd_flags & CMD_FLAG_RESTORE_SETTINGS) == 0 ? "Yes":"No"));
if (cmd_flags & CMD_FLAG_RESTORE_REMOVE_ITEMS)
- plist_dict_insert_item(opts, "RemoveItemsNotRestored", plist_new_bool(1));
+ plist_dict_set_item(opts, "RemoveItemsNotRestored", plist_new_bool(1));
PRINT_VERBOSE(1, "Remove items that are not restored: %s\n", ((cmd_flags & CMD_FLAG_RESTORE_REMOVE_ITEMS) ? "Yes":"No"));
if (backup_password != NULL) {
- plist_dict_insert_item(opts, "Password", plist_new_string(backup_password));
+ plist_dict_set_item(opts, "Password", plist_new_string(backup_password));
}
PRINT_VERBOSE(1, "Backup password: %s\n", (backup_password == NULL ? "No":"Yes"));
@@ -1860,7 +1860,7 @@ checkpoint:
PRINT_VERBOSE(1, "Starting to unpack backup...\n");
if (backup_password != NULL) {
opts = plist_new_dict();
- plist_dict_insert_item(opts, "Password", plist_new_string(backup_password));
+ plist_dict_set_item(opts, "Password", plist_new_string(backup_password));
}
PRINT_VERBOSE(1, "Backup password: %s\n", (backup_password == NULL ? "No":"Yes"));
err = mobilebackup2_send_request(mobilebackup2, "Unback", udid, source_udid, opts);
@@ -1874,7 +1874,7 @@ checkpoint:
break;
case CMD_CHANGEPW:
opts = plist_new_dict();
- plist_dict_insert_item(opts, "TargetIdentifier", plist_new_string(udid));
+ plist_dict_set_item(opts, "TargetIdentifier", plist_new_string(udid));
if (cmd_flags & CMD_FLAG_ENCRYPTION_ENABLE) {
if (!willEncrypt) {
if (!newpw) {
@@ -1924,10 +1924,10 @@ checkpoint:
}
}
if (newpw) {
- plist_dict_insert_item(opts, "NewPassword", plist_new_string(newpw));
+ plist_dict_set_item(opts, "NewPassword", plist_new_string(newpw));
}
if (backup_password) {
- plist_dict_insert_item(opts, "OldPassword", plist_new_string(backup_password));
+ plist_dict_set_item(opts, "OldPassword", plist_new_string(backup_password));
}
if (newpw || backup_password) {
mobilebackup2_send_message(mobilebackup2, "ChangePassword", opts);