Interface IMobileBackup2Api
Namespace: iMobileDevice.MobileBackup2
Assembly: iMobileDevice-net.dll
Syntax
public interface IMobileBackup2Api
Properties
| Improve this Doc View SourceParent
Gets or sets the
Declaration
ILibiMobileDevice Parent { get; }
Property Value
Type | Description |
---|---|
ILibiMobileDevice |
Methods
| Improve this Doc View Sourcemobilebackup2_client_free(IntPtr)
Disconnects a mobilebackup2 client from the device and frees up the mobilebackup2 client data.
Declaration
MobileBackup2Error mobilebackup2_client_free(IntPtr client)
Parameters
Type | Name | Description |
---|---|---|
System.IntPtr | client | The mobilebackup2 client to disconnect and free. |
Returns
Type | Description |
---|---|
MobileBackup2Error | MOBILEBACKUP2_E_SUCCESS on success, or MOBILEBACKUP2_E_INVALID_ARG if client is NULL. |
mobilebackup2_client_new(iDeviceHandle, LockdownServiceDescriptorHandle, out MobileBackup2ClientHandle)
Connects to the mobilebackup2 service on the specified device.
Declaration
MobileBackup2Error mobilebackup2_client_new(iDeviceHandle device, LockdownServiceDescriptorHandle service, out MobileBackup2ClientHandle client)
Parameters
Type | Name | Description |
---|---|---|
iDeviceHandle | device | The device to connect to. |
LockdownServiceDescriptorHandle | service | The service descriptor returned by lockdownd_start_service. |
MobileBackup2ClientHandle | client | Pointer that will be set to a newly allocated mobilebackup2_client_t upon successful return. |
Returns
Type | Description |
---|---|
MobileBackup2Error | MOBILEBACKUP2_E_SUCCESS on success, MOBILEBACKUP2_E_INVALID ARG if one or more parameter is invalid, or MOBILEBACKUP2_E_BAD_VERSION if the mobilebackup2 version on the device is newer. |
mobilebackup2_client_start_service(iDeviceHandle, out MobileBackup2ClientHandle, String)
Starts a new mobilebackup2 service on the specified device and connects to it.
Declaration
MobileBackup2Error mobilebackup2_client_start_service(iDeviceHandle device, out MobileBackup2ClientHandle client, string label)
Parameters
Type | Name | Description |
---|---|---|
iDeviceHandle | device | The device to connect to. |
MobileBackup2ClientHandle | client | Pointer that will point to a newly allocated mobilebackup2_client_t upon successful return. Must be freed using mobilebackup2_client_free() after use. |
System.String | label | The label to use for communication. Usually the program name. Pass NULL to disable sending the label in requests to lockdownd. |
Returns
Type | Description |
---|---|
MobileBackup2Error | MOBILEBACKUP2_E_SUCCESS on success, or an MOBILEBACKUP2_E_* error code otherwise. |
mobilebackup2_receive_message(MobileBackup2ClientHandle, out PlistHandle, out String)
Receives a DL* message plist from the device. This function is a wrapper around device_link_service_receive_message.
Declaration
MobileBackup2Error mobilebackup2_receive_message(MobileBackup2ClientHandle client, out PlistHandle msgPlist, out string dlmessage)
Parameters
Type | Name | Description |
---|---|---|
MobileBackup2ClientHandle | client | The connected MobileBackup client to use. |
PlistHandle | msgPlist | |
System.String | dlmessage | A pointer that will be set to a newly allocated char* containing the DL* string from the given plist. It is up to the caller to free the allocated memory. If this parameter is NULL it will be ignored. |
Returns
Type | Description |
---|---|
MobileBackup2Error | MOBILEBACKUP2_E_SUCCESS if a DL* message was received, MOBILEBACKUP2_E_INVALID_ARG if client or message is invalid, MOBILEBACKUP2_E_PLIST_ERROR if the received plist is invalid or is not a DL* message plist, or MOBILEBACKUP2_E_MUX_ERROR if receiving from the device failed. |
mobilebackup2_receive_raw(MobileBackup2ClientHandle, Byte[], UInt32, ref UInt32)
Receive binary from the device.
Declaration
MobileBackup2Error mobilebackup2_receive_raw(MobileBackup2ClientHandle client, byte[] data, uint length, ref uint bytes)
Parameters
Type | Name | Description |
---|---|---|
MobileBackup2ClientHandle | client | The MobileBackup client to receive from. |
System.Byte[] | data | Pointer to a buffer that will be filled with the received data. |
System.UInt32 | length | Number of bytes to receive. The data buffer needs to be large enough to store this amount of data. |
System.UInt32 | bytes | Number of bytes actually received. |
Returns
Type | Description |
---|---|
MobileBackup2Error | MOBILEBACKUP2_E_SUCCESS if any or no data was received, MOBILEBACKUP2_E_INVALID_ARG if one of the parameters is invalid, or MOBILEBACKUP2_E_MUX_ERROR if receiving the data failed. |
Remarks
This function returns MOBILEBACKUP2_E_SUCCESS even if no data has been received (unless a communication error occured). The fourth parameter is required and must be checked to know how many bytes were actually received.
mobilebackup2_send_message(MobileBackup2ClientHandle, String, PlistHandle)
Sends a backup message plist.
Declaration
MobileBackup2Error mobilebackup2_send_message(MobileBackup2ClientHandle client, string message, PlistHandle options)
Parameters
Type | Name | Description |
---|---|---|
MobileBackup2ClientHandle | client | The connected MobileBackup client to use. |
System.String | message | The message to send. This will be inserted into the request plist as value for MessageName. If this parameter is NULL, the plist passed in the options parameter will be sent directly. |
PlistHandle | options | Additional options as PLIST_DICT to add to the request. The MessageName key with the value passed in the message parameter will be inserted into this plist before sending it. This parameter can be NULL if message is not NULL. |
Returns
Type | Description |
---|---|
MobileBackup2Error |
mobilebackup2_send_raw(MobileBackup2ClientHandle, Byte[], UInt32, ref UInt32)
Send binary data to the device.
Declaration
MobileBackup2Error mobilebackup2_send_raw(MobileBackup2ClientHandle client, byte[] data, uint length, ref uint bytes)
Parameters
Type | Name | Description |
---|---|---|
MobileBackup2ClientHandle | client | The MobileBackup client to send to. |
System.Byte[] | data | Pointer to the data to send |
System.UInt32 | length | Number of bytes to send |
System.UInt32 | bytes | Number of bytes actually sent |
Returns
Type | Description |
---|---|
MobileBackup2Error | MOBILEBACKUP2_E_SUCCESS if any data was successfully sent, MOBILEBACKUP2_E_INVALID_ARG if one of the parameters is invalid, or MOBILEBACKUP2_E_MUX_ERROR if sending of the data failed. |
Remarks
This function returns MOBILEBACKUP2_E_SUCCESS even if less than the requested length has been sent. The fourth parameter is required and must be checked to ensure if the whole data has been sent.
mobilebackup2_send_request(MobileBackup2ClientHandle, String, String, String, PlistHandle)
Send a request to the connected mobilebackup2 service.
Declaration
MobileBackup2Error mobilebackup2_send_request(MobileBackup2ClientHandle client, string request, string targetIdentifier, string sourceIdentifier, PlistHandle options)
Parameters
Type | Name | Description |
---|---|---|
MobileBackup2ClientHandle | client | |
System.String | request | The request to send to the backup service. Currently, this is one of "Backup", "Restore", "Info", or "List". |
System.String | targetIdentifier | |
System.String | sourceIdentifier | |
PlistHandle | options | Additional options in a plist of type PLIST_DICT. |
Returns
Type | Description |
---|---|
MobileBackup2Error | MOBILEBACKUP2_E_SUCCESS if the request was successfully sent, or a MOBILEBACKUP2_E_* error value otherwise. |
mobilebackup2_send_status_response(MobileBackup2ClientHandle, Int32, String, PlistHandle)
Sends a DLMessageStatusResponse to the device.
Declaration
MobileBackup2Error mobilebackup2_send_status_response(MobileBackup2ClientHandle client, int statusCode, string status1, PlistHandle status2)
Parameters
Type | Name | Description |
---|---|---|
MobileBackup2ClientHandle | client | The MobileBackup client to use. |
System.Int32 | statusCode | |
System.String | status1 | A status message to send. Can be NULL if not required. |
PlistHandle | status2 | An additional status plist to attach to the response. Can be NULL if not required. |
Returns
Type | Description |
---|---|
MobileBackup2Error | MOBILEBACKUP2_E_SUCCESS on success, MOBILEBACKUP2_E_INVALID_ARG if client is invalid, or another MOBILEBACKUP2_E_* otherwise. |
mobilebackup2_version_exchange(MobileBackup2ClientHandle, IntPtr, SByte, ref Double)
Performs the mobilebackup2 protocol version exchange.
Declaration
MobileBackup2Error mobilebackup2_version_exchange(MobileBackup2ClientHandle client, IntPtr localVersions, sbyte count, ref double remoteVersion)
Parameters
Type | Name | Description |
---|---|---|
MobileBackup2ClientHandle | client | The MobileBackup client to use. |
System.IntPtr | localVersions | |
System.SByte | count | The number of items in local_versions. |
System.Double | remoteVersion |
Returns
Type | Description |
---|---|
MobileBackup2Error | MOBILEBACKUP2_E_SUCCESS on success, or a MOBILEBACKUP2_E_* error code otherwise. |