From e62733a99c46ad2fb6887e578e7aca88404b11eb Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Thu, 19 Sep 2013 21:02:19 +0200 Subject: preflight: Allow pre iOS 6 devices to become visible if pairing fails This allows any client to react and handle pairing errors which includes password protected devices and alike. --- src/preflight.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/preflight.c b/src/preflight.c index 0582dd1..ec510ec 100644 --- a/src/preflight.c +++ b/src/preflight.c @@ -216,12 +216,17 @@ static void* preflight_worker_handle_device_add(void* userdata) } else { /* iOS 6.x and earlier */ lerr = lockdownd_pair(lockdown, NULL); - if (lerr == LOCKDOWN_E_PASSWORD_PROTECTED) { - usbmuxd_log(LL_INFO, "%s: Device %s is locked with a passcode. Cannot pair.", __func__, _dev->udid); - // TODO send notification to user's desktop - goto leave; - } else if (lerr != LOCKDOWN_E_SUCCESS) { - usbmuxd_log(LL_ERROR, "%s: ERROR: Pair failed for device %s, lockdown error %d", __func__, _dev->udid, lerr); + if (lerr != LOCKDOWN_E_SUCCESS) { + if (lerr == LOCKDOWN_E_PASSWORD_PROTECTED) { + usbmuxd_log(LL_INFO, "%s: Device %s is locked with a passcode. Cannot pair.", __func__, _dev->udid); + /* TODO send notification to user's desktop */ + } else { + usbmuxd_log(LL_ERROR, "%s: ERROR: Pair failed for device %s, lockdown error %d", __func__, _dev->udid, lerr); + } + + /* make device visible anyways */ + client_device_add(info); + goto leave; } -- cgit v1.1-32-gdbae