libimobiledevice
1.2.0
|
Mount developer/debug disk images on the device. More...
Macros | |
#define | MOBILE_IMAGE_MOUNTER_SERVICE_NAME "com.apple.mobile.mobile_image_mounter" |
Typedefs | |
typedef struct mobile_image_mounter_client_private | mobile_image_mounter_client_private |
typedef mobile_image_mounter_client_private * | mobile_image_mounter_client_t |
The client handle. More... | |
typedef ssize_t(* | mobile_image_mounter_upload_cb_t )(void *buffer, size_t length, void *user_data) |
callback for image upload | |
Enumerations | |
enum | mobile_image_mounter_error_t { MOBILE_IMAGE_MOUNTER_E_SUCCESS = 0, MOBILE_IMAGE_MOUNTER_E_INVALID_ARG = -1, MOBILE_IMAGE_MOUNTER_E_PLIST_ERROR = -2, MOBILE_IMAGE_MOUNTER_E_CONN_FAILED = -3, MOBILE_IMAGE_MOUNTER_E_COMMAND_FAILED = -4, MOBILE_IMAGE_MOUNTER_E_UNKNOWN_ERROR = -256 } |
Error Codes. | |
Functions | |
mobile_image_mounter_error_t | mobile_image_mounter_new (idevice_t device, lockdownd_service_descriptor_t service, mobile_image_mounter_client_t *client) |
Connects to the mobile_image_mounter service on the specified device. More... | |
mobile_image_mounter_error_t | mobile_image_mounter_start_service (idevice_t device, mobile_image_mounter_client_t *client, const char *label) |
Starts a new mobile_image_mounter service on the specified device and connects to it. More... | |
mobile_image_mounter_error_t | mobile_image_mounter_free (mobile_image_mounter_client_t client) |
Disconnects a mobile_image_mounter client from the device and frees up the mobile_image_mounter client data. More... | |
mobile_image_mounter_error_t | mobile_image_mounter_lookup_image (mobile_image_mounter_client_t client, const char *image_type, plist_t *result) |
Tells if the image of ImageType is already mounted. More... | |
mobile_image_mounter_error_t | mobile_image_mounter_upload_image (mobile_image_mounter_client_t client, const char *image_type, size_t image_size, const char *signature, uint16_t signature_size, mobile_image_mounter_upload_cb_t upload_cb, void *userdata) |
Uploads an image with an optional signature to the device. More... | |
mobile_image_mounter_error_t | mobile_image_mounter_mount_image (mobile_image_mounter_client_t client, const char *image_path, const char *signature, uint16_t signature_size, const char *image_type, plist_t *result) |
Mounts an image on the device. More... | |
mobile_image_mounter_error_t | mobile_image_mounter_hangup (mobile_image_mounter_client_t client) |
Hangs up the connection to the mobile_image_mounter service. More... | |
Mount developer/debug disk images on the device.
typedef mobile_image_mounter_client_private* mobile_image_mounter_client_t |
The client handle.
mobile_image_mounter_error_t mobile_image_mounter_free | ( | mobile_image_mounter_client_t | client | ) |
Disconnects a mobile_image_mounter client from the device and frees up the mobile_image_mounter client data.
client | The mobile_image_mounter client to disconnect and free. |
mobile_image_mounter_error_t mobile_image_mounter_hangup | ( | mobile_image_mounter_client_t | client | ) |
Hangs up the connection to the mobile_image_mounter service.
This functions has to be called before freeing up a mobile_image_mounter instance. If not, errors appear in the device's syslog.
client | The client to hang up |
mobile_image_mounter_error_t mobile_image_mounter_lookup_image | ( | mobile_image_mounter_client_t | client, |
const char * | image_type, | ||
plist_t * | result | ||
) |
Tells if the image of ImageType is already mounted.
client | The client use |
image_type | The type of the image to look up |
result | Pointer to a plist that will receive the result of the operation. |
mobile_image_mounter_error_t mobile_image_mounter_mount_image | ( | mobile_image_mounter_client_t | client, |
const char * | image_path, | ||
const char * | signature, | ||
uint16_t | signature_size, | ||
const char * | image_type, | ||
plist_t * | result | ||
) |
Mounts an image on the device.
client | The connected mobile_image_mounter client. |
image_path | The absolute path of the image to mount. The image must be present before calling this function. |
signature | Pointer to a buffer holding the images' signature |
signature_size | Length of the signature image_signature points to |
image_type | Type of image to mount |
result | Pointer to a plist that will receive the result of the operation. |
mobile_image_mounter_error_t mobile_image_mounter_new | ( | idevice_t | device, |
lockdownd_service_descriptor_t | service, | ||
mobile_image_mounter_client_t * | client | ||
) |
Connects to the mobile_image_mounter service on the specified device.
device | The device to connect to. |
service | The service descriptor returned by lockdownd_start_service. |
client | Pointer that will be set to a newly allocated mobile_image_mounter_client_t upon successful return. |
mobile_image_mounter_error_t mobile_image_mounter_start_service | ( | idevice_t | device, |
mobile_image_mounter_client_t * | client, | ||
const char * | label | ||
) |
Starts a new mobile_image_mounter service on the specified device and connects to it.
device | The device to connect to. |
client | Pointer that will point to a newly allocated mobile_image_mounter_t upon successful return. Must be freed using mobile_image_mounter_free() after use. |
label | The label to use for communication. Usually the program name. Pass NULL to disable sending the label in requests to lockdownd. |
mobile_image_mounter_error_t mobile_image_mounter_upload_image | ( | mobile_image_mounter_client_t | client, |
const char * | image_type, | ||
size_t | image_size, | ||
const char * | signature, | ||
uint16_t | signature_size, | ||
mobile_image_mounter_upload_cb_t | upload_cb, | ||
void * | userdata | ||
) |
Uploads an image with an optional signature to the device.
client | The connected mobile_image_mounter client. |
image_type | Type of image that is being uploaded. |
image_size | Total size of the image. |
signature | Buffer with a signature of the image being uploaded. If NULL, no signature will be used. |
signature_size | Total size of the image signature buffer. If 0, no signature will be used. |
upload_cb | Callback function that gets the data chunks for uploading the image. |
userdata | User defined data for the upload callback function. |