@mcesystems/apple-kit 1.0.23 → 1.0.25

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 (116) hide show
  1. package/README.md +284 -250
  2. package/dist/index.js +304 -174
  3. package/dist/index.js.map +4 -4
  4. package/dist/index.mjs +303 -173
  5. package/dist/index.mjs.map +4 -4
  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/index.d.ts +0 -2
  27. package/dist/types/index.d.ts.map +1 -1
  28. package/dist/types/logic/actions/device.d.ts.map +1 -1
  29. package/dist/types/logic/actions/proxy.d.ts.map +1 -1
  30. package/dist/types/logic/appleDeviceKit.d.ts +2 -7
  31. package/dist/types/logic/appleDeviceKit.d.ts.map +1 -1
  32. package/package.json +7 -4
  33. package/scripts/README.md +209 -0
  34. package/scripts/build-windows.sh.template +134 -0
  35. package/scripts/export-resources.ts +444 -0
  36. package/dist/types/utils/portManager.d.ts +0 -68
  37. package/dist/types/utils/portManager.d.ts.map +0 -1
  38. package/resources/bin/windows/bz2.dll +0 -0
  39. package/resources/bin/windows/getopt.dll +0 -0
  40. package/resources/bin/windows/iconv-2.dll +0 -0
  41. package/resources/bin/windows/idevice_id.exe +0 -0
  42. package/resources/bin/windows/ideviceactivation.exe +0 -0
  43. package/resources/bin/windows/idevicedebug.exe +0 -0
  44. package/resources/bin/windows/ideviceinfo.exe +0 -0
  45. package/resources/bin/windows/ideviceinstaller.exe +0 -0
  46. package/resources/bin/windows/idevicepair.exe +0 -0
  47. package/resources/bin/windows/imobiledevice.dll +0 -0
  48. package/resources/bin/windows/iproxy.exe +0 -0
  49. package/resources/bin/windows/libcrypto-1_1-x64.dll +0 -0
  50. package/resources/bin/windows/libcurl.dll +0 -0
  51. package/resources/bin/windows/libideviceactivation-1.0.dll +0 -0
  52. package/resources/bin/windows/libimobiledevice-1.0.dll +0 -0
  53. package/resources/bin/windows/libimobiledevice-glue-1.0.dll +0 -0
  54. package/resources/bin/windows/libplist-2.0.dll +0 -0
  55. package/resources/bin/windows/libssl-1_1-x64.dll +0 -0
  56. package/resources/bin/windows/libusb-1.0.dll +0 -0
  57. package/resources/bin/windows/libusb0.dll +0 -0
  58. package/resources/bin/windows/libusbmuxd-2.0.dll +0 -0
  59. package/resources/bin/windows/libxml2.dll +0 -0
  60. package/resources/bin/windows/lzma.dll +0 -0
  61. package/resources/bin/windows/pcre.dll +0 -0
  62. package/resources/bin/windows/pcreposix.dll +0 -0
  63. package/resources/bin/windows/plist.dll +0 -0
  64. package/resources/bin/windows/pthreadVC3.dll +0 -0
  65. package/resources/bin/windows/readline.dll +0 -0
  66. package/resources/bin/windows/usbmuxd.dll +0 -0
  67. package/resources/bin/windows/usbmuxd.exe +0 -0
  68. package/resources/bin/windows/vcruntime140.dll +0 -0
  69. package/resources/bin/windows/zip.dll +0 -0
  70. package/resources/bin/windows/zlib1.dll +0 -0
  71. package/resources/lib/include/libimobiledevice/afc.h +0 -413
  72. package/resources/lib/include/libimobiledevice/bt_packet_logger.h +0 -156
  73. package/resources/lib/include/libimobiledevice/companion_proxy.h +0 -212
  74. package/resources/lib/include/libimobiledevice/debugserver.h +0 -272
  75. package/resources/lib/include/libimobiledevice/diagnostics_relay.h +0 -228
  76. package/resources/lib/include/libimobiledevice/file_relay.h +0 -166
  77. package/resources/lib/include/libimobiledevice/heartbeat.h +0 -137
  78. package/resources/lib/include/libimobiledevice/house_arrest.h +0 -180
  79. package/resources/lib/include/libimobiledevice/installation_proxy.h +0 -505
  80. package/resources/lib/include/libimobiledevice/libimobiledevice.h +0 -444
  81. package/resources/lib/include/libimobiledevice/lockdown.h +0 -577
  82. package/resources/lib/include/libimobiledevice/misagent.h +0 -168
  83. package/resources/lib/include/libimobiledevice/mobile_image_mounter.h +0 -275
  84. package/resources/lib/include/libimobiledevice/mobileactivation.h +0 -192
  85. package/resources/lib/include/libimobiledevice/mobilebackup.h +0 -246
  86. package/resources/lib/include/libimobiledevice/mobilebackup2.h +0 -214
  87. package/resources/lib/include/libimobiledevice/mobilesync.h +0 -359
  88. package/resources/lib/include/libimobiledevice/notification_proxy.h +0 -202
  89. package/resources/lib/include/libimobiledevice/ostrace.h +0 -198
  90. package/resources/lib/include/libimobiledevice/preboard.h +0 -187
  91. package/resources/lib/include/libimobiledevice/property_list_service.h +0 -184
  92. package/resources/lib/include/libimobiledevice/restore.h +0 -179
  93. package/resources/lib/include/libimobiledevice/reverse_proxy.h +0 -213
  94. package/resources/lib/include/libimobiledevice/sbservices.h +0 -175
  95. package/resources/lib/include/libimobiledevice/screenshotr.h +0 -118
  96. package/resources/lib/include/libimobiledevice/service.h +0 -202
  97. package/resources/lib/include/libimobiledevice/syslog_relay.h +0 -184
  98. package/resources/lib/include/libimobiledevice/webinspector.h +0 -137
  99. package/resources/lib/include/plist/Array.h +0 -80
  100. package/resources/lib/include/plist/Boolean.h +0 -48
  101. package/resources/lib/include/plist/Data.h +0 -50
  102. package/resources/lib/include/plist/Date.h +0 -54
  103. package/resources/lib/include/plist/Dictionary.h +0 -73
  104. package/resources/lib/include/plist/Integer.h +0 -54
  105. package/resources/lib/include/plist/Key.h +0 -49
  106. package/resources/lib/include/plist/Node.h +0 -57
  107. package/resources/lib/include/plist/Real.h +0 -48
  108. package/resources/lib/include/plist/String.h +0 -52
  109. package/resources/lib/include/plist/Structure.h +0 -62
  110. package/resources/lib/include/plist/Uid.h +0 -48
  111. package/resources/lib/include/plist/plist++.h +0 -39
  112. package/resources/lib/include/plist/plist.h +0 -1448
  113. package/resources/lib/libimobiledevice-1.0.dll +0 -0
  114. package/resources/lib/libimobiledevice-1.0.dll.a +0 -0
  115. package/resources/lib/libplist-2.0.dll +0 -0
  116. package/resources/lib/libplist-2.0.dll.a +0 -0
@@ -1,228 +0,0 @@
1
- /**
2
- * @file libimobiledevice/diagnostics_relay.h
3
- * @brief Request iOS diagnostic information from device.
4
- * \internal
5
- *
6
- * Copyright (c) 2012-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 IDIAGNOSTICS_RELAY_H
24
- #define IDIAGNOSTICS_RELAY_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 diagnostics relay service */
34
- #define DIAGNOSTICS_RELAY_SERVICE_NAME "com.apple.mobile.diagnostics_relay"
35
-
36
- /** Error Codes */
37
- typedef enum {
38
- DIAGNOSTICS_RELAY_E_SUCCESS = 0,
39
- DIAGNOSTICS_RELAY_E_INVALID_ARG = -1,
40
- DIAGNOSTICS_RELAY_E_PLIST_ERROR = -2,
41
- DIAGNOSTICS_RELAY_E_MUX_ERROR = -3,
42
- DIAGNOSTICS_RELAY_E_UNKNOWN_REQUEST = -4,
43
- DIAGNOSTICS_RELAY_E_UNKNOWN_ERROR = -256
44
- } diagnostics_relay_error_t;
45
-
46
- /** Action type for #diagnostics_relay_restart and #diagnostics_relay_shutdown */
47
- typedef enum {
48
- DIAGNOSTICS_RELAY_ACTION_FLAG_WAIT_FOR_DISCONNECT = 1 << 1,
49
- DIAGNOSTICS_RELAY_ACTION_FLAG_DISPLAY_PASS = 1 << 2,
50
- DIAGNOSTICS_RELAY_ACTION_FLAG_DISPLAY_FAIL = 1 << 3
51
- } diagnostics_relay_action_t;
52
-
53
- #define DIAGNOSTICS_RELAY_REQUEST_TYPE_ALL "All" /**< Query all available diagnostics */
54
- #define DIAGNOSTICS_RELAY_REQUEST_TYPE_WIFI "WiFi" /**< Query WiFi diagnostics */
55
- #define DIAGNOSTICS_RELAY_REQUEST_TYPE_GAS_GAUGE "GasGauge" /**< Query GasGauge diagnostics */
56
- #define DIAGNOSTICS_RELAY_REQUEST_TYPE_NAND "NAND" /**< Query NAND diagnostics */
57
-
58
- typedef struct diagnostics_relay_client_private diagnostics_relay_client_private; /**< \private */
59
- typedef diagnostics_relay_client_private *diagnostics_relay_client_t; /**< The client handle. */
60
-
61
- /**
62
- * Connects to the diagnostics_relay service on the specified device.
63
- *
64
- * @param device The device to connect to.
65
- * @param service The service descriptor returned by lockdownd_start_service.
66
- * @param client Reference that will point to a newly allocated
67
- * diagnostics_relay_client_t upon successful return.
68
- *
69
- * @return DIAGNOSTICS_RELAY_E_SUCCESS on success,
70
- * DIAGNOSTICS_RELAY_E_INVALID_ARG when one of the parameters is invalid,
71
- * or DIAGNOSTICS_RELAY_E_MUX_ERROR when the connection failed.
72
- */
73
- LIBIMOBILEDEVICE_API diagnostics_relay_error_t diagnostics_relay_client_new(idevice_t device, lockdownd_service_descriptor_t service, diagnostics_relay_client_t *client);
74
-
75
- /**
76
- * Starts a new diagnostics_relay service on the specified device and connects to it.
77
- *
78
- * @param device The device to connect to.
79
- * @param client Pointer that will point to a newly allocated
80
- * diagnostics_relay_client_t upon successful return. Must be freed using
81
- * diagnostics_relay_client_free() after use.
82
- * @param label The label to use for communication. Usually the program name.
83
- * Pass NULL to disable sending the label in requests to lockdownd.
84
- *
85
- * @return DIAGNOSTICS_RELAY_E_SUCCESS on success, or an DIAGNOSTICS_RELAY_E_* error
86
- * code otherwise.
87
- */
88
- LIBIMOBILEDEVICE_API diagnostics_relay_error_t diagnostics_relay_client_start_service(idevice_t device, diagnostics_relay_client_t* client, const char* label);
89
-
90
- /**
91
- * Disconnects a diagnostics_relay client from the device and frees up the
92
- * diagnostics_relay client data.
93
- *
94
- * @param client The diagnostics_relay client to disconnect and free.
95
- *
96
- * @return DIAGNOSTICS_RELAY_E_SUCCESS on success,
97
- * DIAGNOSTICS_RELAY_E_INVALID_ARG when one of client or client->parent
98
- * is invalid, or DIAGNOSTICS_RELAY_E_UNKNOWN_ERROR when the was an
99
- * error freeing the parent property_list_service client.
100
- */
101
- LIBIMOBILEDEVICE_API diagnostics_relay_error_t diagnostics_relay_client_free(diagnostics_relay_client_t client);
102
-
103
-
104
- /**
105
- * Sends the Goodbye request signaling the end of communication.
106
- *
107
- * @param client The diagnostics_relay client
108
- *
109
- * @return DIAGNOSTICS_RELAY_E_SUCCESS on success,
110
- * DIAGNOSTICS_RELAY_E_INVALID_ARG when client is NULL,
111
- * DIAGNOSTICS_RELAY_E_PLIST_ERROR if the device did not acknowledge the
112
- * request
113
- */
114
- LIBIMOBILEDEVICE_API diagnostics_relay_error_t diagnostics_relay_goodbye(diagnostics_relay_client_t client);
115
-
116
- /**
117
- * Puts the device into deep sleep mode and disconnects from host.
118
- *
119
- * @param client The diagnostics_relay client
120
- *
121
- * @return DIAGNOSTICS_RELAY_E_SUCCESS on success,
122
- * DIAGNOSTICS_RELAY_E_INVALID_ARG when client is NULL,
123
- * DIAGNOSTICS_RELAY_E_PLIST_ERROR if the device did not acknowledge the
124
- * request
125
- */
126
- LIBIMOBILEDEVICE_API diagnostics_relay_error_t diagnostics_relay_sleep(diagnostics_relay_client_t client);
127
-
128
- /**
129
- * Restart the device and optionally show a user notification.
130
- *
131
- * @param client The diagnostics_relay client
132
- * @param flags A binary flag combination of
133
- * DIAGNOSTICS_RELAY_ACTION_FLAG_WAIT_FOR_DISCONNECT to wait until
134
- * diagnostics_relay_client_free() disconnects before execution and
135
- * DIAGNOSTICS_RELAY_ACTION_FLAG_DISPLAY_FAIL to show a "FAIL" dialog
136
- * or DIAGNOSTICS_RELAY_ACTION_FLAG_DISPLAY_PASS to show an "OK" dialog
137
- *
138
- * @return DIAGNOSTICS_RELAY_E_SUCCESS on success,
139
- * DIAGNOSTICS_RELAY_E_INVALID_ARG when client is NULL,
140
- * DIAGNOSTICS_RELAY_E_PLIST_ERROR if the device did not acknowledge the
141
- * request
142
- */
143
- LIBIMOBILEDEVICE_API diagnostics_relay_error_t diagnostics_relay_restart(diagnostics_relay_client_t client, diagnostics_relay_action_t flags);
144
-
145
- /**
146
- * Shutdown of the device and optionally show a user notification.
147
- *
148
- * @param client The diagnostics_relay client
149
- * @param flags A binary flag combination of
150
- * DIAGNOSTICS_RELAY_ACTION_FLAG_WAIT_FOR_DISCONNECT to wait until
151
- * diagnostics_relay_client_free() disconnects before execution and
152
- * DIAGNOSTICS_RELAY_ACTION_FLAG_DISPLAY_FAIL to show a "FAIL" dialog
153
- * or DIAGNOSTICS_RELAY_ACTION_FLAG_DISPLAY_PASS to show an "OK" dialog
154
- *
155
- * @return DIAGNOSTICS_RELAY_E_SUCCESS on success,
156
- * DIAGNOSTICS_RELAY_E_INVALID_ARG when client is NULL,
157
- * DIAGNOSTICS_RELAY_E_PLIST_ERROR if the device did not acknowledge the
158
- * request
159
- */
160
- LIBIMOBILEDEVICE_API diagnostics_relay_error_t diagnostics_relay_shutdown(diagnostics_relay_client_t client, diagnostics_relay_action_t flags);
161
-
162
- /**
163
- * Request diagnostics information for a given type.
164
- *
165
- * @param client The diagnostics_relay client
166
- * @param type The type or domain to query for diagnostics. Some known values
167
- * are "All", "WiFi", "GasGauge", and "NAND".
168
- * @param diagnostics A pointer to plist_t that will receive the diagnostics information.
169
- * The consumer has to free the allocated memory with plist_free() when no longer needed.
170
- *
171
- * @return DIAGNOSTICS_RELAY_E_SUCCESS on success,
172
- * DIAGNOSTICS_RELAY_E_INVALID_ARG when client is NULL,
173
- * DIAGNOSTICS_RELAY_E_PLIST_ERROR if the device did not acknowledge the
174
- * request
175
- */
176
- LIBIMOBILEDEVICE_API diagnostics_relay_error_t diagnostics_relay_request_diagnostics(diagnostics_relay_client_t client, const char* type, plist_t* diagnostics);
177
-
178
- /**
179
- * Query one or multiple MobileGestalt keys.
180
- *
181
- * @param client The diagnostics_relay client
182
- * @param keys A PLIST_ARRAY with the keys to query.
183
- * @param result A pointer to plist_t that will receive the result. The consumer
184
- * has to free the allocated memory with plist_free() when no longer needed.
185
- *
186
- * @return DIAGNOSTICS_RELAY_E_SUCCESS on success,
187
- * DIAGNOSTICS_RELAY_E_INVALID_ARG when client is NULL,
188
- * DIAGNOSTICS_RELAY_E_PLIST_ERROR if the device did not acknowledge the
189
- * request
190
- */
191
- LIBIMOBILEDEVICE_API diagnostics_relay_error_t diagnostics_relay_query_mobilegestalt(diagnostics_relay_client_t client, plist_t keys, plist_t* result);
192
-
193
- /**
194
- * Query an IORegistry entry of a given class.
195
- *
196
- * @param client The diagnostics_relay client
197
- * @param entry_name The IORegistry entry name to query.
198
- * @param entry_class The IORegistry class to query.
199
- * @param result A pointer to plist_t that will receive the result. The consumer
200
- * has to free the allocated memory with plist_free() when no longer needed.
201
- *
202
- * @return DIAGNOSTICS_RELAY_E_SUCCESS on success,
203
- * DIAGNOSTICS_RELAY_E_INVALID_ARG when client is NULL,
204
- * DIAGNOSTICS_RELAY_E_PLIST_ERROR if the device did not acknowledge the
205
- * request
206
- */
207
- LIBIMOBILEDEVICE_API diagnostics_relay_error_t diagnostics_relay_query_ioregistry_entry(diagnostics_relay_client_t client, const char* entry_name, const char* entry_class, plist_t* result);
208
-
209
- /**
210
- * Query an IORegistry plane.
211
- *
212
- * @param client The diagnostics_relay client
213
- * @param plane The IORegistry plane name to query.
214
- * @param result A pointer to plist_t that will receive the result. The consumer
215
- * has to free the allocated memory with plist_free() when no longer needed.
216
- *
217
- * @return DIAGNOSTICS_RELAY_E_SUCCESS on success,
218
- * DIAGNOSTICS_RELAY_E_INVALID_ARG when client is NULL,
219
- * DIAGNOSTICS_RELAY_E_PLIST_ERROR if the device did not acknowledge the
220
- * request
221
- */
222
- LIBIMOBILEDEVICE_API diagnostics_relay_error_t diagnostics_relay_query_ioregistry_plane(diagnostics_relay_client_t client, const char* plane, plist_t* result);
223
-
224
- #ifdef __cplusplus
225
- }
226
- #endif
227
-
228
- #endif
@@ -1,166 +0,0 @@
1
- /**
2
- * @file libimobiledevice/file_relay.h
3
- * @brief Retrieve compressed CPIO archives.
4
- * \internal
5
- *
6
- * Copyright (c) 2010-2014 Martin Szulecki All Rights Reserved.
7
- * Copyright (c) 2014 Aaron Burghardt All Rights Reserved.
8
- * Copyright (c) 2010 Nikias Bassen All Rights Reserved.
9
- *
10
- * This library is free software; you can redistribute it and/or
11
- * modify it under the terms of the GNU Lesser General Public
12
- * License as published by the Free Software Foundation; either
13
- * version 2.1 of the License, or (at your option) any later version.
14
- *
15
- * This library is distributed in the hope that it will be useful,
16
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18
- * Lesser General Public License for more details.
19
- *
20
- * You should have received a copy of the GNU Lesser General Public
21
- * License along with this library; if not, write to the Free Software
22
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23
- */
24
-
25
- #ifndef IFILE_RELAY_H
26
- #define IFILE_RELAY_H
27
-
28
- #ifdef __cplusplus
29
- extern "C" {
30
- #endif
31
-
32
- #include <libimobiledevice/libimobiledevice.h>
33
- #include <libimobiledevice/lockdown.h>
34
-
35
- /** Service identifier passed to lockdownd_start_service() to start the file relay service */
36
- #define FILE_RELAY_SERVICE_NAME "com.apple.mobile.file_relay"
37
-
38
- /** Error Codes */
39
- typedef enum {
40
- FILE_RELAY_E_SUCCESS = 0,
41
- FILE_RELAY_E_INVALID_ARG = -1,
42
- FILE_RELAY_E_PLIST_ERROR = -2,
43
- FILE_RELAY_E_MUX_ERROR = -3,
44
- FILE_RELAY_E_INVALID_SOURCE = -4,
45
- FILE_RELAY_E_STAGING_EMPTY = -5,
46
- FILE_RELAY_E_PERMISSION_DENIED = -6,
47
- FILE_RELAY_E_UNKNOWN_ERROR = -256
48
- } file_relay_error_t;
49
-
50
- typedef struct file_relay_client_private file_relay_client_private; /**< \private */
51
- typedef file_relay_client_private *file_relay_client_t; /**< The client handle. */
52
-
53
- /**
54
- * Connects to the file_relay service on the specified device.
55
- *
56
- * @param device The device to connect to.
57
- * @param service The service descriptor returned by lockdownd_start_service.
58
- * @param client Reference that will point to a newly allocated
59
- * file_relay_client_t upon successful return.
60
- *
61
- * @return FILE_RELAY_E_SUCCESS on success,
62
- * FILE_RELAY_E_INVALID_ARG when one of the parameters is invalid,
63
- * or FILE_RELAY_E_MUX_ERROR when the connection failed.
64
- */
65
- LIBIMOBILEDEVICE_API file_relay_error_t file_relay_client_new(idevice_t device, lockdownd_service_descriptor_t service, file_relay_client_t *client);
66
-
67
- /**
68
- * Starts a new file_relay service on the specified device and connects to it.
69
- *
70
- * @param device The device to connect to.
71
- * @param client Pointer that will point to a newly allocated
72
- * file_relay_client_t upon successful return. Must be freed using
73
- * file_relay_client_free() after use.
74
- * @param label The label to use for communication. Usually the program name.
75
- * Pass NULL to disable sending the label in requests to lockdownd.
76
- *
77
- * @return FILE_RELAY_E_SUCCESS on success, or an FILE_RELAY_E_* error
78
- * code otherwise.
79
- */
80
- LIBIMOBILEDEVICE_API file_relay_error_t file_relay_client_start_service(idevice_t device, file_relay_client_t* client, const char* label);
81
-
82
- /**
83
- * Disconnects a file_relay client from the device and frees up the file_relay
84
- * client data.
85
- *
86
- * @param client The file_relay client to disconnect and free.
87
- *
88
- * @return FILE_RELAY_E_SUCCESS on success,
89
- * FILE_RELAY_E_INVALID_ARG when one of client or client->parent
90
- * is invalid, or FILE_RELAY_E_UNKNOWN_ERROR when the was an error
91
- * freeing the parent property_list_service client.
92
- */
93
- LIBIMOBILEDEVICE_API file_relay_error_t file_relay_client_free(file_relay_client_t client);
94
-
95
-
96
- /**
97
- * Request data for the given sources.
98
- *
99
- * @param client The connected file_relay client.
100
- * @param sources A NULL-terminated list of sources to retrieve.
101
- * Valid sources are:
102
- * - AppleSupport
103
- * - Network
104
- * - VPN
105
- * - WiFi
106
- * - UserDatabases
107
- * - CrashReporter
108
- * - tmp
109
- * - SystemConfiguration
110
- * @param connection The connection that has to be used for receiving the
111
- * data using idevice_connection_receive(). The connection will be closed
112
- * automatically by the device, but use file_relay_client_free() to clean
113
- * up properly.
114
- *
115
- * @note WARNING: Don't call this function without reading the data afterwards.
116
- * A directory mobile_file_relay.XXXX used for creating the archive will
117
- * remain in the /tmp directory otherwise.
118
- *
119
- * @return FILE_RELAY_E_SUCCESS on succes, FILE_RELAY_E_INVALID_ARG when one or
120
- * more parameters are invalid, FILE_RELAY_E_MUX_ERROR if a communication
121
- * error occurs, FILE_RELAY_E_PLIST_ERROR when the received result is NULL
122
- * or is not a valid plist, FILE_RELAY_E_INVALID_SOURCE if one or more
123
- * sources are invalid, FILE_RELAY_E_STAGING_EMPTY if no data is available
124
- * for the given sources, or FILE_RELAY_E_UNKNOWN_ERROR otherwise.
125
- */
126
- LIBIMOBILEDEVICE_API file_relay_error_t file_relay_request_sources(file_relay_client_t client, const char **sources, idevice_connection_t *connection);
127
-
128
- /**
129
- * Request data for the given sources. Calls file_relay_request_sources_timeout() with
130
- * a timeout of 60000 milliseconds (60 seconds).
131
- *
132
- * @param client The connected file_relay client.
133
- * @param sources A NULL-terminated list of sources to retrieve.
134
- * Valid sources are:
135
- * - AppleSupport
136
- * - Network
137
- * - VPN
138
- * - WiFi
139
- * - UserDatabases
140
- * - CrashReporter
141
- * - tmp
142
- * - SystemConfiguration
143
- * @param connection The connection that has to be used for receiving the
144
- * data using idevice_connection_receive(). The connection will be closed
145
- * automatically by the device, but use file_relay_client_free() to clean
146
- * up properly.
147
- * @param timeout Maximum time in milliseconds to wait for data.
148
- *
149
- * @note WARNING: Don't call this function without reading the data afterwards.
150
- * A directory mobile_file_relay.XXXX used for creating the archive will
151
- * remain in the /tmp directory otherwise.
152
- *
153
- * @return FILE_RELAY_E_SUCCESS on succes, FILE_RELAY_E_INVALID_ARG when one or
154
- * more parameters are invalid, FILE_RELAY_E_MUX_ERROR if a communication
155
- * error occurs, FILE_RELAY_E_PLIST_ERROR when the received result is NULL
156
- * or is not a valid plist, FILE_RELAY_E_INVALID_SOURCE if one or more
157
- * sources are invalid, FILE_RELAY_E_STAGING_EMPTY if no data is available
158
- * for the given sources, or FILE_RELAY_E_UNKNOWN_ERROR otherwise.
159
- */
160
- LIBIMOBILEDEVICE_API file_relay_error_t file_relay_request_sources_timeout(file_relay_client_t client, const char **sources, idevice_connection_t *connection, unsigned int timeout);
161
-
162
- #ifdef __cplusplus
163
- }
164
- #endif
165
-
166
- #endif
@@ -1,137 +0,0 @@
1
- /**
2
- * @file libimobiledevice/heartbeat.h
3
- * @brief Send "heartbeat" to device to allow service connections over network.
4
- * \internal
5
- *
6
- * Copyright (c) 2013-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 IHEARTBEAT_H
24
- #define IHEARTBEAT_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 heartbeat service */
34
- #define HEARTBEAT_SERVICE_NAME "com.apple.mobile.heartbeat"
35
-
36
- /** Error Codes */
37
- typedef enum {
38
- HEARTBEAT_E_SUCCESS = 0,
39
- HEARTBEAT_E_INVALID_ARG = -1,
40
- HEARTBEAT_E_PLIST_ERROR = -2,
41
- HEARTBEAT_E_MUX_ERROR = -3,
42
- HEARTBEAT_E_SSL_ERROR = -4,
43
- HEARTBEAT_E_NOT_ENOUGH_DATA = -5,
44
- HEARTBEAT_E_TIMEOUT = -6,
45
- HEARTBEAT_E_UNKNOWN_ERROR = -256
46
- } heartbeat_error_t;
47
-
48
- typedef struct heartbeat_client_private heartbeat_client_private; /**< \private */
49
- typedef heartbeat_client_private *heartbeat_client_t; /**< The client handle. */
50
-
51
- /**
52
- * Connects to the heartbeat service on the specified device.
53
- *
54
- * @param device The device to connect to.
55
- * @param service The service descriptor returned by lockdownd_start_service.
56
- * @param client Pointer that will point to a newly allocated
57
- * heartbeat_client_t upon successful return. Must be freed using
58
- * heartbeat_client_free() after use.
59
- *
60
- * @return HEARTBEAT_E_SUCCESS on success, HEARTBEAT_E_INVALID_ARG when
61
- * client is NULL, or an HEARTBEAT_E_* error code otherwise.
62
- */
63
- LIBIMOBILEDEVICE_API heartbeat_error_t heartbeat_client_new(idevice_t device, lockdownd_service_descriptor_t service, heartbeat_client_t * client);
64
-
65
- /**
66
- * Starts a new heartbeat service on the specified device and connects to it.
67
- *
68
- * @param device The device to connect to.
69
- * @param client Pointer that will point to a newly allocated
70
- * heartbeat_client_t upon successful return. Must be freed using
71
- * heartbeat_client_free() after use.
72
- * @param label The label to use for communication. Usually the program name.
73
- * Pass NULL to disable sending the label in requests to lockdownd.
74
- *
75
- * @return HEARTBEAT_E_SUCCESS on success, or an HEARTBEAT_E_* error
76
- * code otherwise.
77
- */
78
- LIBIMOBILEDEVICE_API heartbeat_error_t heartbeat_client_start_service(idevice_t device, heartbeat_client_t * client, const char* label);
79
-
80
- /**
81
- * Disconnects a heartbeat client from the device and frees up the
82
- * heartbeat client data.
83
- *
84
- * @param client The heartbeat client to disconnect and free.
85
- *
86
- * @return HEARTBEAT_E_SUCCESS on success, HEARTBEAT_E_INVALID_ARG when
87
- * client is NULL, or an HEARTBEAT_E_* error code otherwise.
88
- */
89
- LIBIMOBILEDEVICE_API heartbeat_error_t heartbeat_client_free(heartbeat_client_t client);
90
-
91
-
92
- /**
93
- * Sends a plist to the service.
94
- *
95
- * @param client The heartbeat client
96
- * @param plist The plist to send
97
- *
98
- * @return HEARTBEAT_E_SUCCESS on success,
99
- * HEARTBEAT_E_INVALID_ARG when client or plist is NULL
100
- */
101
- LIBIMOBILEDEVICE_API heartbeat_error_t heartbeat_send(heartbeat_client_t client, plist_t plist);
102
-
103
- /**
104
- * Receives a plist from the service.
105
- *
106
- * @param client The heartbeat client
107
- * @param plist The plist to store the received data
108
- *
109
- * @return HEARTBEAT_E_SUCCESS on success,
110
- * HEARTBEAT_E_INVALID_ARG when client or plist is NULL
111
- */
112
- LIBIMOBILEDEVICE_API heartbeat_error_t heartbeat_receive(heartbeat_client_t client, plist_t * plist);
113
-
114
- /**
115
- * Receives a plist using the given heartbeat client.
116
- *
117
- * @param client The heartbeat client to use for receiving
118
- * @param plist pointer to a plist_t that will point to the received plist
119
- * upon successful return
120
- * @param timeout_ms Maximum time in milliseconds to wait for data.
121
- *
122
- * @return HEARTBEAT_E_SUCCESS on success,
123
- * HEARTBEAT_E_INVALID_ARG when client or *plist is NULL,
124
- * HEARTBEAT_E_NOT_ENOUGH_DATA when not enough data
125
- * received, HEARTBEAT_E_TIMEOUT when the connection times out,
126
- * HEARTBEAT_E_PLIST_ERROR when the received data cannot be
127
- * converted to a plist, HEARTBEAT_E_MUX_ERROR when a
128
- * communication error occurs, or HEARTBEAT_E_UNKNOWN_ERROR
129
- * when an unspecified error occurs.
130
- */
131
- LIBIMOBILEDEVICE_API heartbeat_error_t heartbeat_receive_with_timeout(heartbeat_client_t client, plist_t * plist, uint32_t timeout_ms);
132
-
133
- #ifdef __cplusplus
134
- }
135
- #endif
136
-
137
- #endif