From e3f2d6070de7125058c343ef63961c27bc991bb6 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Sat, 7 Jun 2025 12:09:24 +0200 Subject: Add new idevice_get_device_version() to interface This allows getting a numerical representation of the device's ProductVersion string for easier version range checks --- src/lockdown-cu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lockdown-cu.c') diff --git a/src/lockdown-cu.c b/src/lockdown-cu.c index 9fbd2c8..30eec99 100644 --- a/src/lockdown-cu.c +++ b/src/lockdown-cu.c @@ -509,7 +509,7 @@ lockdownd_error_t lockdownd_cu_pairing_create(lockdownd_client_t client, lockdow char *s_version = NULL; plist_get_string_val(p_version, &s_version); if (s_version && sscanf(s_version, "%d.%d.%d", &vers[0], &vers[1], &vers[2]) >= 2) { - client->device->version = DEVICE_VERSION(vers[0], vers[1], vers[2]); + client->device->version = IDEVICE_DEVICE_VERSION(vers[0], vers[1], vers[2]); } free(s_version); } @@ -962,7 +962,7 @@ lockdownd_error_t lockdownd_cu_send_request_and_get_reply(lockdownd_client_t cli // Starting with iOS/tvOS 11.2 and WatchOS 4.2, this nonce is random and sent along with the request. Before, the request doesn't have a nonce and it uses hardcoded nonce "sendone01234". unsigned char cu_nonce[12] = "sendone01234"; // guaranteed to be random by fair dice troll - if (client->device->version >= DEVICE_VERSION(11,2,0)) { + if (client->device->version >= IDEVICE_DEVICE_VERSION(11,2,0)) { #if defined(HAVE_OPENSSL) RAND_bytes(cu_nonce, sizeof(cu_nonce)); #elif defined(HAVE_GCRYPT) -- cgit v1.1-32-gdbae