summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2024-06-27 11:20:59 +0200
committerGravatar Nikias Bassen2024-06-27 11:20:59 +0200
commit68df374762b95ab40ca5242da66e3474360669b5 (patch)
treea75acdd2a57df58346f02e75577c7dad00b52b83 /include
parented0d66d0341562731bb19928dfe48155509fa7a7 (diff)
downloadlibimobiledevice-68df374762b95ab40ca5242da66e3474360669b5.tar.gz
libimobiledevice-68df374762b95ab40ca5242da66e3474360669b5.tar.bz2
Add support for iOS 17+ Personalized Developer Disk image mounting
Diffstat (limited to 'include')
-rw-r--r--include/libimobiledevice/mobile_image_mounter.h111
1 files changed, 107 insertions, 4 deletions
diff --git a/include/libimobiledevice/mobile_image_mounter.h b/include/libimobiledevice/mobile_image_mounter.h
index d4fc3f4..76bb61a 100644
--- a/include/libimobiledevice/mobile_image_mounter.h
+++ b/include/libimobiledevice/mobile_image_mounter.h
@@ -42,6 +42,7 @@ typedef enum {
42 MOBILE_IMAGE_MOUNTER_E_CONN_FAILED = -3, 42 MOBILE_IMAGE_MOUNTER_E_CONN_FAILED = -3,
43 MOBILE_IMAGE_MOUNTER_E_COMMAND_FAILED = -4, 43 MOBILE_IMAGE_MOUNTER_E_COMMAND_FAILED = -4,
44 MOBILE_IMAGE_MOUNTER_E_DEVICE_LOCKED = -5, 44 MOBILE_IMAGE_MOUNTER_E_DEVICE_LOCKED = -5,
45 MOBILE_IMAGE_MOUNTER_E_NOT_SUPPORTED = -6,
45 MOBILE_IMAGE_MOUNTER_E_UNKNOWN_ERROR = -256 46 MOBILE_IMAGE_MOUNTER_E_UNKNOWN_ERROR = -256
46} mobile_image_mounter_error_t; 47} mobile_image_mounter_error_t;
47 48
@@ -127,7 +128,7 @@ LIBIMOBILEDEVICE_API mobile_image_mounter_error_t mobile_image_mounter_lookup_im
127 * @return MOBILE_IMAGE_MOUNTER_E_SUCCESS on succes, or a 128 * @return MOBILE_IMAGE_MOUNTER_E_SUCCESS on succes, or a
128 * MOBILE_IMAGE_MOUNTER_E_* error code otherwise. 129 * MOBILE_IMAGE_MOUNTER_E_* error code otherwise.
129 */ 130 */
130LIBIMOBILEDEVICE_API mobile_image_mounter_error_t mobile_image_mounter_upload_image(mobile_image_mounter_client_t client, const char *image_type, size_t image_size, const char *signature, uint16_t signature_size, mobile_image_mounter_upload_cb_t upload_cb, void* userdata); 131LIBIMOBILEDEVICE_API mobile_image_mounter_error_t mobile_image_mounter_upload_image(mobile_image_mounter_client_t client, const char *image_type, size_t image_size, const unsigned char *signature, unsigned int signature_size, mobile_image_mounter_upload_cb_t upload_cb, void* userdata);
131 132
132/** 133/**
133 * Mounts an image on the device. 134 * Mounts an image on the device.
@@ -138,19 +139,50 @@ LIBIMOBILEDEVICE_API mobile_image_mounter_error_t mobile_image_mounter_upload_im
138 * @param signature Pointer to a buffer holding the images' signature 139 * @param signature Pointer to a buffer holding the images' signature
139 * @param signature_size Length of the signature image_signature points to 140 * @param signature_size Length of the signature image_signature points to
140 * @param image_type Type of image to mount 141 * @param image_type Type of image to mount
142 * @param options A dictionary containing additional key/value pairs to add
141 * @param result Pointer to a plist that will receive the result of the 143 * @param result Pointer to a plist that will receive the result of the
142 * operation. 144 * operation.
143 * 145 *
144 * @note This function may return MOBILE_IMAGE_MOUNTER_E_SUCCESS even if the 146 * @note This function may return MOBILE_IMAGE_MOUNTER_E_SUCCESS even if the
145 * operation has failed. Check the resulting plist for further information. 147 * operation has failed. Check the resulting plist for further information.
146 * Note that there is no unmounting function. The mount persists until the
147 * device is rebooted.
148 * 148 *
149 * @return MOBILE_IMAGE_MOUNTER_E_SUCCESS on success, 149 * @return MOBILE_IMAGE_MOUNTER_E_SUCCESS on success,
150 * MOBILE_IMAGE_MOUNTER_E_INVALID_ARG if on ore more parameters are 150 * MOBILE_IMAGE_MOUNTER_E_INVALID_ARG if on ore more parameters are
151 * invalid, or another error code otherwise. 151 * invalid, or another error code otherwise.
152 */ 152 */
153LIBIMOBILEDEVICE_API mobile_image_mounter_error_t mobile_image_mounter_mount_image(mobile_image_mounter_client_t client, const char *image_path, const char *signature, uint16_t signature_size, const char *image_type, plist_t *result); 153LIBIMOBILEDEVICE_API mobile_image_mounter_error_t mobile_image_mounter_mount_image_with_options(mobile_image_mounter_client_t client, const char *image_path, const unsigned char *signature, unsigned int signature_size, const char *image_type, plist_t options, plist_t *result);
154
155/**
156 * Mounts an image on the device.
157 *
158 * @param client The connected mobile_image_mounter client.
159 * @param image_path The absolute path of the image to mount. The image must
160 * be present before calling this function.
161 * @param signature Pointer to a buffer holding the images' signature
162 * @param signature_size Length of the signature image_signature points to
163 * @param image_type Type of image to mount
164 * @param result Pointer to a plist that will receive the result of the
165 * operation.
166 *
167 * @note This function may return MOBILE_IMAGE_MOUNTER_E_SUCCESS even if the
168 * operation has failed. Check the resulting plist for further information.
169 *
170 * @return MOBILE_IMAGE_MOUNTER_E_SUCCESS on success,
171 * MOBILE_IMAGE_MOUNTER_E_INVALID_ARG if on ore more parameters are
172 * invalid, or another error code otherwise.
173 */
174LIBIMOBILEDEVICE_API mobile_image_mounter_error_t mobile_image_mounter_mount_image(mobile_image_mounter_client_t client, const char *image_path, const unsigned char *signature, unsigned int signature_size, const char *image_type, plist_t *result);
175
176/**
177 * Unmount a mounted image at given path on the device.
178 *
179 * @param client The connected mobile_image_mounter client.
180 * @param mount_path The mount path of the mounted image on the device.
181 *
182 * @return MOBILE_IMAGE_MOUNTER_E_SUCCESS on success,
183 * or a MOBILE_IMAGE_MOUNTER_E_* error code on error.
184 */
185LIBIMOBILEDEVICE_API mobile_image_mounter_error_t mobile_image_mounter_unmount_image(mobile_image_mounter_client_t client, const char *mount_path);
154 186
155/** 187/**
156 * Hangs up the connection to the mobile_image_mounter service. 188 * Hangs up the connection to the mobile_image_mounter service.
@@ -165,6 +197,77 @@ LIBIMOBILEDEVICE_API mobile_image_mounter_error_t mobile_image_mounter_mount_ima
165 */ 197 */
166LIBIMOBILEDEVICE_API mobile_image_mounter_error_t mobile_image_mounter_hangup(mobile_image_mounter_client_t client); 198LIBIMOBILEDEVICE_API mobile_image_mounter_error_t mobile_image_mounter_hangup(mobile_image_mounter_client_t client);
167 199
200/**
201 * Query the developer mode status of the given device.
202 *
203 * @param client The connected mobile_image_mounter client.
204 * @param result A pointer to a plist_t that will be set to the resulting developer mode status dictionary.
205 *
206 * @return MOBILE_IMAGE_MOUNTER_E_SUCCESS on success,
207 * or a MOBILE_IMAGE_MOUNTER_E_* error code on error.
208 */
209LIBIMOBILEDEVICE_API mobile_image_mounter_error_t mobile_image_mounter_query_developer_mode_status(mobile_image_mounter_client_t client, plist_t *result);
210
211/**
212 * Query a personalization nonce for the given image type, used for personalized disk images (iOS 17+).
213 * This nonce is supposed to be added to the TSS request for the corresponding image.
214 *
215 * @param client The connected mobile_image_mounter client.
216 * @param image_type The image_type to get the personalization nonce for, usually `DeveloperDiskImage`.
217 * @param nonce Pointer that will be set to an allocated buffer with the nonce value.
218 * @param nonce_size Pointer to an unsigned int that will receive the size of the nonce value.
219 *
220 * @return MOBILE_IMAGE_MOUNTER_E_SUCCESS on success,
221 * or a MOBILE_IMAGE_MOUNTER_E_* error code on error.
222 */
223LIBIMOBILEDEVICE_API mobile_image_mounter_error_t mobile_image_mounter_query_nonce(mobile_image_mounter_client_t client, const char* image_type, unsigned char** nonce, unsigned int* nonce_size);
224
225/**
226 * Query personalization identitifers for the given image_type.
227 *
228 * @param client The connected mobile_image_mounter client.
229 * @param image_type The image_type to get the personalization identifiers for. Can be NULL.
230 * @param result A pointer to a plist_t that will be set to the resulting identifier dictionary.
231 *
232 * @return MOBILE_IMAGE_MOUNTER_E_SUCCESS on success,
233 * or a MOBILE_IMAGE_MOUNTER_E_* error code on error.
234 */
235LIBIMOBILEDEVICE_API mobile_image_mounter_error_t mobile_image_mounter_query_personalization_identifiers(mobile_image_mounter_client_t client, const char* image_type, plist_t *result);
236
237/**
238 *
239 * @param client The connected mobile_image_mounter client.
240 * @param image_type The image_type to get the personalization identifiers for. Can be NULL.
241 * @param signature The signature of the corresponding personalized image.
242 * @param signature_size The size of signature.
243 * @param manifest Pointer that will be set to an allocated buffer with the manifest data.
244 * @param manifest_size Pointer to an unsigned int that will be set to the size of the manifest data.
245 *
246 * @return MOBILE_IMAGE_MOUNTER_E_SUCCESS on success,
247 * or a MOBILE_IMAGE_MOUNTER_E_* error code on error.
248 */
249LIBIMOBILEDEVICE_API mobile_image_mounter_error_t mobile_image_mounter_query_personalization_manifest(mobile_image_mounter_client_t client, const char* image_type, const unsigned char* signature, unsigned int signature_size, unsigned char** manifest, unsigned int* manifest_size);
250
251/**
252 * Roll the personalization nonce.
253 *
254 * @param client The connected mobile_image_mounter client.
255 *
256 * @return MOBILE_IMAGE_MOUNTER_E_SUCCESS on success,
257 * or a MOBILE_IMAGE_MOUNTER_E_* error code on error.
258 */
259LIBIMOBILEDEVICE_API mobile_image_mounter_error_t mobile_image_mounter_roll_personalization_nonce(mobile_image_mounter_client_t client);
260
261/**
262 * Roll the Cryptex nonce.
263 *
264 * @param client The connected mobile_image_mounter client.
265 *
266 * @return MOBILE_IMAGE_MOUNTER_E_SUCCESS on success,
267 * or a MOBILE_IMAGE_MOUNTER_E_* error code on error.
268 */
269LIBIMOBILEDEVICE_API mobile_image_mounter_error_t mobile_image_mounter_roll_cryptex_nonce(mobile_image_mounter_client_t client);
270
168#ifdef __cplusplus 271#ifdef __cplusplus
169} 272}
170#endif 273#endif