From f7819059510a7b11a63ce5a93f2c335268b82787 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Sat, 10 Dec 2022 02:22:52 +0100 Subject: tools/ideviceimagemounter: Notify user of missing Developer Mode on iOS 16+ --- tools/ideviceimagemounter.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tools/ideviceimagemounter.c b/tools/ideviceimagemounter.c index b854d5d..4ea38a9 100644 --- a/tools/ideviceimagemounter.c +++ b/tools/ideviceimagemounter.c @@ -224,6 +224,20 @@ int main(int argc, char **argv) } } + if (product_version_major == 16) { + uint8_t dev_mode_status = 0; + plist_t val = NULL; + ldret = lockdownd_get_value(lckd, "com.apple.security.mac.amfi", "DeveloperModeStatus", &val); + if (ldret == LOCKDOWN_E_SUCCESS) { + plist_get_bool_val(val, &dev_mode_status); + plist_free(val); + } + if (!dev_mode_status) { + printf("ERROR: You have to enable Developer Mode on the given device in order to allowing mounting a developer disk image.\n"); + goto leave; + } + } + lockdownd_start_service(lckd, "com.apple.mobile.mobile_image_mounter", &service); if (!service || service->port == 0) { -- cgit v1.1-32-gdbae