Class RestoreNativeMethods
Inheritance
Inherited Members
Namespace: iMobileDevice.Restore
Assembly: iMobileDevice-net.dll
Syntax
public class RestoreNativeMethods
Methods
restored_client_free(IntPtr)
Closes the restored client session if one is running and frees up the restored_client struct.
Declaration
public static RestoreError restored_client_free(IntPtr client)
Parameters
Type | Name | Description |
---|---|---|
System.IntPtr | client | The restore client |
Returns
Type | Description |
---|---|
RestoreError | RESTORE_E_SUCCESS on success, RESTORE_E_INVALID_ARG when client is NULL |
restored_client_new(iDeviceHandle, out RestoreClientHandle, String)
Creates a new restored client for the device.
Declaration
public static RestoreError restored_client_new(iDeviceHandle device, out RestoreClientHandle client, string label)
Parameters
Type | Name | Description |
---|---|---|
iDeviceHandle | device | The device to create a restored client for |
RestoreClientHandle | client | The pointer to the location of the new restored_client |
System.String | label | The label to use for communication. Usually the program name. |
Returns
Type | Description |
---|---|
RestoreError | RESTORE_E_SUCCESS on success, RESTORE_E_INVALID_ARG when client is NULL |
restored_client_set_label(RestoreClientHandle, String)
Sets the label to send for requests to restored.
Declaration
public static void restored_client_set_label(RestoreClientHandle client, string label)
Parameters
Type | Name | Description |
---|---|---|
RestoreClientHandle | client | The restore client |
System.String | label | The label to set or NULL to disable sending a label |
restored_get_value(RestoreClientHandle, String, out PlistHandle)
Retrieves a value from information plist specified by a key.
Declaration
public static RestoreError restored_get_value(RestoreClientHandle client, string key, out PlistHandle value)
Parameters
Type | Name | Description |
---|---|---|
RestoreClientHandle | client | An initialized restored client. |
System.String | key | The key name to request or NULL to query for all keys |
PlistHandle | value | A plist node representing the result value node |
Returns
Type | Description |
---|---|
RestoreError | RESTORE_E_SUCCESS on success, RESTORE_E_INVALID_ARG when client is NULL, RESTORE_E_PLIST_ERROR if value for key can't be found |
restored_goodbye(RestoreClientHandle)
Sends the Goodbye request to restored signaling the end of communication.
Declaration
public static RestoreError restored_goodbye(RestoreClientHandle client)
Parameters
Type | Name | Description |
---|---|---|
RestoreClientHandle | client | The restore client |
Returns
Type | Description |
---|---|
RestoreError | RESTORE_E_SUCCESS on success, RESTORE_E_INVALID_ARG when client is NULL, RESTORE_E_PLIST_ERROR if the device did not acknowledge the request |
restored_query_type(RestoreClientHandle, out IntPtr, ref UInt64)
Query the type of the service daemon. Depending on whether the device is queried in normal mode or restore mode, different types will be returned.
Declaration
public static RestoreError restored_query_type(RestoreClientHandle client, out IntPtr type, ref ulong version)
Parameters
Type | Name | Description |
---|---|---|
RestoreClientHandle | client | The restored client |
System.IntPtr | type | The type returned by the service daemon. Pass NULL to ignore. |
System.UInt64 | version | The restore protocol version. Pass NULL to ignore. |
Returns
Type | Description |
---|---|
RestoreError | RESTORE_E_SUCCESS on success, RESTORE_E_INVALID_ARG when client is NULL |
restored_query_type(RestoreClientHandle, out String, ref UInt64)
Declaration
public static RestoreError restored_query_type(RestoreClientHandle client, out string type, ref ulong version)
Parameters
Type | Name | Description |
---|---|---|
RestoreClientHandle | client | |
System.String | type | |
System.UInt64 | version |
Returns
Type | Description |
---|---|
RestoreError |
restored_query_value(RestoreClientHandle, String, out PlistHandle)
Queries a value from the device specified by a key.
Declaration
public static RestoreError restored_query_value(RestoreClientHandle client, string key, out PlistHandle value)
Parameters
Type | Name | Description |
---|---|---|
RestoreClientHandle | client | An initialized restored client. |
System.String | key | The key name to request |
PlistHandle | value | A plist node representing the result value node |
Returns
Type | Description |
---|---|
RestoreError | RESTORE_E_SUCCESS on success, RESTORE_E_INVALID_ARG when client is NULL, RESTORE_E_PLIST_ERROR if value for key can't be found |
restored_reboot(RestoreClientHandle)
Requests device to reboot.
Declaration
public static RestoreError restored_reboot(RestoreClientHandle client)
Parameters
Type | Name | Description |
---|---|---|
RestoreClientHandle | client | The restored client |
Returns
Type | Description |
---|---|
RestoreError | RESTORE_E_SUCCESS on success, RESTORE_E_INVALID_ARG if a parameter is NULL |
restored_receive(RestoreClientHandle, out PlistHandle)
Receives a plist from restored.
Declaration
public static RestoreError restored_receive(RestoreClientHandle client, out PlistHandle plist)
Parameters
Type | Name | Description |
---|---|---|
RestoreClientHandle | client | The restored client |
PlistHandle | plist | The plist to store the received data |
Returns
Type | Description |
---|---|
RestoreError | RESTORE_E_SUCCESS on success, RESTORE_E_INVALID_ARG when client or plist is NULL |
restored_send(RestoreClientHandle, PlistHandle)
Sends a plist to restored.
Declaration
public static RestoreError restored_send(RestoreClientHandle client, PlistHandle plist)
Parameters
Type | Name | Description |
---|---|---|
RestoreClientHandle | client | The restored client |
PlistHandle | plist | The plist to send |
Returns
Type | Description |
---|---|
RestoreError | RESTORE_E_SUCCESS on success, RESTORE_E_INVALID_ARG when client or plist is NULL |
Remarks
This function is low-level and should only be used if you need to send a new type of message.
restored_start_restore(RestoreClientHandle, PlistHandle, UInt64)
Requests to start a restore and retrieve it's port on success.
Declaration
public static RestoreError restored_start_restore(RestoreClientHandle client, PlistHandle options, ulong version)
Parameters
Type | Name | Description |
---|---|---|
RestoreClientHandle | client | The restored client |
PlistHandle | options | PLIST_DICT with options for the restore process or NULL |
System.UInt64 | version | the restore protocol version, see restored_query_type() |
Returns
Type | Description |
---|---|
RestoreError | RESTORE_E_SUCCESS on success, RESTORE_E_INVALID_ARG if a parameter is NULL, RESTORE_E_START_RESTORE_FAILED if the request fails |