diff options
author | Nikias Bassen | 2022-10-04 15:31:17 +0200 |
---|---|---|
committer | Nikias Bassen | 2022-10-04 15:31:17 +0200 |
commit | 12e24e4bd161c76631c77244f63ff02ef18f251d (patch) | |
tree | 44ce8858cf3c19fd3a49bfe761c5a59b4b8c8ba0 | |
parent | 7f24e9a9c9e862c4d65c3a460fc2315d606d9c7d (diff) | |
download | usbmuxd-12e24e4bd161c76631c77244f63ff02ef18f251d.tar.gz usbmuxd-12e24e4bd161c76631c77244f63ff02ef18f251d.tar.bz2 |
preflight: Assume old iOS version if retrieval of ProductVersion fails
Some older devices (e.g. iOS 2.x) wouldn't allow querying the iOS version
if the device is not paired. In this case we just assume an old version
instead of erroring out, and this way the device will be made available.
-rw-r--r-- | src/preflight.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/preflight.c b/src/preflight.c index 68e7f2c..9c57e98 100644 --- a/src/preflight.c +++ b/src/preflight.c @@ -214,18 +214,19 @@ retry: lerr = lockdownd_get_value(lockdown, NULL, "ProductVersion", &value); if (lerr != LOCKDOWN_E_SUCCESS) { - usbmuxd_log(LL_ERROR, "%s: ERROR: Could not get ProductVersion from device %s, lockdown error %d", __func__, _dev->udid, lerr); - goto leave; - } - - if (value && plist_get_node_type(value) == PLIST_STRING) { - plist_get_string_val(value, &version_str); - } - plist_free(value); + usbmuxd_log(LL_WARNING, "%s: Could not get ProductVersion from device %s, lockdown error %d", __func__, _dev->udid, lerr); + /* assume old iOS version */ + version_str = strdup("1.0"); + } else { + if (value && plist_get_node_type(value) == PLIST_STRING) { + plist_get_string_val(value, &version_str); + } + plist_free(value); - if (!version_str) { - usbmuxd_log(LL_ERROR, "%s: Could not get ProductVersion string from device %s handle %d", __func__, _dev->udid, (int)(long)_dev->conn_data); - goto leave; + if (!version_str) { + usbmuxd_log(LL_ERROR, "%s: Could not get ProductVersion string from device %s handle %d", __func__, _dev->udid, (int)(long)_dev->conn_data); + goto leave; + } } lerr = lockdownd_get_value(lockdown, NULL, "DeviceClass", &value); |