diff options
| author | 2015-01-27 21:40:04 +0100 | |
|---|---|---|
| committer | 2015-01-27 22:01:23 +0100 | |
| commit | 294dea4eaa847527c5940e402a0c5cff35026e9e (patch) | |
| tree | 081ba0cb8403876251369946f597e7de6c8e1428 | |
| parent | 73b36cce1475c7465a1407ccc29f0526699035b9 (diff) | |
| download | libimobiledevice-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.h | 6 | ||||
| -rw-r--r-- | src/installation_proxy.c | 13 |
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 | |||
| 373 | * Checks a device for certain capabilities. | 373 | * Checks a device for certain capabilities. |
| 374 | * | 374 | * |
| 375 | * @param client The connected installation_proxy client | 375 | * @param client The connected installation_proxy client |
| 376 | * @param capabilities A PLIST_ARRAY with PLIST_STRINGs of capability names. | 376 | * @param capabilities An array of char* with capability names that MUST have a |
| 377 | * The capabilities are passed through and queried from MobileGestalt. | 377 | * terminating NULL entry. |
| 378 | * @param client_options The client options to use, as PLIST_DICT, or NULL. | 378 | * @param client_options The client options to use, as PLIST_DICT, or NULL. |
| 379 | * Currently there are no known client options, so pass NULL here. | 379 | * Currently there are no known client options, so pass NULL here. |
| 380 | * @param result Pointer that will be set to a plist containing a PLIST_DICT | 380 | * @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 | |||
| 383 | * @return INSTPROXY_E_SUCCESS on success or an INSTPROXY_E_* error value if | 383 | * @return INSTPROXY_E_SUCCESS on success or an INSTPROXY_E_* error value if |
| 384 | * an error occured. | 384 | * an error occured. |
| 385 | */ | 385 | */ |
| 386 | instproxy_error_t instproxy_check_capabilities_match(instproxy_client_t client, plist_t capabilities, plist_t client_options, plist_t *result); | 386 | instproxy_error_t instproxy_check_capabilities_match(instproxy_client_t client, const char** capabilities, plist_t client_options, plist_t *result); |
| 387 | 387 | ||
| 388 | /* Helper */ | 388 | /* Helper */ |
| 389 | 389 | ||
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 | |||
| 770 | return res; | 770 | return res; |
| 771 | } | 771 | } |
| 772 | 772 | ||
| 773 | LIBIMOBILEDEVICE_API instproxy_error_t instproxy_check_capabilities_match(instproxy_client_t client, plist_t capabilities, plist_t client_options, plist_t *result) | 773 | LIBIMOBILEDEVICE_API instproxy_error_t instproxy_check_capabilities_match(instproxy_client_t client, const char** capabilities, plist_t client_options, plist_t *result) |
| 774 | { | 774 | { |
| 775 | if (!capabilities || (plist_get_node_type(capabilities) != PLIST_ARRAY && plist_get_node_type(capabilities) != PLIST_DICT)) | 775 | if (!capabilities || (plist_get_node_type(capabilities) != PLIST_ARRAY && plist_get_node_type(capabilities) != PLIST_DICT)) |
| 776 | return INSTPROXY_E_INVALID_ARG; | 776 | return INSTPROXY_E_INVALID_ARG; |
| @@ -783,7 +783,16 @@ LIBIMOBILEDEVICE_API instproxy_error_t instproxy_check_capabilities_match(instpr | |||
| 783 | plist_dict_set_item(command, "Command", plist_new_string("CheckCapabilitiesMatch")); | 783 | plist_dict_set_item(command, "Command", plist_new_string("CheckCapabilitiesMatch")); |
| 784 | if (client_options) | 784 | if (client_options) |
| 785 | plist_dict_set_item(command, "ClientOptions", plist_copy(client_options)); | 785 | plist_dict_set_item(command, "ClientOptions", plist_copy(client_options)); |
| 786 | plist_dict_set_item(command, "Capabilities", plist_copy(capabilities)); | 786 | |
| 787 | if (capabilities) { | ||
| 788 | int i = 0; | ||
| 789 | plist_t capabilities_array = plist_new_array(); | ||
| 790 | while (capabilities[i]) { | ||
| 791 | plist_array_append_item(capabilities_array, plist_new_string(capabilities[i])); | ||
| 792 | i++; | ||
| 793 | } | ||
| 794 | plist_dict_set_item(command, "Capabilities", capabilities_array); | ||
| 795 | } | ||
| 787 | 796 | ||
| 788 | res = instproxy_perform_command(client, command, INSTPROXY_COMMAND_TYPE_SYNC, instproxy_copy_lookup_result_cb, (void*)&lookup_result); | 797 | res = instproxy_perform_command(client, command, INSTPROXY_COMMAND_TYPE_SYNC, instproxy_copy_lookup_result_cb, (void*)&lookup_result); |
| 789 | 798 | ||
