@mcesystems/apple-kit 1.0.24 → 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.
- package/README.md +284 -250
- package/dist/index.js +156 -22
- package/dist/index.js.map +3 -3
- package/dist/index.mjs +156 -24
- package/dist/index.mjs.map +3 -3
- package/dist/resources/bin/darwin/idevice_id +0 -0
- package/dist/resources/bin/darwin/idevicedebug +0 -0
- package/dist/resources/bin/darwin/idevicediagnostics +0 -0
- package/dist/resources/bin/darwin/ideviceinfo +0 -0
- package/dist/resources/bin/darwin/ideviceinstaller +0 -0
- package/dist/resources/bin/darwin/idevicename +0 -0
- package/dist/resources/bin/darwin/idevicepair +0 -0
- package/dist/resources/bin/darwin/idevicescreenshot +0 -0
- package/dist/resources/bin/darwin/idevicesyslog +0 -0
- package/dist/resources/bin/darwin/iproxy +0 -0
- package/dist/resources/bin/darwin/libcrypto.3.dylib +0 -0
- package/dist/resources/bin/darwin/libimobiledevice-1.0.6.dylib +0 -0
- package/dist/resources/bin/darwin/libimobiledevice-glue-1.0.0.dylib +0 -0
- package/dist/resources/bin/darwin/liblzma.5.dylib +0 -0
- package/dist/resources/bin/darwin/libplist-2.0.4.dylib +0 -0
- package/dist/resources/bin/darwin/libssl.3.dylib +0 -0
- package/dist/resources/bin/darwin/libusbmuxd-2.0.7.dylib +0 -0
- package/dist/resources/bin/darwin/libzip.5.dylib +0 -0
- package/dist/resources/bin/darwin/libzstd.1.dylib +0 -0
- package/{resources → dist/resources}/licenses/LGPL-2.1.txt +33 -33
- package/dist/types/logic/actions/device.d.ts.map +1 -1
- package/dist/types/logic/actions/proxy.d.ts.map +1 -1
- package/dist/types/logic/appleDeviceKit.d.ts +1 -1
- package/dist/types/logic/appleDeviceKit.d.ts.map +1 -1
- package/package.json +7 -4
- package/scripts/README.md +209 -0
- package/scripts/build-windows.sh.template +134 -0
- package/scripts/export-resources.ts +444 -0
- package/dist/types/utils/portManager.d.ts +0 -68
- package/dist/types/utils/portManager.d.ts.map +0 -1
- package/resources/bin/windows/bz2.dll +0 -0
- package/resources/bin/windows/getopt.dll +0 -0
- package/resources/bin/windows/iconv-2.dll +0 -0
- package/resources/bin/windows/idevice_id.exe +0 -0
- package/resources/bin/windows/ideviceactivation.exe +0 -0
- package/resources/bin/windows/idevicedebug.exe +0 -0
- package/resources/bin/windows/ideviceinfo.exe +0 -0
- package/resources/bin/windows/ideviceinstaller.exe +0 -0
- package/resources/bin/windows/idevicepair.exe +0 -0
- package/resources/bin/windows/imobiledevice.dll +0 -0
- package/resources/bin/windows/iproxy.exe +0 -0
- package/resources/bin/windows/libcrypto-1_1-x64.dll +0 -0
- package/resources/bin/windows/libcurl.dll +0 -0
- package/resources/bin/windows/libideviceactivation-1.0.dll +0 -0
- package/resources/bin/windows/libimobiledevice-1.0.dll +0 -0
- package/resources/bin/windows/libimobiledevice-glue-1.0.dll +0 -0
- package/resources/bin/windows/libplist-2.0.dll +0 -0
- package/resources/bin/windows/libssl-1_1-x64.dll +0 -0
- package/resources/bin/windows/libusb-1.0.dll +0 -0
- package/resources/bin/windows/libusb0.dll +0 -0
- package/resources/bin/windows/libusbmuxd-2.0.dll +0 -0
- package/resources/bin/windows/libxml2.dll +0 -0
- package/resources/bin/windows/lzma.dll +0 -0
- package/resources/bin/windows/pcre.dll +0 -0
- package/resources/bin/windows/pcreposix.dll +0 -0
- package/resources/bin/windows/plist.dll +0 -0
- package/resources/bin/windows/pthreadVC3.dll +0 -0
- package/resources/bin/windows/readline.dll +0 -0
- package/resources/bin/windows/usbmuxd.dll +0 -0
- package/resources/bin/windows/usbmuxd.exe +0 -0
- package/resources/bin/windows/vcruntime140.dll +0 -0
- package/resources/bin/windows/zip.dll +0 -0
- package/resources/bin/windows/zlib1.dll +0 -0
- package/resources/lib/include/libimobiledevice/afc.h +0 -413
- package/resources/lib/include/libimobiledevice/bt_packet_logger.h +0 -156
- package/resources/lib/include/libimobiledevice/companion_proxy.h +0 -212
- package/resources/lib/include/libimobiledevice/debugserver.h +0 -272
- package/resources/lib/include/libimobiledevice/diagnostics_relay.h +0 -228
- package/resources/lib/include/libimobiledevice/file_relay.h +0 -166
- package/resources/lib/include/libimobiledevice/heartbeat.h +0 -137
- package/resources/lib/include/libimobiledevice/house_arrest.h +0 -180
- package/resources/lib/include/libimobiledevice/installation_proxy.h +0 -505
- package/resources/lib/include/libimobiledevice/libimobiledevice.h +0 -444
- package/resources/lib/include/libimobiledevice/lockdown.h +0 -577
- package/resources/lib/include/libimobiledevice/misagent.h +0 -168
- package/resources/lib/include/libimobiledevice/mobile_image_mounter.h +0 -275
- package/resources/lib/include/libimobiledevice/mobileactivation.h +0 -192
- package/resources/lib/include/libimobiledevice/mobilebackup.h +0 -246
- package/resources/lib/include/libimobiledevice/mobilebackup2.h +0 -214
- package/resources/lib/include/libimobiledevice/mobilesync.h +0 -359
- package/resources/lib/include/libimobiledevice/notification_proxy.h +0 -202
- package/resources/lib/include/libimobiledevice/ostrace.h +0 -198
- package/resources/lib/include/libimobiledevice/preboard.h +0 -187
- package/resources/lib/include/libimobiledevice/property_list_service.h +0 -184
- package/resources/lib/include/libimobiledevice/restore.h +0 -179
- package/resources/lib/include/libimobiledevice/reverse_proxy.h +0 -213
- package/resources/lib/include/libimobiledevice/sbservices.h +0 -175
- package/resources/lib/include/libimobiledevice/screenshotr.h +0 -118
- package/resources/lib/include/libimobiledevice/service.h +0 -202
- package/resources/lib/include/libimobiledevice/syslog_relay.h +0 -184
- package/resources/lib/include/libimobiledevice/webinspector.h +0 -137
- package/resources/lib/include/plist/Array.h +0 -80
- package/resources/lib/include/plist/Boolean.h +0 -48
- package/resources/lib/include/plist/Data.h +0 -50
- package/resources/lib/include/plist/Date.h +0 -54
- package/resources/lib/include/plist/Dictionary.h +0 -73
- package/resources/lib/include/plist/Integer.h +0 -54
- package/resources/lib/include/plist/Key.h +0 -49
- package/resources/lib/include/plist/Node.h +0 -57
- package/resources/lib/include/plist/Real.h +0 -48
- package/resources/lib/include/plist/String.h +0 -52
- package/resources/lib/include/plist/Structure.h +0 -62
- package/resources/lib/include/plist/Uid.h +0 -48
- package/resources/lib/include/plist/plist++.h +0 -39
- package/resources/lib/include/plist/plist.h +0 -1448
- package/resources/lib/libimobiledevice-1.0.dll +0 -0
- package/resources/lib/libimobiledevice-1.0.dll.a +0 -0
- package/resources/lib/libplist-2.0.dll +0 -0
- package/resources/lib/libplist-2.0.dll.a +0 -0
|
@@ -1,413 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file libimobiledevice/afc.h
|
|
3
|
-
* @brief Access the filesystem on the device.
|
|
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 IAFC_H
|
|
25
|
-
#define IAFC_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 AFC service */
|
|
35
|
-
#define AFC_SERVICE_NAME "com.apple.afc"
|
|
36
|
-
|
|
37
|
-
/** Error Codes */
|
|
38
|
-
typedef enum {
|
|
39
|
-
AFC_E_SUCCESS = 0,
|
|
40
|
-
AFC_E_UNKNOWN_ERROR = 1,
|
|
41
|
-
AFC_E_OP_HEADER_INVALID = 2,
|
|
42
|
-
AFC_E_NO_RESOURCES = 3,
|
|
43
|
-
AFC_E_READ_ERROR = 4,
|
|
44
|
-
AFC_E_WRITE_ERROR = 5,
|
|
45
|
-
AFC_E_UNKNOWN_PACKET_TYPE = 6,
|
|
46
|
-
AFC_E_INVALID_ARG = 7,
|
|
47
|
-
AFC_E_OBJECT_NOT_FOUND = 8,
|
|
48
|
-
AFC_E_OBJECT_IS_DIR = 9,
|
|
49
|
-
AFC_E_PERM_DENIED = 10,
|
|
50
|
-
AFC_E_SERVICE_NOT_CONNECTED = 11,
|
|
51
|
-
AFC_E_OP_TIMEOUT = 12,
|
|
52
|
-
AFC_E_TOO_MUCH_DATA = 13,
|
|
53
|
-
AFC_E_END_OF_DATA = 14,
|
|
54
|
-
AFC_E_OP_NOT_SUPPORTED = 15,
|
|
55
|
-
AFC_E_OBJECT_EXISTS = 16,
|
|
56
|
-
AFC_E_OBJECT_BUSY = 17,
|
|
57
|
-
AFC_E_NO_SPACE_LEFT = 18,
|
|
58
|
-
AFC_E_OP_WOULD_BLOCK = 19,
|
|
59
|
-
AFC_E_IO_ERROR = 20,
|
|
60
|
-
AFC_E_OP_INTERRUPTED = 21,
|
|
61
|
-
AFC_E_OP_IN_PROGRESS = 22,
|
|
62
|
-
AFC_E_INTERNAL_ERROR = 23,
|
|
63
|
-
AFC_E_MUX_ERROR = 30,
|
|
64
|
-
AFC_E_NO_MEM = 31,
|
|
65
|
-
AFC_E_NOT_ENOUGH_DATA = 32,
|
|
66
|
-
AFC_E_DIR_NOT_EMPTY = 33,
|
|
67
|
-
AFC_E_SSL_ERROR = 34,
|
|
68
|
-
AFC_E_FORCE_SIGNED_TYPE = -1
|
|
69
|
-
} afc_error_t;
|
|
70
|
-
|
|
71
|
-
/** Flags for afc_file_open */
|
|
72
|
-
typedef enum {
|
|
73
|
-
AFC_FOPEN_RDONLY = 0x00000001, /**< r O_RDONLY */
|
|
74
|
-
AFC_FOPEN_RW = 0x00000002, /**< r+ O_RDWR | O_CREAT */
|
|
75
|
-
AFC_FOPEN_WRONLY = 0x00000003, /**< w O_WRONLY | O_CREAT | O_TRUNC */
|
|
76
|
-
AFC_FOPEN_WR = 0x00000004, /**< w+ O_RDWR | O_CREAT | O_TRUNC */
|
|
77
|
-
AFC_FOPEN_APPEND = 0x00000005, /**< a O_WRONLY | O_APPEND | O_CREAT */
|
|
78
|
-
AFC_FOPEN_RDAPPEND = 0x00000006 /**< a+ O_RDWR | O_APPEND | O_CREAT */
|
|
79
|
-
} afc_file_mode_t;
|
|
80
|
-
|
|
81
|
-
/** Type of link for afc_make_link() calls */
|
|
82
|
-
typedef enum {
|
|
83
|
-
AFC_HARDLINK = 1,
|
|
84
|
-
AFC_SYMLINK = 2
|
|
85
|
-
} afc_link_type_t;
|
|
86
|
-
|
|
87
|
-
/** Lock operation flags */
|
|
88
|
-
typedef enum {
|
|
89
|
-
AFC_LOCK_SH = 1 | 4, /**< shared lock */
|
|
90
|
-
AFC_LOCK_EX = 2 | 4, /**< exclusive lock */
|
|
91
|
-
AFC_LOCK_UN = 8 | 4 /**< unlock */
|
|
92
|
-
} afc_lock_op_t;
|
|
93
|
-
|
|
94
|
-
typedef struct afc_client_private afc_client_private; /**< \private */
|
|
95
|
-
typedef afc_client_private *afc_client_t; /**< The client handle. */
|
|
96
|
-
|
|
97
|
-
/* Interface */
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* Makes a connection to the AFC service on the device.
|
|
101
|
-
*
|
|
102
|
-
* @param device The device to connect to.
|
|
103
|
-
* @param service The service descriptor returned by lockdownd_start_service.
|
|
104
|
-
* @param client Pointer that will be set to a newly allocated afc_client_t
|
|
105
|
-
* upon successful return.
|
|
106
|
-
*
|
|
107
|
-
* @return AFC_E_SUCCESS on success, AFC_E_INVALID_ARG if device or service is
|
|
108
|
-
* invalid, AFC_E_MUX_ERROR if the connection cannot be established,
|
|
109
|
-
* or AFC_E_NO_MEM if there is a memory allocation problem.
|
|
110
|
-
*/
|
|
111
|
-
LIBIMOBILEDEVICE_API afc_error_t afc_client_new(idevice_t device, lockdownd_service_descriptor_t service, afc_client_t *client);
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* Starts a new AFC service on the specified device and connects to it.
|
|
115
|
-
*
|
|
116
|
-
* @param device The device to connect to.
|
|
117
|
-
* @param client Pointer that will point to a newly allocated afc_client_t upon
|
|
118
|
-
* successful return. Must be freed using afc_client_free() after use.
|
|
119
|
-
* @param label The label to use for communication. Usually the program name.
|
|
120
|
-
* Pass NULL to disable sending the label in requests to lockdownd.
|
|
121
|
-
*
|
|
122
|
-
* @return AFC_E_SUCCESS on success, or an AFC_E_* error code otherwise.
|
|
123
|
-
*/
|
|
124
|
-
LIBIMOBILEDEVICE_API afc_error_t afc_client_start_service(idevice_t device, afc_client_t* client, const char* label);
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* Frees up an AFC client. If the connection was created by the client itself,
|
|
128
|
-
* the connection will be closed.
|
|
129
|
-
*
|
|
130
|
-
* @param client The client to free.
|
|
131
|
-
*/
|
|
132
|
-
LIBIMOBILEDEVICE_API afc_error_t afc_client_free(afc_client_t client);
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* Get device information for a connected client. The device information
|
|
136
|
-
* returned is the device model as well as the free space, the total capacity
|
|
137
|
-
* and blocksize on the accessed disk partition.
|
|
138
|
-
*
|
|
139
|
-
* @param client The client to get device info for.
|
|
140
|
-
* @param device_information A char list of device information terminated by an
|
|
141
|
-
* empty string or NULL if there was an error. Free with
|
|
142
|
-
* afc_dictionary_free().
|
|
143
|
-
*
|
|
144
|
-
* @return AFC_E_SUCCESS on success or an AFC_E_* error value.
|
|
145
|
-
*/
|
|
146
|
-
LIBIMOBILEDEVICE_API afc_error_t afc_get_device_info(afc_client_t client, char ***device_information);
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* Get device information for a connected client. The device information
|
|
150
|
-
* returned is the device model as well as the free space, the total capacity
|
|
151
|
-
* and blocksize on the accessed disk partition.
|
|
152
|
-
*
|
|
153
|
-
* @param client The client to get device info for.
|
|
154
|
-
* @param device_information A pointer to a plist_t that will be populated
|
|
155
|
-
* with key-value pairs (dictionary) representing the device’s
|
|
156
|
-
* storage and model information. Free with plist_free().
|
|
157
|
-
*
|
|
158
|
-
* @return AFC_E_SUCCESS on success or an AFC_E_* error value.
|
|
159
|
-
*/
|
|
160
|
-
LIBIMOBILEDEVICE_API afc_error_t afc_get_device_info_plist(afc_client_t client, plist_t *device_information);
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* Gets a directory listing of the directory requested.
|
|
164
|
-
*
|
|
165
|
-
* @param client The client to get a directory listing from.
|
|
166
|
-
* @param path The directory for listing. (must be a fully-qualified path)
|
|
167
|
-
* @param directory_information A char list of files in the directory
|
|
168
|
-
* terminated by an empty string or NULL if there was an error. Free with
|
|
169
|
-
* afc_dictionary_free().
|
|
170
|
-
*
|
|
171
|
-
* @return AFC_E_SUCCESS on success or an AFC_E_* error value.
|
|
172
|
-
*/
|
|
173
|
-
LIBIMOBILEDEVICE_API afc_error_t afc_read_directory(afc_client_t client, const char *path, char ***directory_information);
|
|
174
|
-
|
|
175
|
-
/**
|
|
176
|
-
* Gets information about a specific file.
|
|
177
|
-
*
|
|
178
|
-
* @param client The client to use to get the information of the file.
|
|
179
|
-
* @param path The fully-qualified path to the file.
|
|
180
|
-
* @param file_information Pointer to a buffer that will be filled with a
|
|
181
|
-
* NULL-terminated list of strings with the file attributes. Set to NULL
|
|
182
|
-
* before calling this function. Free with afc_dictionary_free().
|
|
183
|
-
*
|
|
184
|
-
* @return AFC_E_SUCCESS on success or an AFC_E_* error value.
|
|
185
|
-
*/
|
|
186
|
-
LIBIMOBILEDEVICE_API afc_error_t afc_get_file_info(afc_client_t client, const char *path, char ***file_information);
|
|
187
|
-
|
|
188
|
-
/**
|
|
189
|
-
* Gets information about a specific file.
|
|
190
|
-
*
|
|
191
|
-
* @param client The client to use to get the information of the file.
|
|
192
|
-
* @param path The fully-qualified path to the file.
|
|
193
|
-
* @param file_information A pointer to a plist_t that will be populated
|
|
194
|
-
* with key-value pairs (dictionary) representing the file attributes.
|
|
195
|
-
* Free with plist_free().
|
|
196
|
-
*
|
|
197
|
-
* @return AFC_E_SUCCESS on success or an AFC_E_* error value.
|
|
198
|
-
*/
|
|
199
|
-
LIBIMOBILEDEVICE_API afc_error_t afc_get_file_info_plist(afc_client_t client, const char *path, plist_t *file_information);
|
|
200
|
-
|
|
201
|
-
/**
|
|
202
|
-
* Opens a file on the device.
|
|
203
|
-
*
|
|
204
|
-
* @param client The client to use to open the file.
|
|
205
|
-
* @param filename The file to open. (must be a fully-qualified path)
|
|
206
|
-
* @param file_mode The mode to use to open the file.
|
|
207
|
-
* @param handle Pointer to a uint64_t that will hold the handle of the file
|
|
208
|
-
*
|
|
209
|
-
* @return AFC_E_SUCCESS on success or an AFC_E_* error value.
|
|
210
|
-
*/
|
|
211
|
-
LIBIMOBILEDEVICE_API afc_error_t afc_file_open(afc_client_t client, const char *filename, afc_file_mode_t file_mode, uint64_t *handle);
|
|
212
|
-
|
|
213
|
-
/**
|
|
214
|
-
* Closes a file on the device.
|
|
215
|
-
*
|
|
216
|
-
* @param client The client to close the file with.
|
|
217
|
-
* @param handle File handle of a previously opened file.
|
|
218
|
-
*/
|
|
219
|
-
LIBIMOBILEDEVICE_API afc_error_t afc_file_close(afc_client_t client, uint64_t handle);
|
|
220
|
-
|
|
221
|
-
/**
|
|
222
|
-
* Locks or unlocks a file on the device.
|
|
223
|
-
*
|
|
224
|
-
* Makes use of flock on the device.
|
|
225
|
-
* @see http://developer.apple.com/documentation/Darwin/Reference/ManPages/man2/flock.2.html
|
|
226
|
-
*
|
|
227
|
-
* @param client The client to lock the file with.
|
|
228
|
-
* @param handle File handle of a previously opened file.
|
|
229
|
-
* @param operation the lock or unlock operation to perform, this is one of
|
|
230
|
-
* AFC_LOCK_SH (shared lock), AFC_LOCK_EX (exclusive lock), or
|
|
231
|
-
* AFC_LOCK_UN (unlock).
|
|
232
|
-
*/
|
|
233
|
-
LIBIMOBILEDEVICE_API afc_error_t afc_file_lock(afc_client_t client, uint64_t handle, afc_lock_op_t operation);
|
|
234
|
-
|
|
235
|
-
/**
|
|
236
|
-
* Attempts to the read the given number of bytes from the given file.
|
|
237
|
-
*
|
|
238
|
-
* @param client The relevant AFC client
|
|
239
|
-
* @param handle File handle of a previously opened file
|
|
240
|
-
* @param data The pointer to the memory region to store the read data
|
|
241
|
-
* @param length The number of bytes to read
|
|
242
|
-
* @param bytes_read The number of bytes actually read.
|
|
243
|
-
*
|
|
244
|
-
* @return AFC_E_SUCCESS on success or an AFC_E_* error value.
|
|
245
|
-
*/
|
|
246
|
-
LIBIMOBILEDEVICE_API afc_error_t afc_file_read(afc_client_t client, uint64_t handle, char *data, uint32_t length, uint32_t *bytes_read);
|
|
247
|
-
|
|
248
|
-
/**
|
|
249
|
-
* Writes a given number of bytes to a file.
|
|
250
|
-
*
|
|
251
|
-
* @param client The client to use to write to the file.
|
|
252
|
-
* @param handle File handle of previously opened file.
|
|
253
|
-
* @param data The data to write to the file.
|
|
254
|
-
* @param length How much data to write.
|
|
255
|
-
* @param bytes_written The number of bytes actually written to the file.
|
|
256
|
-
*
|
|
257
|
-
* @return AFC_E_SUCCESS on success or an AFC_E_* error value.
|
|
258
|
-
*/
|
|
259
|
-
LIBIMOBILEDEVICE_API afc_error_t afc_file_write(afc_client_t client, uint64_t handle, const char *data, uint32_t length, uint32_t *bytes_written);
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
* Seeks to a given position of a pre-opened file on the device.
|
|
263
|
-
*
|
|
264
|
-
* @param client The client to use to seek to the position.
|
|
265
|
-
* @param handle File handle of a previously opened.
|
|
266
|
-
* @param offset Seek offset.
|
|
267
|
-
* @param whence Seeking direction, one of SEEK_SET, SEEK_CUR, or SEEK_END.
|
|
268
|
-
*
|
|
269
|
-
* @return AFC_E_SUCCESS on success or an AFC_E_* error value.
|
|
270
|
-
*/
|
|
271
|
-
LIBIMOBILEDEVICE_API afc_error_t afc_file_seek(afc_client_t client, uint64_t handle, int64_t offset, int whence);
|
|
272
|
-
|
|
273
|
-
/**
|
|
274
|
-
* Returns current position in a pre-opened file on the device.
|
|
275
|
-
*
|
|
276
|
-
* @param client The client to use.
|
|
277
|
-
* @param handle File handle of a previously opened file.
|
|
278
|
-
* @param position Position in bytes of indicator
|
|
279
|
-
*
|
|
280
|
-
* @return AFC_E_SUCCESS on success or an AFC_E_* error value.
|
|
281
|
-
*/
|
|
282
|
-
LIBIMOBILEDEVICE_API afc_error_t afc_file_tell(afc_client_t client, uint64_t handle, uint64_t *position);
|
|
283
|
-
|
|
284
|
-
/**
|
|
285
|
-
* Sets the size of a file on the device.
|
|
286
|
-
*
|
|
287
|
-
* @param client The client to use to set the file size.
|
|
288
|
-
* @param handle File handle of a previously opened file.
|
|
289
|
-
* @param newsize The size to set the file to.
|
|
290
|
-
*
|
|
291
|
-
* @return AFC_E_SUCCESS on success or an AFC_E_* error value.
|
|
292
|
-
*
|
|
293
|
-
* @note This function is more akin to ftruncate than truncate, and truncate
|
|
294
|
-
* calls would have to open the file before calling this, sadly.
|
|
295
|
-
*/
|
|
296
|
-
LIBIMOBILEDEVICE_API afc_error_t afc_file_truncate(afc_client_t client, uint64_t handle, uint64_t newsize);
|
|
297
|
-
|
|
298
|
-
/**
|
|
299
|
-
* Deletes a file or directory.
|
|
300
|
-
*
|
|
301
|
-
* @param client The client to use.
|
|
302
|
-
* @param path The path to delete. (must be a fully-qualified path)
|
|
303
|
-
*
|
|
304
|
-
* @return AFC_E_SUCCESS on success or an AFC_E_* error value.
|
|
305
|
-
*/
|
|
306
|
-
LIBIMOBILEDEVICE_API afc_error_t afc_remove_path(afc_client_t client, const char *path);
|
|
307
|
-
|
|
308
|
-
/**
|
|
309
|
-
* Renames a file or directory on the device.
|
|
310
|
-
*
|
|
311
|
-
* @param client The client to have rename.
|
|
312
|
-
* @param from The name to rename from. (must be a fully-qualified path)
|
|
313
|
-
* @param to The new name. (must also be a fully-qualified path)
|
|
314
|
-
*
|
|
315
|
-
* @return AFC_E_SUCCESS on success or an AFC_E_* error value.
|
|
316
|
-
*/
|
|
317
|
-
LIBIMOBILEDEVICE_API afc_error_t afc_rename_path(afc_client_t client, const char *from, const char *to);
|
|
318
|
-
|
|
319
|
-
/**
|
|
320
|
-
* Creates a directory on the device.
|
|
321
|
-
*
|
|
322
|
-
* @param client The client to use to make a directory.
|
|
323
|
-
* @param path The directory's path. (must be a fully-qualified path, I assume
|
|
324
|
-
* all other mkdir restrictions apply as well)
|
|
325
|
-
*
|
|
326
|
-
* @return AFC_E_SUCCESS on success or an AFC_E_* error value.
|
|
327
|
-
*/
|
|
328
|
-
LIBIMOBILEDEVICE_API afc_error_t afc_make_directory(afc_client_t client, const char *path);
|
|
329
|
-
|
|
330
|
-
/**
|
|
331
|
-
* Sets the size of a file on the device without prior opening it.
|
|
332
|
-
*
|
|
333
|
-
* @param client The client to use to set the file size.
|
|
334
|
-
* @param path The path of the file to be truncated.
|
|
335
|
-
* @param newsize The size to set the file to.
|
|
336
|
-
*
|
|
337
|
-
* @return AFC_E_SUCCESS on success or an AFC_E_* error value.
|
|
338
|
-
*/
|
|
339
|
-
LIBIMOBILEDEVICE_API afc_error_t afc_truncate(afc_client_t client, const char *path, uint64_t newsize);
|
|
340
|
-
|
|
341
|
-
/**
|
|
342
|
-
* Creates a hard link or symbolic link on the device.
|
|
343
|
-
*
|
|
344
|
-
* @param client The client to use for making a link
|
|
345
|
-
* @param linktype 1 = hard link, 2 = symlink
|
|
346
|
-
* @param target The file to be linked.
|
|
347
|
-
* @param linkname The name of link.
|
|
348
|
-
*
|
|
349
|
-
* @return AFC_E_SUCCESS on success or an AFC_E_* error value.
|
|
350
|
-
*/
|
|
351
|
-
LIBIMOBILEDEVICE_API afc_error_t afc_make_link(afc_client_t client, afc_link_type_t linktype, const char *target, const char *linkname);
|
|
352
|
-
|
|
353
|
-
/**
|
|
354
|
-
* Sets the modification time of a file on the device.
|
|
355
|
-
*
|
|
356
|
-
* @param client The client to use to set the file size.
|
|
357
|
-
* @param path Path of the file for which the modification time should be set.
|
|
358
|
-
* @param mtime The modification time to set in nanoseconds since epoch.
|
|
359
|
-
*
|
|
360
|
-
* @return AFC_E_SUCCESS on success or an AFC_E_* error value.
|
|
361
|
-
*/
|
|
362
|
-
LIBIMOBILEDEVICE_API afc_error_t afc_set_file_time(afc_client_t client, const char *path, uint64_t mtime);
|
|
363
|
-
|
|
364
|
-
/**
|
|
365
|
-
* Deletes a file or directory including possible contents.
|
|
366
|
-
*
|
|
367
|
-
* @param client The client to use.
|
|
368
|
-
* @param path The path to delete. (must be a fully-qualified path)
|
|
369
|
-
* @since libimobiledevice 1.1.7
|
|
370
|
-
* @note Only available in iOS 6 and later.
|
|
371
|
-
*
|
|
372
|
-
* @return AFC_E_SUCCESS on success or an AFC_E_* error value.
|
|
373
|
-
*/
|
|
374
|
-
LIBIMOBILEDEVICE_API afc_error_t afc_remove_path_and_contents(afc_client_t client, const char *path);
|
|
375
|
-
|
|
376
|
-
/* Helper functions */
|
|
377
|
-
|
|
378
|
-
/**
|
|
379
|
-
* Get a specific key of the device info list for a client connection.
|
|
380
|
-
* Known key values are: Model, FSTotalBytes, FSFreeBytes and FSBlockSize.
|
|
381
|
-
* This is a helper function for afc_get_device_info().
|
|
382
|
-
*
|
|
383
|
-
* @param client The client to get device info for.
|
|
384
|
-
* @param key The key to get the value of.
|
|
385
|
-
* @param value The value for the key if successful or NULL otherwise.
|
|
386
|
-
*
|
|
387
|
-
* @return AFC_E_SUCCESS on success or an AFC_E_* error value.
|
|
388
|
-
*/
|
|
389
|
-
LIBIMOBILEDEVICE_API afc_error_t afc_get_device_info_key(afc_client_t client, const char *key, char **value);
|
|
390
|
-
|
|
391
|
-
/**
|
|
392
|
-
* Frees up a char dictionary as returned by some AFC functions.
|
|
393
|
-
*
|
|
394
|
-
* @param dictionary The char array terminated by an empty string.
|
|
395
|
-
*
|
|
396
|
-
* @return AFC_E_SUCCESS on success or an AFC_E_* error value.
|
|
397
|
-
*/
|
|
398
|
-
LIBIMOBILEDEVICE_API afc_error_t afc_dictionary_free(char **dictionary);
|
|
399
|
-
|
|
400
|
-
/**
|
|
401
|
-
* Gets a readable error string for a given AFC error code.
|
|
402
|
-
*
|
|
403
|
-
* @param err An AFC error code
|
|
404
|
-
*
|
|
405
|
-
* @returns A readable error string
|
|
406
|
-
*/
|
|
407
|
-
LIBIMOBILEDEVICE_API const char* afc_strerror(afc_error_t err);
|
|
408
|
-
|
|
409
|
-
#ifdef __cplusplus
|
|
410
|
-
}
|
|
411
|
-
#endif
|
|
412
|
-
|
|
413
|
-
#endif
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file libimobiledevice/bt_packet_logger.h
|
|
3
|
-
* @brief Capture the Bluetooth HCI trace from a device
|
|
4
|
-
* \internal
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) 2021 Geoffrey Kruse, 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 IBT_PACKET_LOGGER_H
|
|
24
|
-
#define IBT_PACKET_LOGGER_H
|
|
25
|
-
|
|
26
|
-
#ifdef __cplusplus
|
|
27
|
-
extern "C" {
|
|
28
|
-
#endif
|
|
29
|
-
|
|
30
|
-
#include <libimobiledevice/libimobiledevice.h>
|
|
31
|
-
#include <libimobiledevice/lockdown.h>
|
|
32
|
-
|
|
33
|
-
#define BT_PACKETLOGGER_SERVICE_NAME "com.apple.bluetooth.BTPacketLogger"
|
|
34
|
-
#define BT_MAX_PACKET_SIZE 65535
|
|
35
|
-
|
|
36
|
-
/** Error Codes */
|
|
37
|
-
typedef enum {
|
|
38
|
-
BT_PACKET_LOGGER_E_SUCCESS = 0,
|
|
39
|
-
BT_PACKET_LOGGER_E_INVALID_ARG = -1,
|
|
40
|
-
BT_PACKET_LOGGER_E_MUX_ERROR = -2,
|
|
41
|
-
BT_PACKET_LOGGER_E_SSL_ERROR = -3,
|
|
42
|
-
BT_PACKET_LOGGER_E_NOT_ENOUGH_DATA = -4,
|
|
43
|
-
BT_PACKET_LOGGER_E_TIMEOUT = -5,
|
|
44
|
-
BT_PACKET_LOGGER_E_UNKNOWN_ERROR = -256
|
|
45
|
-
} bt_packet_logger_error_t;
|
|
46
|
-
|
|
47
|
-
typedef struct {
|
|
48
|
-
uint32_t length;
|
|
49
|
-
uint32_t ts_secs;
|
|
50
|
-
uint32_t ts_usecs;
|
|
51
|
-
} bt_packet_logger_header_t;
|
|
52
|
-
|
|
53
|
-
typedef struct bt_packet_logger_client_private bt_packet_logger_client_private;
|
|
54
|
-
typedef bt_packet_logger_client_private *bt_packet_logger_client_t; /**< The client handle. */
|
|
55
|
-
|
|
56
|
-
/** Receives each hci packet received from the device. */
|
|
57
|
-
typedef void (*bt_packet_logger_receive_cb_t)(uint8_t * data, uint16_t len, void *user_data);
|
|
58
|
-
|
|
59
|
-
/* Interface */
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Connects to the bt_packet_logger 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 Pointer that will point to a newly allocated
|
|
67
|
-
* bt_packet_logger_client_t upon successful return. Must be freed using
|
|
68
|
-
* bt_packet_logger_client_free() after use.
|
|
69
|
-
*
|
|
70
|
-
* @return BT_PACKET_LOGGER_E_SUCCESS on success, BT_PACKET_LOGGER_E_INVALID_ARG when
|
|
71
|
-
* client is NULL, or an BT_PACKET_LOGGER_E_* error code otherwise.
|
|
72
|
-
*/
|
|
73
|
-
LIBIMOBILEDEVICE_API bt_packet_logger_error_t bt_packet_logger_client_new(idevice_t device, lockdownd_service_descriptor_t service, bt_packet_logger_client_t * client);
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Starts a new bt_packet_logger 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
|
-
* bt_packet_logger_client_t upon successful return. Must be freed using
|
|
81
|
-
* bt_packet_logger_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 BT_PACKET_LOGGER_E_SUCCESS on success, or an BT_PACKET_LOGGER_E_* error
|
|
86
|
-
* code otherwise.
|
|
87
|
-
*/
|
|
88
|
-
LIBIMOBILEDEVICE_API bt_packet_logger_error_t bt_packet_logger_client_start_service(idevice_t device, bt_packet_logger_client_t * client, const char* label);
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Disconnects a bt_packet_logger client from the device and frees up the
|
|
92
|
-
* bt_packet_logger client data.
|
|
93
|
-
*
|
|
94
|
-
* @param client The bt_packet_logger client to disconnect and free.
|
|
95
|
-
*
|
|
96
|
-
* @return BT_PACKET_LOGGER_E_SUCCESS on success, BT_PACKET_LOGGER_E_INVALID_ARG when
|
|
97
|
-
* client is NULL, or an BT_PACKET_LOGGER_E_* error code otherwise.
|
|
98
|
-
*/
|
|
99
|
-
LIBIMOBILEDEVICE_API bt_packet_logger_error_t bt_packet_logger_client_free(bt_packet_logger_client_t client);
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Starts capturing the hci interface from the device using a callback.
|
|
104
|
-
*
|
|
105
|
-
* Use bt_packet_logger_stop_capture() to stop receiving hci data.
|
|
106
|
-
*
|
|
107
|
-
* @param client The bt_packet_logger client to use
|
|
108
|
-
* @param callback Callback to receive each packet from the hci interface.
|
|
109
|
-
* @param user_data Custom pointer passed to the callback function.
|
|
110
|
-
*
|
|
111
|
-
* @return BT_PACKET_LOGGER_E_SUCCESS on success,
|
|
112
|
-
* BT_PACKET_LOGGER_E_INVALID_ARG when one or more parameters are
|
|
113
|
-
* invalid or BT_PACKET_LOGGER_E_UNKNOWN_ERROR when an unspecified
|
|
114
|
-
* error occurs or an hci capture has already been started.
|
|
115
|
-
*/
|
|
116
|
-
LIBIMOBILEDEVICE_API bt_packet_logger_error_t bt_packet_logger_start_capture(bt_packet_logger_client_t client, bt_packet_logger_receive_cb_t callback, void* user_data);
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* Stops capturing the hci interface from the device.
|
|
120
|
-
*
|
|
121
|
-
* Use bt_packet_logger_start_capture() to start receiving the hci data.
|
|
122
|
-
*
|
|
123
|
-
* @param client The bt_packet_logger client to use
|
|
124
|
-
*
|
|
125
|
-
* @return BT_PACKET_LOGGER_E_SUCCESS on success,
|
|
126
|
-
* BT_PACKET_LOGGER_E_INVALID_ARG when one or more parameters are
|
|
127
|
-
* invalid or BT_PACKET_LOGGER_E_UNKNOWN_ERROR when an unspecified
|
|
128
|
-
* error occurs or an hci capture has already been started.
|
|
129
|
-
*/
|
|
130
|
-
LIBIMOBILEDEVICE_API bt_packet_logger_error_t bt_packet_logger_stop_capture(bt_packet_logger_client_t client);
|
|
131
|
-
|
|
132
|
-
/* Receiving */
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* Receives data using the given bt_packet_logger client with specified timeout.
|
|
136
|
-
*
|
|
137
|
-
* @param client The bt_packet_logger client to use for receiving
|
|
138
|
-
* @param data Buffer that will be filled with the data received
|
|
139
|
-
* @param size Number of bytes to receive
|
|
140
|
-
* @param received Number of bytes received (can be NULL to ignore)
|
|
141
|
-
* @param timeout Maximum time in milliseconds to wait for data.
|
|
142
|
-
*
|
|
143
|
-
* @return BT_PACKET_LOGGER_E_SUCCESS on success,
|
|
144
|
-
* BT_PACKET_LOGGER_E_INVALID_ARG when one or more parameters are
|
|
145
|
-
* invalid, BT_PACKET_LOGGER_E_MUX_ERROR when a communication error
|
|
146
|
-
* occurs, or BT_PACKET_LOGGER_E_UNKNOWN_ERROR when an unspecified
|
|
147
|
-
* error occurs.
|
|
148
|
-
*/
|
|
149
|
-
LIBIMOBILEDEVICE_API bt_packet_logger_error_t bt_packet_logger_receive_with_timeout(bt_packet_logger_client_t client, char *data, uint32_t size, uint32_t *received, unsigned int timeout);
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
#ifdef __cplusplus
|
|
153
|
-
}
|
|
154
|
-
#endif
|
|
155
|
-
|
|
156
|
-
#endif
|