@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,359 +0,0 @@
1
- /**
2
- * @file libimobiledevice/mobilesync.h
3
- * @brief Synchronize data classes with a device and computer.
4
- * \internal
5
- *
6
- * Copyright (c) 2010-2019 Nikias Bassen, All Rights Reserved.
7
- * Copyright (c) 2010-2014 Martin Szulecki All Rights Reserved.
8
- * Copyright (c) 2014 Christophe Fergeau All Rights Reserved.
9
- * Copyright (c) 2010 Bryan Forbes All Rights Reserved.
10
- * Copyright (c) 2009 Jonathan Beck All Rights Reserved.
11
- *
12
- * This library is free software; you can redistribute it and/or
13
- * modify it under the terms of the GNU Lesser General Public
14
- * License as published by the Free Software Foundation; either
15
- * version 2.1 of the License, or (at your option) any later version.
16
- *
17
- * This library is distributed in the hope that it will be useful,
18
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
19
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20
- * Lesser General Public License for more details.
21
- *
22
- * You should have received a copy of the GNU Lesser General Public
23
- * License along with this library; if not, write to the Free Software
24
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25
- */
26
-
27
- #ifndef IMOBILESYNC_H
28
- #define IMOBILESYNC_H
29
-
30
- #ifdef __cplusplus
31
- extern "C" {
32
- #endif
33
-
34
- #include <libimobiledevice/libimobiledevice.h>
35
- #include <libimobiledevice/lockdown.h>
36
-
37
- /** Service identifier passed to lockdownd_start_service() to start the mobilesync service */
38
- #define MOBILESYNC_SERVICE_NAME "com.apple.mobilesync"
39
-
40
- /** Error Codes */
41
- typedef enum {
42
- MOBILESYNC_E_SUCCESS = 0,
43
- MOBILESYNC_E_INVALID_ARG = -1,
44
- MOBILESYNC_E_PLIST_ERROR = -2,
45
- MOBILESYNC_E_MUX_ERROR = -3,
46
- MOBILESYNC_E_SSL_ERROR = -4,
47
- MOBILESYNC_E_RECEIVE_TIMEOUT = -5,
48
- MOBILESYNC_E_BAD_VERSION = -6,
49
- MOBILESYNC_E_SYNC_REFUSED = -7,
50
- MOBILESYNC_E_CANCELLED = -8,
51
- MOBILESYNC_E_WRONG_DIRECTION = -9,
52
- MOBILESYNC_E_NOT_READY = -10,
53
- MOBILESYNC_E_UNKNOWN_ERROR = -256
54
- } mobilesync_error_t;
55
-
56
- /** The sync type of the current sync session. */
57
- typedef enum {
58
- MOBILESYNC_SYNC_TYPE_FAST, /**< Fast-sync requires that only the changes made since the last synchronization should be reported by the computer. */
59
- MOBILESYNC_SYNC_TYPE_SLOW, /**< Slow-sync requires that all data from the computer needs to be synchronized/sent. */
60
- MOBILESYNC_SYNC_TYPE_RESET /**< Reset-sync signals that the computer should send all data again. */
61
- } mobilesync_sync_type_t;
62
-
63
- typedef struct mobilesync_client_private mobilesync_client_private; /**< \private */
64
- typedef mobilesync_client_private *mobilesync_client_t; /**< The client handle */
65
-
66
- /** Anchors used by the device and computer (structure) */
67
- typedef struct {
68
- char *device_anchor; /**< device anchor */
69
- char *computer_anchor; /**< computer anchor */
70
- } mobilesync_anchors;
71
- /** Anchors used by the device and computer */
72
- typedef mobilesync_anchors *mobilesync_anchors_t;
73
-
74
- /* Interface */
75
-
76
- /**
77
- * Connects to the mobilesync service on the specified device.
78
- *
79
- * @param device The device to connect to.
80
- * @param service The service descriptor returned by lockdownd_start_service.
81
- * @param client Pointer that will be set to a newly allocated
82
- * #mobilesync_client_t upon successful return.
83
- *
84
- * @retval MOBILESYNC_E_SUCCESS on success
85
- * @retval MOBILESYNC_E_INVALID_ARG if one or more parameters are invalid
86
- * @retval DEVICE_LINK_SERVICE_E_BAD_VERSION if the mobilesync version on
87
- * the device is newer.
88
- */
89
- LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_client_new(idevice_t device, lockdownd_service_descriptor_t service, mobilesync_client_t * client);
90
-
91
- /**
92
- * Starts a new mobilesync service on the specified device and connects to it.
93
- *
94
- * @param device The device to connect to.
95
- * @param client Pointer that will point to a newly allocated
96
- * mobilesync_client_t upon successful return. Must be freed using
97
- * mobilesync_client_free() after use.
98
- * @param label The label to use for communication. Usually the program name.
99
- * Pass NULL to disable sending the label in requests to lockdownd.
100
- *
101
- * @return MOBILESYNC_E_SUCCESS on success, or an MOBILESYNC_E_* error
102
- * code otherwise.
103
- */
104
- LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_client_start_service(idevice_t device, mobilesync_client_t* client, const char* label);
105
-
106
- /**
107
- * Disconnects a mobilesync client from the device and frees up the
108
- * mobilesync client data.
109
- *
110
- * @param client The mobilesync client to disconnect and free.
111
- *
112
- * @retval MOBILESYNC_E_SUCCESS on success
113
- * @retval MOBILESYNC_E_INVALID_ARG if \a client is NULL.
114
- */
115
- LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_client_free(mobilesync_client_t client);
116
-
117
-
118
- /**
119
- * Polls the device for mobilesync data.
120
- *
121
- * @param client The mobilesync client
122
- * @param plist A pointer to the location where the plist should be stored
123
- *
124
- * @return an error code
125
- */
126
- LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_receive(mobilesync_client_t client, plist_t *plist);
127
-
128
- /**
129
- * Sends mobilesync data to the device
130
- *
131
- * @note This function is low-level and should only be used if you need to send
132
- * a new type of message.
133
- *
134
- * @param client The mobilesync client
135
- * @param plist The location of the plist to send
136
- *
137
- * @return an error code
138
- */
139
- LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_send(mobilesync_client_t client, plist_t plist);
140
-
141
-
142
- /**
143
- * Requests starting synchronization of a data class with the device
144
- *
145
- * @param client The mobilesync client
146
- * @param data_class The data class identifier to sync
147
- * @param anchors The anchors required to exchange with the device. The anchors
148
- * allow the device to tell if the synchronization information on the computer
149
- * and device are consistent to determine what sync type is required.
150
- * @param computer_data_class_version The version of the data class storage on the computer
151
- * @param sync_type A pointer to store the sync type reported by the device_anchor
152
- * @param device_data_class_version The version of the data class storage on the device
153
- * @param error_description A pointer to store an error message if reported by the device
154
- *
155
- * @retval MOBILESYNC_E_SUCCESS on success
156
- * @retval MOBILESYNC_E_INVALID_ARG if one of the parameters is invalid
157
- * @retval MOBILESYNC_E_PLIST_ERROR if the received plist is not of valid form
158
- * @retval MOBILESYNC_E_SYNC_REFUSED if the device refused to sync
159
- * @retval MOBILESYNC_E_CANCELLED if the device explicitly cancelled the
160
- * sync request
161
- */
162
- LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_start(mobilesync_client_t client, const char *data_class, mobilesync_anchors_t anchors, uint64_t computer_data_class_version, mobilesync_sync_type_t *sync_type, uint64_t *device_data_class_version, char** error_description);
163
-
164
- /**
165
- * Cancels a running synchronization session with a device at any time.
166
- *
167
- * @param client The mobilesync client
168
- * @param reason The reason to supply to the device for cancelling
169
- *
170
- * @retval MOBILESYNC_E_SUCCESS on success
171
- * @retval MOBILESYNC_E_INVALID_ARG if one of the parameters is invalid
172
- */
173
- LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_cancel(mobilesync_client_t client, const char* reason);
174
-
175
- /**
176
- * Finish a synchronization session of a data class on the device.
177
- * A session must have previously been started using mobilesync_start().
178
- *
179
- * @param client The mobilesync client
180
- *
181
- * @retval MOBILESYNC_E_SUCCESS on success
182
- * @retval MOBILESYNC_E_INVALID_ARG if one of the parameters is invalid
183
- * @retval MOBILESYNC_E_PLIST_ERROR if the received plist is not of valid
184
- * form
185
- */
186
- LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_finish(mobilesync_client_t client);
187
-
188
-
189
- /**
190
- * Requests to receive all records of the currently set data class from the device.
191
- * The actually changes are retrieved using mobilesync_receive_changes() after this
192
- * request has been successful.
193
- *
194
- * @param client The mobilesync client
195
- *
196
- * @retval MOBILESYNC_E_SUCCESS on success
197
- * @retval MOBILESYNC_E_INVALID_ARG if one of the parameters is invalid
198
- */
199
- LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_get_all_records_from_device(mobilesync_client_t client);
200
-
201
- /**
202
- * Requests to receive only changed records of the currently set data class from the device.
203
- * The actually changes are retrieved using mobilesync_receive_changes() after this
204
- * request has been successful.
205
- *
206
- * @param client The mobilesync client
207
- *
208
- * @retval MOBILESYNC_E_SUCCESS on success
209
- * @retval MOBILESYNC_E_INVALID_ARG if one of the parameters is invalid
210
- */
211
- LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_get_changes_from_device(mobilesync_client_t client);
212
-
213
- /**
214
- * Requests the device to delete all records of the current data class
215
- *
216
- * @note The operation must be called after starting synchronization.
217
- *
218
- * @param client The mobilesync client
219
- *
220
- * @retval MOBILESYNC_E_SUCCESS on success
221
- * @retval MOBILESYNC_E_INVALID_ARG if one of the parameters is invalid
222
- * @retval MOBILESYNC_E_PLIST_ERROR if the received plist is not of valid form
223
- */
224
- LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_clear_all_records_on_device(mobilesync_client_t client);
225
-
226
-
227
- /**
228
- * Receives changed entitites of the currently set data class from the device
229
- *
230
- * @param client The mobilesync client
231
- * @param entities A pointer to store the changed entity records as a PLIST_DICT
232
- * @param is_last_record A pointer to store a flag indicating if this submission is the last one
233
- * @param actions A pointer to additional flags the device is sending or NULL to ignore
234
- *
235
- * @retval MOBILESYNC_E_SUCCESS on success
236
- * @retval MOBILESYNC_E_INVALID_ARG if one of the parameters is invalid
237
- * @retval MOBILESYNC_E_CANCELLED if the device explicitly cancelled the
238
- * session
239
- */
240
- LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_receive_changes(mobilesync_client_t client, plist_t *entities, uint8_t *is_last_record, plist_t *actions);
241
-
242
- /**
243
- * Acknowledges to the device that the changes have been merged on the computer
244
- *
245
- * @param client The mobilesync client
246
- *
247
- * @retval MOBILESYNC_E_SUCCESS on success
248
- * @retval MOBILESYNC_E_INVALID_ARG if one of the parameters is invalid
249
- */
250
- LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_acknowledge_changes_from_device(mobilesync_client_t client);
251
-
252
-
253
- /**
254
- * Verifies if the device is ready to receive changes from the computer.
255
- * This call changes the synchronization direction so that mobilesync_send_changes()
256
- * can be used to send changes to the device.
257
- *
258
- * @param client The mobilesync client
259
- *
260
- * @retval MOBILESYNC_E_SUCCESS on success
261
- * @retval MOBILESYNC_E_INVALID_ARG if one of the parameters is invalid
262
- * @retval MOBILESYNC_E_PLIST_ERROR if the received plist is not of valid form
263
- * @retval MOBILESYNC_E_WRONG_DIRECTION if the current sync direction does
264
- * not permit this call
265
- * @retval MOBILESYNC_E_CANCELLED if the device explicitly cancelled the
266
- * session
267
- * @retval MOBILESYNC_E_NOT_READY if the device is not ready to start
268
- * receiving any changes
269
- */
270
- LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_ready_to_send_changes_from_computer(mobilesync_client_t client);
271
-
272
-
273
- /**
274
- * Sends changed entities of the currently set data class to the device
275
- *
276
- * @param client The mobilesync client
277
- * @param entities The changed entity records as a PLIST_DICT
278
- * @param is_last_record A flag indicating if this submission is the last one
279
- * @param actions Additional actions for the device created with mobilesync_actions_new()
280
- * or NULL if no actions should be passed
281
- *
282
- * @retval MOBILESYNC_E_SUCCESS on success
283
- * @retval MOBILESYNC_E_INVALID_ARG if one of the parameters is invalid,
284
- * @retval MOBILESYNC_E_WRONG_DIRECTION if the current sync direction does
285
- * not permit this call
286
- */
287
- LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_send_changes(mobilesync_client_t client, plist_t entities, uint8_t is_last_record, plist_t actions);
288
-
289
- /**
290
- * Receives any remapped identifiers reported after the device merged submitted changes.
291
- *
292
- * @param client The mobilesync client
293
- * @param mapping A pointer to an array plist containing a dict of identifier remappings
294
- *
295
- * @retval MOBILESYNC_E_SUCCESS on success
296
- * @retval MOBILESYNC_E_INVALID_ARG if one of the parameters is invalid
297
- * @retval MOBILESYNC_E_PLIST_ERROR if the received plist is not of valid
298
- * form
299
- * @retval MOBILESYNC_E_WRONG_DIRECTION if the current sync direction does
300
- * not permit this call
301
- * @retval MOBILESYNC_E_CANCELLED if the device explicitly cancelled the
302
- * session
303
- */
304
- LIBIMOBILEDEVICE_API mobilesync_error_t mobilesync_remap_identifiers(mobilesync_client_t client, plist_t *mapping);
305
-
306
- /* Helper */
307
-
308
- /**
309
- * Allocates memory for a new anchors struct initialized with the passed anchors.
310
- *
311
- * @param device_anchor An anchor the device reported the last time or NULL
312
- * if none is known yet which for instance is true on first synchronization.
313
- * @param computer_anchor An arbitrary string to use as anchor for the computer.
314
- *
315
- * @return A new #mobilesync_anchors_t struct. Must be freed using mobilesync_anchors_free().
316
- */
317
- LIBIMOBILEDEVICE_API mobilesync_anchors_t mobilesync_anchors_new(const char *device_anchor, const char *computer_anchor);
318
-
319
- /**
320
- * Free memory used by anchors.
321
- *
322
- * @param anchors The anchors to free.
323
- */
324
- LIBIMOBILEDEVICE_API void mobilesync_anchors_free(mobilesync_anchors_t anchors);
325
-
326
-
327
- /**
328
- * Create a new actions plist to use in mobilesync_send_changes().
329
- *
330
- * @return A new plist_t of type PLIST_DICT.
331
- */
332
- LIBIMOBILEDEVICE_API plist_t mobilesync_actions_new(void);
333
-
334
- /**
335
- * Add one or more new key:value pairs to the given actions plist.
336
- *
337
- * @param actions The actions to modify.
338
- * @param ... KEY, VALUE, [KEY, VALUE], NULL
339
- *
340
- * @note The known keys so far are "SyncDeviceLinkEntityNamesKey" which expects
341
- * an array of entity names, followed by a count paramter as well as
342
- * "SyncDeviceLinkAllRecordsOfPulledEntityTypeSentKey" which expects an
343
- * integer to use as a boolean value indicating that the device should
344
- * link submitted changes and report remapped identifiers.
345
- */
346
- LIBIMOBILEDEVICE_API void mobilesync_actions_add(plist_t actions, ...);
347
-
348
- /**
349
- * Free actions plist.
350
- *
351
- * @param actions The actions plist to free. Does nothing if NULL is passed.
352
- */
353
- LIBIMOBILEDEVICE_API void mobilesync_actions_free(plist_t actions);
354
-
355
- #ifdef __cplusplus
356
- }
357
- #endif
358
-
359
- #endif
@@ -1,202 +0,0 @@
1
- /**
2
- * @file libimobiledevice/notification_proxy.h
3
- * @brief Observe and post notifications.
4
- * \internal
5
- *
6
- * Copyright (c) 2010-2014 Martin Szulecki All Rights Reserved.
7
- * Copyright (c) 2009-2010 Nikias Bassen All Rights Reserved.
8
- *
9
- * This library is free software; you can redistribute it and/or
10
- * modify it under the terms of the GNU Lesser General Public
11
- * License as published by the Free Software Foundation; either
12
- * version 2.1 of the License, or (at your option) any later version.
13
- *
14
- * This library is distributed in the hope that it will be useful,
15
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
- * Lesser General Public License for more details.
18
- *
19
- * You should have received a copy of the GNU Lesser General Public
20
- * License along with this library; if not, write to the Free Software
21
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22
- */
23
-
24
- #ifndef INOTIFICATION_PROXY_H
25
- #define INOTIFICATION_PROXY_H
26
-
27
- #ifdef __cplusplus
28
- extern "C" {
29
- #endif
30
-
31
- #include <libimobiledevice/libimobiledevice.h>
32
- #include <libimobiledevice/lockdown.h>
33
-
34
- /** Service identifier passed to lockdownd_start_service() to start the notification proxy service */
35
- #define NP_SERVICE_NAME "com.apple.mobile.notification_proxy"
36
-
37
- /** Error Codes */
38
- typedef enum {
39
- NP_E_SUCCESS = 0,
40
- NP_E_INVALID_ARG = -1,
41
- NP_E_PLIST_ERROR = -2,
42
- NP_E_CONN_FAILED = -3,
43
- NP_E_UNKNOWN_ERROR = -256
44
- } np_error_t;
45
-
46
- /**
47
- * @name Notifications that can be sent
48
- *
49
- * For use with np_post_notification() (client --> device)
50
- */
51
- /**@{*/
52
- //! @cond
53
- #define NP_SYNC_WILL_START "com.apple.itunes-mobdev.syncWillStart"
54
- #define NP_SYNC_DID_START "com.apple.itunes-mobdev.syncDidStart"
55
- #define NP_SYNC_DID_FINISH "com.apple.itunes-mobdev.syncDidFinish"
56
- #define NP_SYNC_LOCK_REQUEST "com.apple.itunes-mobdev.syncLockRequest"
57
- //! @endcond
58
- /**@}*/
59
-
60
- /**
61
- * @name Notifications that can be received
62
- *
63
- * For use with np_observe_notification() (device --> client)
64
- */
65
- /**@{*/
66
- //! @cond
67
- #define NP_SYNC_CANCEL_REQUEST "com.apple.itunes-client.syncCancelRequest"
68
- #define NP_SYNC_SUSPEND_REQUEST "com.apple.itunes-client.syncSuspendRequest"
69
- #define NP_SYNC_RESUME_REQUEST "com.apple.itunes-client.syncResumeRequest"
70
- #define NP_PHONE_NUMBER_CHANGED "com.apple.mobile.lockdown.phone_number_changed"
71
- #define NP_DEVICE_NAME_CHANGED "com.apple.mobile.lockdown.device_name_changed"
72
- #define NP_TIMEZONE_CHANGED "com.apple.mobile.lockdown.timezone_changed"
73
- #define NP_TRUSTED_HOST_ATTACHED "com.apple.mobile.lockdown.trusted_host_attached"
74
- #define NP_HOST_DETACHED "com.apple.mobile.lockdown.host_detached"
75
- #define NP_HOST_ATTACHED "com.apple.mobile.lockdown.host_attached"
76
- #define NP_REGISTRATION_FAILED "com.apple.mobile.lockdown.registration_failed"
77
- #define NP_ACTIVATION_STATE "com.apple.mobile.lockdown.activation_state"
78
- #define NP_BRICK_STATE "com.apple.mobile.lockdown.brick_state"
79
- #define NP_DISK_USAGE_CHANGED "com.apple.mobile.lockdown.disk_usage_changed" /**< iOS 4.0+ */
80
- #define NP_DS_DOMAIN_CHANGED "com.apple.mobile.data_sync.domain_changed"
81
- #define NP_BACKUP_DOMAIN_CHANGED "com.apple.mobile.backup.domain_changed"
82
- #define NP_APP_INSTALLED "com.apple.mobile.application_installed"
83
- #define NP_APP_UNINSTALLED "com.apple.mobile.application_uninstalled"
84
- #define NP_DEV_IMAGE_MOUNTED "com.apple.mobile.developer_image_mounted"
85
- #define NP_ATTEMPTACTIVATION "com.apple.springboard.attemptactivation"
86
- #define NP_ITDBPREP_DID_END "com.apple.itdbprep.notification.didEnd"
87
- #define NP_LANGUAGE_CHANGED "com.apple.language.changed"
88
- #define NP_ADDRESS_BOOK_PREF_CHANGED "com.apple.AddressBook.PreferenceChanged"
89
- //! @endcond
90
- /**@}*/
91
-
92
- typedef struct np_client_private np_client_private; /**< \private */
93
- typedef np_client_private *np_client_t; /**< The client handle. */
94
-
95
- /** Callback function that reports which notification was received. */
96
- typedef void (*np_notify_cb_t) (const char *notification, void *user_data);
97
-
98
- /* Interface */
99
-
100
- /**
101
- * Connects to the notification_proxy on the specified device.
102
- *
103
- * @param device The device to connect to.
104
- * @param service The service descriptor returned by lockdownd_start_service.
105
- * @param client Pointer that will be set to a newly allocated np_client_t
106
- * upon successful return.
107
- *
108
- * @return NP_E_SUCCESS on success, NP_E_INVALID_ARG when device is NULL,
109
- * or NP_E_CONN_FAILED when the connection to the device could not be
110
- * established.
111
- */
112
- LIBIMOBILEDEVICE_API np_error_t np_client_new(idevice_t device, lockdownd_service_descriptor_t service, np_client_t *client);
113
-
114
- /**
115
- * Starts a new notification proxy service on the specified device and connects to it.
116
- *
117
- * @param device The device to connect to.
118
- * @param client Pointer that will point to a newly allocated
119
- * np_client_t upon successful return. Must be freed using
120
- * np_client_free() after use.
121
- * @param label The label to use for communication. Usually the program name.
122
- * Pass NULL to disable sending the label in requests to lockdownd.
123
- *
124
- * @return NP_E_SUCCESS on success, or an NP_E_* error
125
- * code otherwise.
126
- */
127
- LIBIMOBILEDEVICE_API np_error_t np_client_start_service(idevice_t device, np_client_t* client, const char* label);
128
-
129
- /**
130
- * Disconnects a notification_proxy client from the device and frees up the
131
- * notification_proxy client data.
132
- *
133
- * @param client The notification_proxy client to disconnect and free.
134
- *
135
- * @return NP_E_SUCCESS on success, or NP_E_INVALID_ARG when client is NULL.
136
- */
137
- LIBIMOBILEDEVICE_API np_error_t np_client_free(np_client_t client);
138
-
139
-
140
- /**
141
- * Sends a notification to the device's notification_proxy.
142
- *
143
- * @param client The client to send to
144
- * @param notification The notification message to send
145
- *
146
- * @return NP_E_SUCCESS on success, or an error returned by np_plist_send
147
- */
148
- LIBIMOBILEDEVICE_API np_error_t np_post_notification(np_client_t client, const char *notification);
149
-
150
- /**
151
- * Tells the device to send a notification on the specified event.
152
- *
153
- * @param client The client to send to
154
- * @param notification The notifications that should be observed.
155
- *
156
- * @return NP_E_SUCCESS on success, NP_E_INVALID_ARG when client or
157
- * notification are NULL, or an error returned by np_plist_send.
158
- */
159
- LIBIMOBILEDEVICE_API np_error_t np_observe_notification(np_client_t client, const char *notification);
160
-
161
- /**
162
- * Tells the device to send a notification on specified events.
163
- *
164
- * @param client The client to send to
165
- * @param notification_spec Specification of the notifications that should be
166
- * observed. This is expected to be an array of const char* that MUST have a
167
- * terminating NULL entry.
168
- *
169
- * @return NP_E_SUCCESS on success, NP_E_INVALID_ARG when client is null,
170
- * or an error returned by np_observe_notification.
171
- */
172
- LIBIMOBILEDEVICE_API np_error_t np_observe_notifications(np_client_t client, const char **notification_spec);
173
-
174
- /**
175
- * This function allows an application to define a callback function that will
176
- * be called when a notification has been received.
177
- * It will start a thread that polls for notifications and calls the callback
178
- * function if a notification has been received.
179
- * In case of an error condition when polling for notifications - e.g. device
180
- * disconnect - the thread will call the callback function with an empty
181
- * notification "" and terminate itself.
182
- *
183
- * @param client the NP client
184
- * @param notify_cb pointer to a callback function or NULL to de-register a
185
- * previously set callback function.
186
- * @param user_data Pointer that will be passed to the callback function as
187
- * user data. If notify_cb is NULL, this parameter is ignored.
188
- *
189
- * @note Only one callback function can be registered at the same time;
190
- * any previously set callback function will be removed automatically.
191
- *
192
- * @return NP_E_SUCCESS when the callback was successfully registered,
193
- * NP_E_INVALID_ARG when client is NULL, or NP_E_UNKNOWN_ERROR when
194
- * the callback thread could no be created.
195
- */
196
- LIBIMOBILEDEVICE_API np_error_t np_set_notify_callback(np_client_t client, np_notify_cb_t notify_cb, void *user_data);
197
-
198
- #ifdef __cplusplus
199
- }
200
- #endif
201
-
202
- #endif