@mcesystems/apple-kit 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +470 -404
- package/dist/index.js.map +4 -4
- package/dist/types/index.d.ts +6 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/logic/actions/activation.d.ts +12 -0
- package/dist/types/logic/actions/activation.d.ts.map +1 -0
- package/dist/types/logic/actions/device.d.ts +27 -0
- package/dist/types/logic/actions/device.d.ts.map +1 -0
- package/dist/types/logic/actions/install.d.ts +9 -0
- package/dist/types/logic/actions/install.d.ts.map +1 -0
- package/dist/types/logic/actions/pair.d.ts +6 -0
- package/dist/types/logic/actions/pair.d.ts.map +1 -0
- package/dist/types/logic/actions/proxy.d.ts +3 -0
- package/dist/types/logic/actions/proxy.d.ts.map +1 -0
- package/dist/types/logic/appleDeviceKit.d.ts +53 -7
- package/dist/types/logic/appleDeviceKit.d.ts.map +1 -1
- package/dist/types/logic/dataParser.d.ts +23 -0
- package/dist/types/logic/dataParser.d.ts.map +1 -0
- package/dist/types/logic/devicesMonitor.d.ts.map +1 -1
- package/dist/types/logic/enrollment.d.ts +56 -0
- package/dist/types/logic/enrollment.d.ts.map +1 -0
- package/dist/types/logic/skipSetup.d.ts +81 -0
- package/dist/types/logic/skipSetup.d.ts.map +1 -0
- package/dist/types/types/skipSteps.d.ts +136 -0
- package/dist/types/types/skipSteps.d.ts.map +1 -0
- package/dist/types/types.d.ts +22 -5
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/utils/debug.d.ts +8 -0
- package/dist/types/utils/debug.d.ts.map +1 -1
- package/dist/types/utils/idevicePath.d.ts +3 -0
- package/dist/types/utils/idevicePath.d.ts.map +1 -1
- package/dist/types/utils/usbmuxd.d.ts +19 -0
- package/dist/types/utils/usbmuxd.d.ts.map +1 -0
- package/dist/types/utils/wifiProfile.d.ts +72 -0
- package/dist/types/utils/wifiProfile.d.ts.map +1 -0
- package/package.json +4 -3
- package/resources/bin/windows/ideviceactivation.exe +0 -0
- package/resources/bin/windows/libideviceactivation-1.0.dll +0 -0
- package/resources/bin/windows/libimobiledevice-1.0.dll +0 -0
- package/resources/bin/windows/libimobiledevice-glue-1.0.dll +0 -0
- package/resources/bin/windows/libplist-2.0.dll +0 -0
- package/resources/bin/windows/libusbmuxd-2.0.dll +0 -0
- package/resources/lib/include/libimobiledevice/afc.h +413 -0
- package/resources/lib/include/libimobiledevice/bt_packet_logger.h +156 -0
- package/resources/lib/include/libimobiledevice/companion_proxy.h +212 -0
- package/resources/lib/include/libimobiledevice/debugserver.h +272 -0
- package/resources/lib/include/libimobiledevice/diagnostics_relay.h +228 -0
- package/resources/lib/include/libimobiledevice/file_relay.h +166 -0
- package/resources/lib/include/libimobiledevice/heartbeat.h +137 -0
- package/resources/lib/include/libimobiledevice/house_arrest.h +180 -0
- package/resources/lib/include/libimobiledevice/installation_proxy.h +505 -0
- package/resources/lib/include/libimobiledevice/libimobiledevice.h +444 -0
- package/resources/lib/include/libimobiledevice/lockdown.h +577 -0
- package/resources/lib/include/libimobiledevice/misagent.h +168 -0
- package/resources/lib/include/libimobiledevice/mobile_image_mounter.h +275 -0
- package/resources/lib/include/libimobiledevice/mobileactivation.h +192 -0
- package/resources/lib/include/libimobiledevice/mobilebackup.h +246 -0
- package/resources/lib/include/libimobiledevice/mobilebackup2.h +214 -0
- package/resources/lib/include/libimobiledevice/mobilesync.h +359 -0
- package/resources/lib/include/libimobiledevice/notification_proxy.h +202 -0
- package/resources/lib/include/libimobiledevice/ostrace.h +198 -0
- package/resources/lib/include/libimobiledevice/preboard.h +187 -0
- package/resources/lib/include/libimobiledevice/property_list_service.h +184 -0
- package/resources/lib/include/libimobiledevice/restore.h +179 -0
- package/resources/lib/include/libimobiledevice/reverse_proxy.h +213 -0
- package/resources/lib/include/libimobiledevice/sbservices.h +175 -0
- package/resources/lib/include/libimobiledevice/screenshotr.h +118 -0
- package/resources/lib/include/libimobiledevice/service.h +202 -0
- package/resources/lib/include/libimobiledevice/syslog_relay.h +184 -0
- package/resources/lib/include/libimobiledevice/webinspector.h +137 -0
- package/resources/lib/include/plist/Array.h +80 -0
- package/resources/lib/include/plist/Boolean.h +48 -0
- package/resources/lib/include/plist/Data.h +50 -0
- package/resources/lib/include/plist/Date.h +54 -0
- package/resources/lib/include/plist/Dictionary.h +73 -0
- package/resources/lib/include/plist/Integer.h +54 -0
- package/resources/lib/include/plist/Key.h +49 -0
- package/resources/lib/include/plist/Node.h +57 -0
- package/resources/lib/include/plist/Real.h +48 -0
- package/resources/lib/include/plist/String.h +52 -0
- package/resources/lib/include/plist/Structure.h +62 -0
- package/resources/lib/include/plist/Uid.h +48 -0
- package/resources/lib/include/plist/plist++.h +39 -0
- package/resources/lib/include/plist/plist.h +1448 -0
- package/resources/lib/libimobiledevice-1.0.dll +0 -0
- package/resources/lib/libimobiledevice-1.0.dll.a +0 -0
- package/resources/lib/libplist-2.0.dll +0 -0
- package/resources/lib/libplist-2.0.dll.a +0 -0
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file libimobiledevice/companion_proxy.h
|
|
3
|
+
* @brief Companion proxy support.
|
|
4
|
+
* \internal
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) 2019-2020 Nikias Bassen, All Rights Reserved.
|
|
7
|
+
*
|
|
8
|
+
* This library is free software; you can redistribute it and/or
|
|
9
|
+
* modify it under the terms of the GNU Lesser General Public
|
|
10
|
+
* License as published by the Free Software Foundation; either
|
|
11
|
+
* version 2.1 of the License, or (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This library is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
16
|
+
* Lesser General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU Lesser General Public
|
|
19
|
+
* License along with this library; if not, write to the Free Software
|
|
20
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
#ifndef ICOMPANION_PROXY_H
|
|
24
|
+
#define ICOMPANION_PROXY_H
|
|
25
|
+
|
|
26
|
+
#ifdef __cplusplus
|
|
27
|
+
extern "C" {
|
|
28
|
+
#endif
|
|
29
|
+
|
|
30
|
+
#include <libimobiledevice/libimobiledevice.h>
|
|
31
|
+
#include <libimobiledevice/lockdown.h>
|
|
32
|
+
|
|
33
|
+
/** Service identifier passed to lockdownd_start_service() to start the companion proxy service */
|
|
34
|
+
#define COMPANION_PROXY_SERVICE_NAME "com.apple.companion_proxy"
|
|
35
|
+
|
|
36
|
+
/** Error Codes */
|
|
37
|
+
typedef enum {
|
|
38
|
+
COMPANION_PROXY_E_SUCCESS = 0,
|
|
39
|
+
COMPANION_PROXY_E_INVALID_ARG = -1,
|
|
40
|
+
COMPANION_PROXY_E_PLIST_ERROR = -2,
|
|
41
|
+
COMPANION_PROXY_E_MUX_ERROR = -3,
|
|
42
|
+
COMPANION_PROXY_E_SSL_ERROR = -4,
|
|
43
|
+
COMPANION_PROXY_E_NOT_ENOUGH_DATA = -5,
|
|
44
|
+
COMPANION_PROXY_E_TIMEOUT = -6,
|
|
45
|
+
COMPANION_PROXY_E_OP_IN_PROGRESS = -7,
|
|
46
|
+
COMPANION_PROXY_E_NO_DEVICES = -100,
|
|
47
|
+
COMPANION_PROXY_E_UNSUPPORTED_KEY = -101,
|
|
48
|
+
COMPANION_PROXY_E_TIMEOUT_REPLY = -102,
|
|
49
|
+
COMPANION_PROXY_E_UNKNOWN_ERROR = -256
|
|
50
|
+
} companion_proxy_error_t;
|
|
51
|
+
|
|
52
|
+
typedef struct companion_proxy_client_private companion_proxy_client_private; /**< \private */
|
|
53
|
+
typedef companion_proxy_client_private *companion_proxy_client_t; /**< The client handle. */
|
|
54
|
+
|
|
55
|
+
/** Callback for companion device events */
|
|
56
|
+
typedef void (*companion_proxy_device_event_cb_t) (plist_t event, void* userdata);
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Connects to the companion_proxy service on the specified device.
|
|
60
|
+
*
|
|
61
|
+
* @param device The device to connect to.
|
|
62
|
+
* @param service The service descriptor returned by lockdownd_start_service.
|
|
63
|
+
* @param client Pointer that will point to a newly allocated
|
|
64
|
+
* companion_proxy_client_t upon successful return. Must be freed using
|
|
65
|
+
* companion_proxy_client_free() after use.
|
|
66
|
+
*
|
|
67
|
+
* @return COMPANION_PROXY_E_SUCCESS on success, COMPANION_PROXY_E_INVALID_ARG when
|
|
68
|
+
* the arguments are invalid, or an COMPANION_PROXY_E_* error code otherwise.
|
|
69
|
+
*/
|
|
70
|
+
LIBIMOBILEDEVICE_API companion_proxy_error_t companion_proxy_client_new(idevice_t device, lockdownd_service_descriptor_t service, companion_proxy_client_t* client);
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Starts a new companion_proxy service on the specified device and connects to it.
|
|
74
|
+
*
|
|
75
|
+
* @param device The device to connect to.
|
|
76
|
+
* @param client Pointer that will point to a newly allocated
|
|
77
|
+
* companion_proxy_client_t upon successful return. Must be freed using
|
|
78
|
+
* companion_proxy_client_free() after use.
|
|
79
|
+
* @param label The label to use for communication. Usually the program name.
|
|
80
|
+
* Pass NULL to disable sending the label in requests to lockdownd.
|
|
81
|
+
*
|
|
82
|
+
* @return COMPANION_PROXY_E_SUCCESS on success, or an COMPANION_PROXY_E_* error
|
|
83
|
+
* code otherwise.
|
|
84
|
+
*/
|
|
85
|
+
LIBIMOBILEDEVICE_API companion_proxy_error_t companion_proxy_client_start_service(idevice_t device, companion_proxy_client_t* client, const char* label);
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Disconnects a companion_proxy client from the device and frees up the
|
|
89
|
+
* companion_proxy client data.
|
|
90
|
+
*
|
|
91
|
+
* @param client The companion_proxy client to disconnect and free.
|
|
92
|
+
*
|
|
93
|
+
* @return COMPANION_PROXY_E_SUCCESS on success, COMPANION_PROXY_E_INVALID_ARG when
|
|
94
|
+
* client is NULL, or an COMPANION_PROXY_E_* error code otherwise.
|
|
95
|
+
*/
|
|
96
|
+
LIBIMOBILEDEVICE_API companion_proxy_error_t companion_proxy_client_free(companion_proxy_client_t client);
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Sends a plist to the service.
|
|
100
|
+
*
|
|
101
|
+
* @param client The companion_proxy client
|
|
102
|
+
* @param plist The plist to send
|
|
103
|
+
*
|
|
104
|
+
* @return COMPANION_PROXY_E_SUCCESS on success,
|
|
105
|
+
* COMPANION_PROXY_E_INVALID_ARG when client or plist is NULL
|
|
106
|
+
*/
|
|
107
|
+
LIBIMOBILEDEVICE_API companion_proxy_error_t companion_proxy_send(companion_proxy_client_t client, plist_t plist);
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Receives a plist from the service.
|
|
111
|
+
*
|
|
112
|
+
* @param client The companion_proxy client
|
|
113
|
+
* @param plist The plist to store the received data
|
|
114
|
+
*
|
|
115
|
+
* @return COMPANION_PROXY_E_SUCCESS on success,
|
|
116
|
+
* COMPANION_PROXY_E_INVALID_ARG when client or plist is NULL
|
|
117
|
+
*/
|
|
118
|
+
LIBIMOBILEDEVICE_API companion_proxy_error_t companion_proxy_receive(companion_proxy_client_t client, plist_t * plist);
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Retrieves a list of paired devices.
|
|
122
|
+
*
|
|
123
|
+
* @param client The companion_proxy client
|
|
124
|
+
* @param paired_devices Point that will receive a PLIST_ARRAY with paired device UDIDs
|
|
125
|
+
*
|
|
126
|
+
* @note The device closes the connection after sending the reply.
|
|
127
|
+
*
|
|
128
|
+
* @return COMPANION_PROXY_E_SUCCESS on success,
|
|
129
|
+
* COMPANION_PROXY_E_NO_DEVICES if no devices are paired,
|
|
130
|
+
* or a COMPANION_PROXY_E_* error code otherwise.
|
|
131
|
+
*/
|
|
132
|
+
LIBIMOBILEDEVICE_API companion_proxy_error_t companion_proxy_get_device_registry(companion_proxy_client_t client, plist_t* paired_devices);
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Starts listening for paired devices.
|
|
136
|
+
*
|
|
137
|
+
* @param client The companion_proxy client
|
|
138
|
+
* @param callback Callback function that will be called when a new device is detected
|
|
139
|
+
* @param userdata Pointer that that will be passed to the callback function
|
|
140
|
+
*
|
|
141
|
+
* @note The event parameter that gets passed to the callback function is
|
|
142
|
+
* freed internally after returning from the callback. The consumer needs
|
|
143
|
+
* to make a copy if required.
|
|
144
|
+
*
|
|
145
|
+
* @return COMPANION_PROXY_E_SUCCESS on success,
|
|
146
|
+
* or a COMPANION_PROXY_E_* error code otherwise.
|
|
147
|
+
*/
|
|
148
|
+
LIBIMOBILEDEVICE_API companion_proxy_error_t companion_proxy_start_listening_for_devices(companion_proxy_client_t client, companion_proxy_device_event_cb_t callback, void* userdata);
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Stops listening for paired devices
|
|
152
|
+
*
|
|
153
|
+
* @param client The companion_proxy client
|
|
154
|
+
*
|
|
155
|
+
* @return COMPANION_PROXY_E_SUCCESS on success,
|
|
156
|
+
* or a COMPANION_PROXY_E_* error code otherwise.
|
|
157
|
+
*/
|
|
158
|
+
LIBIMOBILEDEVICE_API companion_proxy_error_t companion_proxy_stop_listening_for_devices(companion_proxy_client_t client);
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Returns a value for the given key.
|
|
162
|
+
*
|
|
163
|
+
* @param client The companion_proxy client
|
|
164
|
+
* @param companion_udid UDID of the (paired) companion device
|
|
165
|
+
* @param key The key to retrieve the value for
|
|
166
|
+
* @param value A pointer to a plist_t that will receive the value for the given key.
|
|
167
|
+
* The consumer is responsible for freeing the value with plist_free() when no longer needed.
|
|
168
|
+
*
|
|
169
|
+
* @note The device closes the connection after sending the reply.
|
|
170
|
+
*
|
|
171
|
+
* @return COMPANION_PROXY_E_SUCCESS on success,
|
|
172
|
+
* COMPANION_PROXY_E_INVALID_ARG when client or paired_devices is invalid,
|
|
173
|
+
* COMPANION_PROXY_E_UNSUPPORTED_KEY if the companion device doesn't support the given key,
|
|
174
|
+
* or a COMPANION_PROXY_E_* error code otherwise.
|
|
175
|
+
*/
|
|
176
|
+
LIBIMOBILEDEVICE_API companion_proxy_error_t companion_proxy_get_value_from_registry(companion_proxy_client_t client, const char* companion_udid, const char* key, plist_t* value);
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Start forwarding a service port on the companion device to a port on the idevice.
|
|
180
|
+
*
|
|
181
|
+
* @see companion_proxy_stop_forwarding_service_port
|
|
182
|
+
*
|
|
183
|
+
* @param client The companion_proxy client
|
|
184
|
+
* @param remote_port remote port
|
|
185
|
+
* @param service_name The name of the service that shall be forwarded
|
|
186
|
+
* @param forward_port Pointer that will receive the newly-assigned port accessible via USB/Network on the idevice
|
|
187
|
+
* @param options PLIST_DICT with additional options. Currently known are
|
|
188
|
+
* IsServiceLowPriority (boolean) and PreferWifi (boolean).
|
|
189
|
+
*
|
|
190
|
+
* @return COMPANION_PROXY_E_SUCCESS on success,
|
|
191
|
+
* or a COMPANION_PROXY_E_* error code otherwise.
|
|
192
|
+
*/
|
|
193
|
+
LIBIMOBILEDEVICE_API companion_proxy_error_t companion_proxy_start_forwarding_service_port(companion_proxy_client_t client, uint16_t remote_port, const char* service_name, uint16_t* forward_port, plist_t options);
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Stop forwarding a service port between companion device and idevice.
|
|
197
|
+
*
|
|
198
|
+
* @see companion_proxy_start_forwarding_service_port
|
|
199
|
+
*
|
|
200
|
+
* @param client The companion_proxy client
|
|
201
|
+
* @param remote_port remote port
|
|
202
|
+
*
|
|
203
|
+
* @return COMPANION_PROXY_E_SUCCESS on success,
|
|
204
|
+
* or a COMPANION_PROXY_E_* error code otherwise.
|
|
205
|
+
*/
|
|
206
|
+
LIBIMOBILEDEVICE_API companion_proxy_error_t companion_proxy_stop_forwarding_service_port(companion_proxy_client_t client, uint16_t remote_port);
|
|
207
|
+
|
|
208
|
+
#ifdef __cplusplus
|
|
209
|
+
}
|
|
210
|
+
#endif
|
|
211
|
+
|
|
212
|
+
#endif
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file libimobiledevice/debugserver.h
|
|
3
|
+
* @brief Communicate with debugserver on the device.
|
|
4
|
+
* \internal
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) 2014 Martin Szulecki All Rights Reserved.
|
|
7
|
+
*
|
|
8
|
+
* This library is free software; you can redistribute it and/or
|
|
9
|
+
* modify it under the terms of the GNU Lesser General Public
|
|
10
|
+
* License as published by the Free Software Foundation; either
|
|
11
|
+
* version 2.1 of the License, or (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This library is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
16
|
+
* Lesser General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU Lesser General Public
|
|
19
|
+
* License along with this library; if not, write to the Free Software
|
|
20
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
#ifndef IDEBUGSERVER_H
|
|
24
|
+
#define IDEBUGSERVER_H
|
|
25
|
+
|
|
26
|
+
#ifdef __cplusplus
|
|
27
|
+
extern "C" {
|
|
28
|
+
#endif
|
|
29
|
+
|
|
30
|
+
#include <libimobiledevice/libimobiledevice.h>
|
|
31
|
+
#include <libimobiledevice/lockdown.h>
|
|
32
|
+
|
|
33
|
+
/** Service identifier passed to lockdownd_start_service() to start the debugserver service */
|
|
34
|
+
#define DEBUGSERVER_SERVICE_NAME "com.apple.debugserver"
|
|
35
|
+
/** Service identifier passed to lockdownd_start_service() to start the secure debugserver service */
|
|
36
|
+
#define DEBUGSERVER_SECURE_SERVICE_NAME DEBUGSERVER_SERVICE_NAME ".DVTSecureSocketProxy"
|
|
37
|
+
|
|
38
|
+
/** Error Codes */
|
|
39
|
+
typedef enum {
|
|
40
|
+
DEBUGSERVER_E_SUCCESS = 0,
|
|
41
|
+
DEBUGSERVER_E_INVALID_ARG = -1,
|
|
42
|
+
DEBUGSERVER_E_MUX_ERROR = -2,
|
|
43
|
+
DEBUGSERVER_E_SSL_ERROR = -3,
|
|
44
|
+
DEBUGSERVER_E_RESPONSE_ERROR = -4,
|
|
45
|
+
DEBUGSERVER_E_TIMEOUT = -5,
|
|
46
|
+
DEBUGSERVER_E_UNKNOWN_ERROR = -256
|
|
47
|
+
} debugserver_error_t;
|
|
48
|
+
|
|
49
|
+
typedef struct debugserver_client_private debugserver_client_private; /**< \private */
|
|
50
|
+
typedef debugserver_client_private *debugserver_client_t; /**< The client handle. */
|
|
51
|
+
|
|
52
|
+
typedef struct debugserver_command_private debugserver_command_private; /**< \private */
|
|
53
|
+
typedef debugserver_command_private *debugserver_command_t; /**< The command handle. */
|
|
54
|
+
|
|
55
|
+
/* Interface */
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Connects to the debugserver service on the specified device.
|
|
59
|
+
*
|
|
60
|
+
* @param device The device to connect to.
|
|
61
|
+
* @param service The service descriptor returned by lockdownd_start_service.
|
|
62
|
+
* @param client Pointer that will point to a newly allocated
|
|
63
|
+
* debugserver_client_t upon successful return. Must be freed using
|
|
64
|
+
* debugserver_client_free() after use.
|
|
65
|
+
*
|
|
66
|
+
* @return DEBUGSERVER_E_SUCCESS on success, DEBUGSERVER_E_INVALID_ARG when
|
|
67
|
+
* client is NULL, or an DEBUGSERVER_E_* error code otherwise.
|
|
68
|
+
*/
|
|
69
|
+
LIBIMOBILEDEVICE_API debugserver_error_t debugserver_client_new(idevice_t device, lockdownd_service_descriptor_t service, debugserver_client_t * client);
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Starts a new debugserver service on the specified device and connects to it.
|
|
73
|
+
*
|
|
74
|
+
* @param device The device to connect to.
|
|
75
|
+
* @param client Pointer that will point to a newly allocated
|
|
76
|
+
* debugserver_client_t upon successful return. Must be freed using
|
|
77
|
+
* debugserver_client_free() after use.
|
|
78
|
+
* @param label The label to use for communication. Usually the program name.
|
|
79
|
+
* Pass NULL to disable sending the label in requests to lockdownd.
|
|
80
|
+
*
|
|
81
|
+
* @return DEBUGSERVER_E_SUCCESS on success, or an DEBUGSERVER_E_* error
|
|
82
|
+
* code otherwise.
|
|
83
|
+
*/
|
|
84
|
+
LIBIMOBILEDEVICE_API debugserver_error_t debugserver_client_start_service(idevice_t device, debugserver_client_t * client, const char* label);
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Disconnects a debugserver client from the device and frees up the
|
|
88
|
+
* debugserver client data.
|
|
89
|
+
*
|
|
90
|
+
* @param client The debugserver client to disconnect and free.
|
|
91
|
+
*
|
|
92
|
+
* @return DEBUGSERVER_E_SUCCESS on success, DEBUGSERVER_E_INVALID_ARG when
|
|
93
|
+
* client is NULL, or an DEBUGSERVER_E_* error code otherwise.
|
|
94
|
+
*/
|
|
95
|
+
LIBIMOBILEDEVICE_API debugserver_error_t debugserver_client_free(debugserver_client_t client);
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Sends raw data using the given debugserver service client.
|
|
99
|
+
*
|
|
100
|
+
* @param client The debugserver client to use for sending
|
|
101
|
+
* @param data Data to send
|
|
102
|
+
* @param size Size of the data to send
|
|
103
|
+
* @param sent Number of bytes sent (can be NULL to ignore)
|
|
104
|
+
*
|
|
105
|
+
* @return DEBUGSERVER_E_SUCCESS on success,
|
|
106
|
+
* DEBUGSERVER_E_INVALID_ARG when one or more parameters are
|
|
107
|
+
* invalid, or DEBUGSERVER_E_UNKNOWN_ERROR when an unspecified
|
|
108
|
+
* error occurs.
|
|
109
|
+
*/
|
|
110
|
+
LIBIMOBILEDEVICE_API debugserver_error_t debugserver_client_send(debugserver_client_t client, const char* data, uint32_t size, uint32_t *sent);
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Receives raw data using the given debugserver client with specified timeout.
|
|
114
|
+
*
|
|
115
|
+
* @param client The debugserver client to use for receiving
|
|
116
|
+
* @param data Buffer that will be filled with the data received
|
|
117
|
+
* @param size Number of bytes to receive
|
|
118
|
+
* @param received Number of bytes received (can be NULL to ignore)
|
|
119
|
+
* @param timeout Maximum time in milliseconds to wait for data.
|
|
120
|
+
*
|
|
121
|
+
* @return DEBUGSERVER_E_SUCCESS on success,
|
|
122
|
+
* DEBUGSERVER_E_INVALID_ARG when one or more parameters are
|
|
123
|
+
* invalid, DEBUGSERVER_E_MUX_ERROR when a communication error
|
|
124
|
+
* occurs, DEBUGSERVER_E_TIMEOUT when the timeout is reached,
|
|
125
|
+
* or DEBUGSERVER_E_UNKNOWN_ERROR when an unspecified
|
|
126
|
+
* error occurs.
|
|
127
|
+
*/
|
|
128
|
+
LIBIMOBILEDEVICE_API debugserver_error_t debugserver_client_receive_with_timeout(debugserver_client_t client, char *data, uint32_t size, uint32_t *received, unsigned int timeout);
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Receives raw data from the debugserver service.
|
|
132
|
+
*
|
|
133
|
+
* @param client The debugserver client
|
|
134
|
+
* @param data Buffer that will be filled with the data received
|
|
135
|
+
* @param size Number of bytes to receive
|
|
136
|
+
* @param received Number of bytes received (can be NULL to ignore)
|
|
137
|
+
* @note The default read timeout is 10 seconds.
|
|
138
|
+
*
|
|
139
|
+
* @return DEBUGSERVER_E_SUCCESS on success,
|
|
140
|
+
* DEBUGSERVER_E_INVALID_ARG when client or plist is NULL
|
|
141
|
+
*/
|
|
142
|
+
LIBIMOBILEDEVICE_API debugserver_error_t debugserver_client_receive(debugserver_client_t client, char *data, uint32_t size, uint32_t *received);
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Sends a command to the debugserver service.
|
|
146
|
+
*
|
|
147
|
+
* @param client The debugserver client
|
|
148
|
+
* @param command Command to process and send
|
|
149
|
+
* @param response Response received for the command (can be NULL to ignore)
|
|
150
|
+
* @param response_size Pointer to receive response size. Set to NULL to ignore.
|
|
151
|
+
*
|
|
152
|
+
* @return DEBUGSERVER_E_SUCCESS on success,
|
|
153
|
+
* DEBUGSERVER_E_INVALID_ARG when client or command is NULL
|
|
154
|
+
*/
|
|
155
|
+
LIBIMOBILEDEVICE_API debugserver_error_t debugserver_client_send_command(debugserver_client_t client, debugserver_command_t command, char** response, size_t* response_size);
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Receives and parses response of debugserver service.
|
|
159
|
+
*
|
|
160
|
+
* @param client The debugserver client
|
|
161
|
+
* @param response Response received for last command (can be NULL to ignore)
|
|
162
|
+
* @param response_size Pointer to receive response size. Set to NULL to ignore.
|
|
163
|
+
*
|
|
164
|
+
* @return DEBUGSERVER_E_SUCCESS on success,
|
|
165
|
+
* DEBUGSERVER_E_INVALID_ARG when client is NULL
|
|
166
|
+
*/
|
|
167
|
+
LIBIMOBILEDEVICE_API debugserver_error_t debugserver_client_receive_response(debugserver_client_t client, char** response, size_t* response_size);
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Controls status of ACK mode when sending commands or receiving responses.
|
|
171
|
+
*
|
|
172
|
+
* @see debugserver_client_send_command, debugserver_client_receive_response
|
|
173
|
+
*
|
|
174
|
+
* @param client The debugserver client
|
|
175
|
+
* @param enabled A boolean flag indicating whether the internal ACK mode
|
|
176
|
+
* handling should be enabled or disabled.
|
|
177
|
+
*
|
|
178
|
+
* @return DEBUGSERVER_E_SUCCESS on success, or an DEBUGSERVER_E_* error
|
|
179
|
+
* code otherwise.
|
|
180
|
+
*/
|
|
181
|
+
LIBIMOBILEDEVICE_API debugserver_error_t debugserver_client_set_ack_mode(debugserver_client_t client, int enabled);
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Sets behavior when awaiting a response from the server.
|
|
185
|
+
*
|
|
186
|
+
* @see debugserver_client_send_command, debugserver_client_receive_response,
|
|
187
|
+
* debugserver_client_receive
|
|
188
|
+
*
|
|
189
|
+
* @param client The debugserver client
|
|
190
|
+
* @param cancel_receive A function pointer that will be called approximately
|
|
191
|
+
* every receive_loop_timeout milliseconds; the function should return a
|
|
192
|
+
* boolean flag specifying whether to stop waiting for a response. If NULL,
|
|
193
|
+
* behaves as if it always returns true.
|
|
194
|
+
* @param receive_loop_timeout Time in milliseconds between calls to
|
|
195
|
+
* cancel_receive.
|
|
196
|
+
*
|
|
197
|
+
* @return DEBUGSERVER_E_SUCCESS on success, or an DEBUGSERVER_E_* error
|
|
198
|
+
* code otherwise.
|
|
199
|
+
*/
|
|
200
|
+
LIBIMOBILEDEVICE_API debugserver_error_t debugserver_client_set_receive_params(debugserver_client_t client, int (*cancel_receive)(), int receive_loop_timeout);
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Sets the argv which launches an app.
|
|
204
|
+
*
|
|
205
|
+
* @param client The debugserver client
|
|
206
|
+
* @param argc Number of arguments
|
|
207
|
+
* @param argv Array starting with the executable to be run followed by it's arguments
|
|
208
|
+
* @param response Response received for the command (can be NULL to ignore)
|
|
209
|
+
*
|
|
210
|
+
* @return DEBUGSERVER_E_SUCCESS on success,
|
|
211
|
+
* DEBUGSERVER_E_INVALID_ARG when client is NULL
|
|
212
|
+
*/
|
|
213
|
+
LIBIMOBILEDEVICE_API debugserver_error_t debugserver_client_set_argv(debugserver_client_t client, int argc, char* argv[], char** response);
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Adds or sets an environment variable.
|
|
217
|
+
*
|
|
218
|
+
* @param client The debugserver client
|
|
219
|
+
* @param env The environment variable in "KEY=VALUE" notation
|
|
220
|
+
* @param response Response received for the command (can be NULL to ignore)
|
|
221
|
+
*
|
|
222
|
+
* @return DEBUGSERVER_E_SUCCESS on success,
|
|
223
|
+
* DEBUGSERVER_E_INVALID_ARG when client is NULL
|
|
224
|
+
*/
|
|
225
|
+
LIBIMOBILEDEVICE_API debugserver_error_t debugserver_client_set_environment_hex_encoded(debugserver_client_t client, const char* env, char** response);
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Creates and initializes a new command object.
|
|
229
|
+
*
|
|
230
|
+
* @param name The name of the command which is sent in plain text
|
|
231
|
+
* @param argv Array of tokens for the command ment to be encoded
|
|
232
|
+
* @param argc Number of items in the token array
|
|
233
|
+
* @param command New command object
|
|
234
|
+
*
|
|
235
|
+
* @return DEBUGSERVER_E_SUCCESS on success,
|
|
236
|
+
* DEBUGSERVER_E_INVALID_ARG when name or command is NULL
|
|
237
|
+
*/
|
|
238
|
+
LIBIMOBILEDEVICE_API debugserver_error_t debugserver_command_new(const char* name, int argc, char* argv[], debugserver_command_t* command);
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Frees memory of command object.
|
|
242
|
+
*
|
|
243
|
+
* @param command The command object
|
|
244
|
+
*
|
|
245
|
+
* @return DEBUGSERVER_E_SUCCESS on success,
|
|
246
|
+
* DEBUGSERVER_E_INVALID_ARG when command is NULL
|
|
247
|
+
*/
|
|
248
|
+
LIBIMOBILEDEVICE_API debugserver_error_t debugserver_command_free(debugserver_command_t command);
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Encodes a string into hex notation.
|
|
252
|
+
*
|
|
253
|
+
* @param buffer String to encode into hex notiation
|
|
254
|
+
* @param encoded_buffer The buffer receives a hex encoded string
|
|
255
|
+
* @param encoded_length Length of the hex encoded string
|
|
256
|
+
*/
|
|
257
|
+
LIBIMOBILEDEVICE_API void debugserver_encode_string(const char* buffer, char** encoded_buffer, uint32_t* encoded_length);
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Decodes a hex encoded string.
|
|
261
|
+
*
|
|
262
|
+
* @param encoded_buffer The buffer with a hex encoded string
|
|
263
|
+
* @param encoded_length Length of the encoded buffer
|
|
264
|
+
* @param buffer Decoded string to be freed by the caller
|
|
265
|
+
*/
|
|
266
|
+
LIBIMOBILEDEVICE_API void debugserver_decode_string(const char *encoded_buffer, size_t encoded_length, char** buffer);
|
|
267
|
+
|
|
268
|
+
#ifdef __cplusplus
|
|
269
|
+
}
|
|
270
|
+
#endif
|
|
271
|
+
|
|
272
|
+
#endif
|