@mcesystems/apple-kit 1.0.24 → 1.0.26

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.
Files changed (114) hide show
  1. package/README.md +284 -250
  2. package/dist/index.js +156 -22
  3. package/dist/index.js.map +3 -3
  4. package/dist/index.mjs +156 -24
  5. package/dist/index.mjs.map +3 -3
  6. package/dist/resources/bin/darwin/idevice_id +0 -0
  7. package/dist/resources/bin/darwin/idevicedebug +0 -0
  8. package/dist/resources/bin/darwin/idevicediagnostics +0 -0
  9. package/dist/resources/bin/darwin/ideviceinfo +0 -0
  10. package/dist/resources/bin/darwin/ideviceinstaller +0 -0
  11. package/dist/resources/bin/darwin/idevicename +0 -0
  12. package/dist/resources/bin/darwin/idevicepair +0 -0
  13. package/dist/resources/bin/darwin/idevicescreenshot +0 -0
  14. package/dist/resources/bin/darwin/idevicesyslog +0 -0
  15. package/dist/resources/bin/darwin/iproxy +0 -0
  16. package/dist/resources/bin/darwin/libcrypto.3.dylib +0 -0
  17. package/dist/resources/bin/darwin/libimobiledevice-1.0.6.dylib +0 -0
  18. package/dist/resources/bin/darwin/libimobiledevice-glue-1.0.0.dylib +0 -0
  19. package/dist/resources/bin/darwin/liblzma.5.dylib +0 -0
  20. package/dist/resources/bin/darwin/libplist-2.0.4.dylib +0 -0
  21. package/dist/resources/bin/darwin/libssl.3.dylib +0 -0
  22. package/dist/resources/bin/darwin/libusbmuxd-2.0.7.dylib +0 -0
  23. package/dist/resources/bin/darwin/libzip.5.dylib +0 -0
  24. package/dist/resources/bin/darwin/libzstd.1.dylib +0 -0
  25. package/{resources → dist/resources}/licenses/LGPL-2.1.txt +33 -33
  26. package/dist/types/logic/actions/device.d.ts.map +1 -1
  27. package/dist/types/logic/actions/proxy.d.ts.map +1 -1
  28. package/dist/types/logic/appleDeviceKit.d.ts +1 -1
  29. package/dist/types/logic/appleDeviceKit.d.ts.map +1 -1
  30. package/package.json +7 -4
  31. package/scripts/README.md +209 -0
  32. package/scripts/build-windows.sh.template +134 -0
  33. package/scripts/export-resources.ts +444 -0
  34. package/dist/types/utils/portManager.d.ts +0 -68
  35. package/dist/types/utils/portManager.d.ts.map +0 -1
  36. package/resources/bin/windows/bz2.dll +0 -0
  37. package/resources/bin/windows/getopt.dll +0 -0
  38. package/resources/bin/windows/iconv-2.dll +0 -0
  39. package/resources/bin/windows/idevice_id.exe +0 -0
  40. package/resources/bin/windows/ideviceactivation.exe +0 -0
  41. package/resources/bin/windows/idevicedebug.exe +0 -0
  42. package/resources/bin/windows/ideviceinfo.exe +0 -0
  43. package/resources/bin/windows/ideviceinstaller.exe +0 -0
  44. package/resources/bin/windows/idevicepair.exe +0 -0
  45. package/resources/bin/windows/imobiledevice.dll +0 -0
  46. package/resources/bin/windows/iproxy.exe +0 -0
  47. package/resources/bin/windows/libcrypto-1_1-x64.dll +0 -0
  48. package/resources/bin/windows/libcurl.dll +0 -0
  49. package/resources/bin/windows/libideviceactivation-1.0.dll +0 -0
  50. package/resources/bin/windows/libimobiledevice-1.0.dll +0 -0
  51. package/resources/bin/windows/libimobiledevice-glue-1.0.dll +0 -0
  52. package/resources/bin/windows/libplist-2.0.dll +0 -0
  53. package/resources/bin/windows/libssl-1_1-x64.dll +0 -0
  54. package/resources/bin/windows/libusb-1.0.dll +0 -0
  55. package/resources/bin/windows/libusb0.dll +0 -0
  56. package/resources/bin/windows/libusbmuxd-2.0.dll +0 -0
  57. package/resources/bin/windows/libxml2.dll +0 -0
  58. package/resources/bin/windows/lzma.dll +0 -0
  59. package/resources/bin/windows/pcre.dll +0 -0
  60. package/resources/bin/windows/pcreposix.dll +0 -0
  61. package/resources/bin/windows/plist.dll +0 -0
  62. package/resources/bin/windows/pthreadVC3.dll +0 -0
  63. package/resources/bin/windows/readline.dll +0 -0
  64. package/resources/bin/windows/usbmuxd.dll +0 -0
  65. package/resources/bin/windows/usbmuxd.exe +0 -0
  66. package/resources/bin/windows/vcruntime140.dll +0 -0
  67. package/resources/bin/windows/zip.dll +0 -0
  68. package/resources/bin/windows/zlib1.dll +0 -0
  69. package/resources/lib/include/libimobiledevice/afc.h +0 -413
  70. package/resources/lib/include/libimobiledevice/bt_packet_logger.h +0 -156
  71. package/resources/lib/include/libimobiledevice/companion_proxy.h +0 -212
  72. package/resources/lib/include/libimobiledevice/debugserver.h +0 -272
  73. package/resources/lib/include/libimobiledevice/diagnostics_relay.h +0 -228
  74. package/resources/lib/include/libimobiledevice/file_relay.h +0 -166
  75. package/resources/lib/include/libimobiledevice/heartbeat.h +0 -137
  76. package/resources/lib/include/libimobiledevice/house_arrest.h +0 -180
  77. package/resources/lib/include/libimobiledevice/installation_proxy.h +0 -505
  78. package/resources/lib/include/libimobiledevice/libimobiledevice.h +0 -444
  79. package/resources/lib/include/libimobiledevice/lockdown.h +0 -577
  80. package/resources/lib/include/libimobiledevice/misagent.h +0 -168
  81. package/resources/lib/include/libimobiledevice/mobile_image_mounter.h +0 -275
  82. package/resources/lib/include/libimobiledevice/mobileactivation.h +0 -192
  83. package/resources/lib/include/libimobiledevice/mobilebackup.h +0 -246
  84. package/resources/lib/include/libimobiledevice/mobilebackup2.h +0 -214
  85. package/resources/lib/include/libimobiledevice/mobilesync.h +0 -359
  86. package/resources/lib/include/libimobiledevice/notification_proxy.h +0 -202
  87. package/resources/lib/include/libimobiledevice/ostrace.h +0 -198
  88. package/resources/lib/include/libimobiledevice/preboard.h +0 -187
  89. package/resources/lib/include/libimobiledevice/property_list_service.h +0 -184
  90. package/resources/lib/include/libimobiledevice/restore.h +0 -179
  91. package/resources/lib/include/libimobiledevice/reverse_proxy.h +0 -213
  92. package/resources/lib/include/libimobiledevice/sbservices.h +0 -175
  93. package/resources/lib/include/libimobiledevice/screenshotr.h +0 -118
  94. package/resources/lib/include/libimobiledevice/service.h +0 -202
  95. package/resources/lib/include/libimobiledevice/syslog_relay.h +0 -184
  96. package/resources/lib/include/libimobiledevice/webinspector.h +0 -137
  97. package/resources/lib/include/plist/Array.h +0 -80
  98. package/resources/lib/include/plist/Boolean.h +0 -48
  99. package/resources/lib/include/plist/Data.h +0 -50
  100. package/resources/lib/include/plist/Date.h +0 -54
  101. package/resources/lib/include/plist/Dictionary.h +0 -73
  102. package/resources/lib/include/plist/Integer.h +0 -54
  103. package/resources/lib/include/plist/Key.h +0 -49
  104. package/resources/lib/include/plist/Node.h +0 -57
  105. package/resources/lib/include/plist/Real.h +0 -48
  106. package/resources/lib/include/plist/String.h +0 -52
  107. package/resources/lib/include/plist/Structure.h +0 -62
  108. package/resources/lib/include/plist/Uid.h +0 -48
  109. package/resources/lib/include/plist/plist++.h +0 -39
  110. package/resources/lib/include/plist/plist.h +0 -1448
  111. package/resources/lib/libimobiledevice-1.0.dll +0 -0
  112. package/resources/lib/libimobiledevice-1.0.dll.a +0 -0
  113. package/resources/lib/libplist-2.0.dll +0 -0
  114. package/resources/lib/libplist-2.0.dll.a +0 -0
@@ -1,212 +0,0 @@
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
@@ -1,272 +0,0 @@
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