diff options
Diffstat (limited to 'include/libimobiledevice/installation_proxy.h')
| -rw-r--r-- | include/libimobiledevice/installation_proxy.h | 117 |
1 files changed, 113 insertions, 4 deletions
diff --git a/include/libimobiledevice/installation_proxy.h b/include/libimobiledevice/installation_proxy.h index 82af71b..6810978 100644 --- a/include/libimobiledevice/installation_proxy.h +++ b/include/libimobiledevice/installation_proxy.h | |||
| @@ -3,7 +3,8 @@ | |||
| 3 | * @brief Manage applications on a device. | 3 | * @brief Manage applications on a device. |
| 4 | * \internal | 4 | * \internal |
| 5 | * | 5 | * |
| 6 | * Copyright (c) 2009 Nikias Bassen All Rights Reserved. | 6 | * Copyright (c) 2010-2015 Martin Szulecki All Rights Reserved. |
| 7 | * Copyright (c) 2010-2013 Nikias Bassen All Rights Reserved. | ||
| 7 | * | 8 | * |
| 8 | * This library is free software; you can redistribute it and/or | 9 | * This library is free software; you can redistribute it and/or |
| 9 | * modify it under the terms of the GNU Lesser General Public | 10 | * modify it under the terms of the GNU Lesser General Public |
| @@ -107,8 +108,8 @@ typedef enum { | |||
| 107 | typedef struct instproxy_client_private instproxy_client_private; | 108 | typedef struct instproxy_client_private instproxy_client_private; |
| 108 | typedef instproxy_client_private *instproxy_client_t; /**< The client handle. */ | 109 | typedef instproxy_client_private *instproxy_client_t; /**< The client handle. */ |
| 109 | 110 | ||
| 110 | /** Reports the status of the given operation */ | 111 | /** Reports the status response of the given command */ |
| 111 | typedef void (*instproxy_status_cb_t) (const char *operation, plist_t status, void *user_data); | 112 | typedef void (*instproxy_status_cb_t) (plist_t command, plist_t status, void *user_data); |
| 112 | 113 | ||
| 113 | /* Interface */ | 114 | /* Interface */ |
| 114 | 115 | ||
| @@ -170,6 +171,41 @@ instproxy_error_t instproxy_client_free(instproxy_client_t client); | |||
| 170 | instproxy_error_t instproxy_browse(instproxy_client_t client, plist_t client_options, plist_t *result); | 171 | instproxy_error_t instproxy_browse(instproxy_client_t client, plist_t client_options, plist_t *result); |
| 171 | 172 | ||
| 172 | /** | 173 | /** |
| 174 | * List pages of installed applications in a callback. | ||
| 175 | * | ||
| 176 | * @param client The connected installation_proxy client | ||
| 177 | * @param client_options The client options to use, as PLIST_DICT, or NULL. | ||
| 178 | * Valid client options include: | ||
| 179 | * "ApplicationType" -> "System" | ||
| 180 | * "ApplicationType" -> "User" | ||
| 181 | * "ApplicationType" -> "Internal" | ||
| 182 | * "ApplicationType" -> "Any" | ||
| 183 | * @param status_cb Callback function to process each page of application | ||
| 184 | * information. Passing a callback is required. | ||
| 185 | * @param user_data Callback data passed to status_cb. | ||
| 186 | * | ||
| 187 | * @return INSTPROXY_E_SUCCESS on success or an INSTPROXY_E_* error value if | ||
| 188 | * an error occured. | ||
| 189 | */ | ||
| 190 | instproxy_error_t instproxy_browse_with_callback(instproxy_client_t client, plist_t client_options, instproxy_status_cb_t status_cb, void *user_data); | ||
| 191 | |||
| 192 | /** | ||
| 193 | * Lookup information about specific applications from the device. | ||
| 194 | * | ||
| 195 | * @param client The connected installation_proxy client | ||
| 196 | * @param appids A PLIST_ARRAY with PLIST_STRINGs of bundle identifiers, a | ||
| 197 | * single PLIST_STRING for one bundle identifier or NULL to lookup all. | ||
| 198 | * @param client_options The client options to use, as PLIST_DICT, or NULL. | ||
| 199 | * Currently there are no known client options, so pass NULL here. | ||
| 200 | * @param result Pointer that will be set to a plist containing a PLIST_DICT | ||
| 201 | * holding requested information about the application or NULL on errors. | ||
| 202 | * | ||
| 203 | * @return INSTPROXY_E_SUCCESS on success or an INSTPROXY_E_* error value if | ||
| 204 | * an error occured. | ||
| 205 | */ | ||
| 206 | instproxy_error_t instproxy_lookup(instproxy_client_t client, plist_t appids, plist_t client_options, plist_t *result); | ||
| 207 | |||
| 208 | /** | ||
| 173 | * Install an application on the device. | 209 | * Install an application on the device. |
| 174 | * | 210 | * |
| 175 | * @param client The connected installation_proxy client | 211 | * @param client The connected installation_proxy client |
| @@ -333,10 +369,83 @@ instproxy_error_t instproxy_restore(instproxy_client_t client, const char *appid | |||
| 333 | */ | 369 | */ |
| 334 | instproxy_error_t instproxy_remove_archive(instproxy_client_t client, const char *appid, plist_t client_options, instproxy_status_cb_t status_cb, void *user_data); | 370 | instproxy_error_t instproxy_remove_archive(instproxy_client_t client, const char *appid, plist_t client_options, instproxy_status_cb_t status_cb, void *user_data); |
| 335 | 371 | ||
| 372 | /** | ||
| 373 | * Checks a device for certain capabilities. | ||
| 374 | * | ||
| 375 | * @param client The connected installation_proxy client | ||
| 376 | * @param capabilities A PLIST_ARRAY with PLIST_STRINGs of capability names. | ||
| 377 | * The capabilities are passed through and queried from MobileGestalt. | ||
| 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. | ||
| 380 | * @param result Pointer that will be set to a plist containing a PLIST_DICT | ||
| 381 | * holding information if the capabilities matched or NULL on errors. | ||
| 382 | * | ||
| 383 | * @return INSTPROXY_E_SUCCESS on success or an INSTPROXY_E_* error value if | ||
| 384 | * an error occured. | ||
| 385 | */ | ||
| 386 | instproxy_error_t instproxy_check_capabilities_match(instproxy_client_t client, plist_t capabilities, plist_t client_options, plist_t *result); | ||
| 387 | |||
| 336 | /* Helper */ | 388 | /* Helper */ |
| 337 | 389 | ||
| 338 | /** | 390 | /** |
| 339 | * Create a new client_options plist. | 391 | * Gets the name from a command dictionary. |
| 392 | * | ||
| 393 | * @param command The dictionary describing the command. | ||
| 394 | * @param name Pointer to store the name of the command. | ||
| 395 | */ | ||
| 396 | void instproxy_command_get_name(plist_t command, char** name); | ||
| 397 | |||
| 398 | /** | ||
| 399 | * Gets the name of a status. | ||
| 400 | * | ||
| 401 | * @param status The dictionary status response to use. | ||
| 402 | * @param name Pointer to store the name of the status. | ||
| 403 | */ | ||
| 404 | void instproxy_status_get_name(plist_t status, char **name); | ||
| 405 | |||
| 406 | /** | ||
| 407 | * Gets error name, code and description from a response if available. | ||
| 408 | * | ||
| 409 | * @param status The dictionary status response to use. | ||
| 410 | * @param name Pointer to store the name of an error. | ||
| 411 | * @param description Pointer to store error description text if available. | ||
| 412 | * The caller is reponsible for freeing the allocated buffer after use. | ||
| 413 | * If NULL is passed no description will be returned. | ||
| 414 | * @param code Pointer to store the returned error code if available. | ||
| 415 | * If NULL is passed no error code will be returned. | ||
| 416 | * | ||
| 417 | * @return INSTPROXY_E_SUCCESS if no error is found or an INSTPROXY_E_* error | ||
| 418 | * value matching the error that ẃas found in the status. | ||
| 419 | */ | ||
| 420 | instproxy_error_t instproxy_status_get_error(plist_t status, char **name, char** description, uint64_t* code); | ||
| 421 | |||
| 422 | /** | ||
| 423 | * Gets total and current item information from a browse response if available. | ||
| 424 | * | ||
| 425 | * @param status The dictionary status response to use. | ||
| 426 | * @param total Pointer to store the total number of items. | ||
| 427 | * @param current_index Pointer to store the current index of all browsed items. | ||
| 428 | * @param current_amount Pointer to store the amount of items in the | ||
| 429 | * current list. | ||
| 430 | * @param list Pointer to store a newly allocated plist with items. | ||
| 431 | * The caller is reponsible for freeing the list after use. | ||
| 432 | * If NULL is passed no list will be returned. If NULL is returned no | ||
| 433 | * list was found in the status. | ||
| 434 | */ | ||
| 435 | void instproxy_status_get_current_list(plist_t status, uint64_t* total, uint64_t* current_index, uint64_t* current_amount, plist_t* list); | ||
| 436 | |||
| 437 | |||
| 438 | /** | ||
| 439 | * Gets progress in percentage from a status if available. | ||
| 440 | * | ||
| 441 | * @param status The dictionary status response to use. | ||
| 442 | * @param name Pointer to store the progress in percent (0-100) or -1 if not | ||
| 443 | * progress was found in the status. | ||
| 444 | */ | ||
| 445 | void instproxy_status_get_percent_complete(plist_t status, int *percent); | ||
| 446 | |||
| 447 | /** | ||
| 448 | * Creates a new client_options plist. | ||
| 340 | * | 449 | * |
| 341 | * @return A new plist_t of type PLIST_DICT. | 450 | * @return A new plist_t of type PLIST_DICT. |
| 342 | */ | 451 | */ |
