Manage device preferences, start services, pairing and activation. More...
Data Structures | |
struct | lockdownd_pair_record_t |
A pair record holding device, host and root certificates along the host_id. More... | |
Typedefs | |
typedef int16_t | lockdownd_error_t |
Represents an error code. | |
typedef lockdownd_client_private * | lockdownd_client_t |
The client handle. | |
Functions | |
lockdownd_error_t | lockdownd_client_new (idevice_t device, lockdownd_client_t *client, const char *label) |
Creates a new lockdownd client for the device. | |
lockdownd_error_t | lockdownd_client_new_with_handshake (idevice_t device, lockdownd_client_t *client, const char *label) |
Creates a new lockdownd client for the device and starts initial handshake. | |
lockdownd_error_t | lockdownd_client_free (lockdownd_client_t client) |
Closes the lockdownd client session if one is running and frees up the lockdownd_client struct. | |
lockdownd_error_t | lockdownd_query_type (lockdownd_client_t client, char **type) |
Query the type of the service daemon. | |
lockdownd_error_t | lockdownd_get_value (lockdownd_client_t client, const char *domain, const char *key, plist_t *value) |
Retrieves a preferences plist using an optional domain and/or key name. | |
lockdownd_error_t | lockdownd_set_value (lockdownd_client_t client, const char *domain, const char *key, plist_t value) |
Sets a preferences value using a plist and optional by domain and/or key name. | |
lockdownd_error_t | lockdownd_remove_value (lockdownd_client_t client, const char *domain, const char *key) |
Removes a preference node by domain and/or key name. | |
lockdownd_error_t | lockdownd_start_service (lockdownd_client_t client, const char *service, uint16_t *port) |
Requests to start a service and retrieve it's port on success. | |
lockdownd_error_t | lockdownd_start_session (lockdownd_client_t client, const char *host_id, char **session_id, int *ssl_enabled) |
Opens a session with lockdownd and switches to SSL mode if device wants it. | |
lockdownd_error_t | lockdownd_stop_session (lockdownd_client_t client, const char *session_id) |
Closes the lockdownd session by sending the StopSession request. | |
lockdownd_error_t | lockdownd_send (lockdownd_client_t client, plist_t plist) |
Sends a plist to lockdownd. | |
lockdownd_error_t | lockdownd_receive (lockdownd_client_t client, plist_t *plist) |
Receives a plist from lockdownd. | |
lockdownd_error_t | lockdownd_pair (lockdownd_client_t client, lockdownd_pair_record_t pair_record) |
Pairs the device using the supplied pair record. | |
lockdownd_error_t | lockdownd_validate_pair (lockdownd_client_t client, lockdownd_pair_record_t pair_record) |
Validates if the device is paired with the given HostID. | |
lockdownd_error_t | lockdownd_unpair (lockdownd_client_t client, lockdownd_pair_record_t pair_record) |
Unpairs the device with the given HostID and removes the pairing records from the device and host if the internal pairing record management is used. | |
lockdownd_error_t | lockdownd_activate (lockdownd_client_t client, plist_t activation_record) |
Activates the device. | |
lockdownd_error_t | lockdownd_deactivate (lockdownd_client_t client) |
Deactivates the device, returning it to the locked “Activate with iTunes” screen. | |
lockdownd_error_t | lockdownd_enter_recovery (lockdownd_client_t client) |
Tells the device to immediately enter recovery mode. | |
lockdownd_error_t | lockdownd_goodbye (lockdownd_client_t client) |
Sends the Goodbye request to lockdownd signaling the end of communication. | |
void | lockdownd_client_set_label (lockdownd_client_t client, const char *label) |
Sets the label to send for requests to lockdownd. | |
lockdownd_error_t | lockdownd_get_device_uuid (lockdownd_client_t control, char **uuid) |
Returns the unique id of the device from lockdownd. | |
lockdownd_error_t | lockdownd_get_device_name (lockdownd_client_t client, char **device_name) |
Retrieves the name of the device from lockdownd set by the user. | |
lockdownd_error_t | lockdownd_get_sync_data_classes (lockdownd_client_t client, char ***classes, int *count) |
Calculates and returns the data classes the device supports from lockdownd. | |
lockdownd_error_t | lockdownd_data_classes_free (char **classes) |
Frees memory of an allocated array of data classes as returned by lockdownd_get_sync_data_classes(). | |
Error Codes | |
| |
#define | LOCKDOWN_E_SUCCESS 0 |
#define | LOCKDOWN_E_INVALID_ARG -1 |
#define | LOCKDOWN_E_INVALID_CONF -2 |
#define | LOCKDOWN_E_PLIST_ERROR -3 |
#define | LOCKDOWN_E_PAIRING_FAILED -4 |
#define | LOCKDOWN_E_SSL_ERROR -5 |
#define | LOCKDOWN_E_DICT_ERROR -6 |
#define | LOCKDOWN_E_START_SERVICE_FAILED -7 |
#define | LOCKDOWN_E_NOT_ENOUGH_DATA -8 |
#define | LOCKDOWN_E_SET_VALUE_PROHIBITED -9 |
#define | LOCKDOWN_E_GET_VALUE_PROHIBITED -10 |
#define | LOCKDOWN_E_REMOVE_VALUE_PROHIBITED -11 |
#define | LOCKDOWN_E_MUX_ERROR -12 |
#define | LOCKDOWN_E_ACTIVATION_FAILED -13 |
#define | LOCKDOWN_E_PASSWORD_PROTECTED -14 |
#define | LOCKDOWN_E_NO_RUNNING_SESSION -15 |
#define | LOCKDOWN_E_INVALID_HOST_ID -16 |
#define | LOCKDOWN_E_INVALID_SERVICE -17 |
#define | LOCKDOWN_E_INVALID_ACTIVATION_RECORD -18 |
#define | LOCKDOWN_E_UNKNOWN_ERROR -256 |
Manage device preferences, start services, pairing and activation.
The client handle.
typedef int16_t lockdownd_error_t |
Represents an error code.
lockdownd_error_t lockdownd_activate | ( | lockdownd_client_t | client, | |
plist_t | activation_record | |||
) |
Activates the device.
Only works within an open session. The ActivationRecord plist dictionary must be obtained using the activation protocol requesting from Apple's https webservice.
client | The lockdown client
|
lockdownd_error_t lockdownd_client_free | ( | lockdownd_client_t | client | ) |
Closes the lockdownd client session if one is running and frees up the lockdownd_client struct.
client | The lockdown client |
lockdownd_error_t lockdownd_client_new | ( | idevice_t | device, | |
lockdownd_client_t * | client, | |||
const char * | label | |||
) |
Creates a new lockdownd client for the device.
device | The device to create a lockdownd client for
|
lockdownd_error_t lockdownd_client_new_with_handshake | ( | idevice_t | device, | |
lockdownd_client_t * | client, | |||
const char * | label | |||
) |
Creates a new lockdownd client for the device and starts initial handshake.
The handshake consists out of query_type, validate_pair, pair and start_session calls. It uses the internal pairing record management.
device | The device to create a lockdownd client for
|
void lockdownd_client_set_label | ( | lockdownd_client_t | client, | |
const char * | label | |||
) |
Sets the label to send for requests to lockdownd.
client | The lockdown client
|
lockdownd_error_t lockdownd_data_classes_free | ( | char ** | classes | ) |
Frees memory of an allocated array of data classes as returned by lockdownd_get_sync_data_classes().
classes | An array of class names to free. |
lockdownd_error_t lockdownd_deactivate | ( | lockdownd_client_t | client | ) |
Deactivates the device, returning it to the locked “Activate with iTunes” screen.
client | The lockdown client |
lockdownd_error_t lockdownd_enter_recovery | ( | lockdownd_client_t | client | ) |
Tells the device to immediately enter recovery mode.
client | The lockdown client |
lockdownd_error_t lockdownd_get_device_name | ( | lockdownd_client_t | client, | |
char ** | device_name | |||
) |
Retrieves the name of the device from lockdownd set by the user.
client | An initialized lockdownd client.
|
lockdownd_error_t lockdownd_get_device_uuid | ( | lockdownd_client_t | client, | |
char ** | uuid | |||
) |
Returns the unique id of the device from lockdownd.
client | An initialized lockdownd client.
|
lockdownd_error_t lockdownd_get_sync_data_classes | ( | lockdownd_client_t | client, | |
char *** | classes, | |||
int * | count | |||
) |
Calculates and returns the data classes the device supports from lockdownd.
client | An initialized lockdownd client.
|
lockdownd_error_t lockdownd_get_value | ( | lockdownd_client_t | client, | |
const char * | domain, | |||
const char * | key, | |||
plist_t * | value | |||
) |
Retrieves a preferences plist using an optional domain and/or key name.
client | An initialized lockdownd client.
|
lockdownd_error_t lockdownd_goodbye | ( | lockdownd_client_t | client | ) |
Sends the Goodbye request to lockdownd signaling the end of communication.
client | The lockdown client |
lockdownd_error_t lockdownd_pair | ( | lockdownd_client_t | client, | |
lockdownd_pair_record_t | pair_record | |||
) |
Pairs the device using the supplied pair record.
client | The lockdown client to pair with.
|
lockdownd_error_t lockdownd_query_type | ( | lockdownd_client_t | client, | |
char ** | type | |||
) |
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.
client | The lockdownd client
|
lockdownd_error_t lockdownd_receive | ( | lockdownd_client_t | client, | |
plist_t * | plist | |||
) |
Receives a plist from lockdownd.
client | The lockdownd client
|
lockdownd_error_t lockdownd_remove_value | ( | lockdownd_client_t | client, | |
const char * | domain, | |||
const char * | key | |||
) |
Removes a preference node by domain and/or key name.
client | An initialized lockdownd client.
|
lockdownd_error_t lockdownd_send | ( | lockdownd_client_t | client, | |
plist_t | plist | |||
) |
Sends a plist to lockdownd.
client | The lockdownd client
|
lockdownd_error_t lockdownd_set_value | ( | lockdownd_client_t | client, | |
const char * | domain, | |||
const char * | key, | |||
plist_t | value | |||
) |
Sets a preferences value using a plist and optional by domain and/or key name.
client | an initialized lockdownd client.
|
lockdownd_error_t lockdownd_start_service | ( | lockdownd_client_t | client, | |
const char * | service, | |||
uint16_t * | port | |||
) |
Requests to start a service and retrieve it's port on success.
client | The lockdownd client
|
lockdownd_error_t lockdownd_start_session | ( | lockdownd_client_t | client, | |
const char * | host_id, | |||
char ** | session_id, | |||
int * | ssl_enabled | |||
) |
Opens a session with lockdownd and switches to SSL mode if device wants it.
client | The lockdownd client
|
lockdownd_error_t lockdownd_stop_session | ( | lockdownd_client_t | client, | |
const char * | session_id | |||
) |
Closes the lockdownd session by sending the StopSession request.
client | The lockdown client
|
lockdownd_error_t lockdownd_unpair | ( | lockdownd_client_t | client, | |
lockdownd_pair_record_t | pair_record | |||
) |
Unpairs the device with the given HostID and removes the pairing records from the device and host if the internal pairing record management is used.
client | The lockdown client to pair with.
|
lockdownd_error_t lockdownd_validate_pair | ( | lockdownd_client_t | client, | |
lockdownd_pair_record_t | pair_record | |||
) |
Validates if the device is paired with the given HostID.
If succeeded them specified host will become trusted host of the device indicated by the lockdownd preference named TrustedHostAttached. Otherwise the host must because paired using lockdownd_pair() first.
client | The lockdown client to pair with.
|