summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2015-01-27 21:40:04 +0100
committerGravatar Martin Szulecki2015-01-27 22:01:23 +0100
commit294dea4eaa847527c5940e402a0c5cff35026e9e (patch)
tree081ba0cb8403876251369946f597e7de6c8e1428
parent73b36cce1475c7465a1407ccc29f0526699035b9 (diff)
downloadlibimobiledevice-294dea4eaa847527c5940e402a0c5cff35026e9e.tar.gz
libimobiledevice-294dea4eaa847527c5940e402a0c5cff35026e9e.tar.bz2
installation_proxy: Use char* array to pass capabilities for related method
-rw-r--r--include/libimobiledevice/installation_proxy.h6
-rw-r--r--src/installation_proxy.c13
2 files changed, 14 insertions, 5 deletions
diff --git a/include/libimobiledevice/installation_proxy.h b/include/libimobiledevice/installation_proxy.h
index 9ce0490..779cfb7 100644
--- a/include/libimobiledevice/installation_proxy.h
+++ b/include/libimobiledevice/installation_proxy.h
@@ -373,8 +373,8 @@ instproxy_error_t instproxy_remove_archive(instproxy_client_t client, const char
* Checks a device for certain capabilities.
*
* @param client The connected installation_proxy client
- * @param capabilities A PLIST_ARRAY with PLIST_STRINGs of capability names.
- * The capabilities are passed through and queried from MobileGestalt.
+ * @param capabilities An array of char* with capability names that MUST have a
+ * terminating NULL entry.
* @param client_options The client options to use, as PLIST_DICT, or NULL.
* Currently there are no known client options, so pass NULL here.
* @param result Pointer that will be set to a plist containing a PLIST_DICT
@@ -383,7 +383,7 @@ instproxy_error_t instproxy_remove_archive(instproxy_client_t client, const char
* @return INSTPROXY_E_SUCCESS on success or an INSTPROXY_E_* error value if
* an error occured.
*/
-instproxy_error_t instproxy_check_capabilities_match(instproxy_client_t client, plist_t capabilities, plist_t client_options, plist_t *result);
+instproxy_error_t instproxy_check_capabilities_match(instproxy_client_t client, const char** capabilities, plist_t client_options, plist_t *result);
/* Helper */
diff --git a/src/installation_proxy.c b/src/installation_proxy.c
index 76eb0ba..c60e6b5 100644
--- a/src/installation_proxy.c
+++ b/src/installation_proxy.c
@@ -770,7 +770,7 @@ LIBIMOBILEDEVICE_API instproxy_error_t instproxy_remove_archive(instproxy_client
return res;
}
-LIBIMOBILEDEVICE_API instproxy_error_t instproxy_check_capabilities_match(instproxy_client_t client, plist_t capabilities, plist_t client_options, plist_t *result)
+LIBIMOBILEDEVICE_API instproxy_error_t instproxy_check_capabilities_match(instproxy_client_t client, const char** capabilities, plist_t client_options, plist_t *result)
{
if (!capabilities || (plist_get_node_type(capabilities) != PLIST_ARRAY && plist_get_node_type(capabilities) != PLIST_DICT))
return INSTPROXY_E_INVALID_ARG;
@@ -783,7 +783,16 @@ LIBIMOBILEDEVICE_API instproxy_error_t instproxy_check_capabilities_match(instpr
plist_dict_set_item(command, "Command", plist_new_string("CheckCapabilitiesMatch"));
if (client_options)
plist_dict_set_item(command, "ClientOptions", plist_copy(client_options));
- plist_dict_set_item(command, "Capabilities", plist_copy(capabilities));
+
+ if (capabilities) {
+ int i = 0;
+ plist_t capabilities_array = plist_new_array();
+ while (capabilities[i]) {
+ plist_array_append_item(capabilities_array, plist_new_string(capabilities[i]));
+ i++;
+ }
+ plist_dict_set_item(command, "Capabilities", capabilities_array);
+ }
res = instproxy_perform_command(client, command, INSTPROXY_COMMAND_TYPE_SYNC, instproxy_copy_lookup_result_cb, (void*)&lookup_result);