diff options
author | Nikias Bassen | 2021-03-05 09:18:20 +0100 |
---|---|---|
committer | Nikias Bassen | 2021-03-05 09:18:20 +0100 |
commit | 6d3b6bba9127c02fc312468e4174e8148bf87472 (patch) | |
tree | cb2460b791be7a6f6857dffa00c8eee1dbe8e265 /src | |
parent | 7fd59d571648b0b418b4c3728b0fb64898feba8c (diff) | |
download | idevicerestore-6d3b6bba9127c02fc312468e4174e8148bf87472.tar.gz idevicerestore-6d3b6bba9127c02fc312468e4174e8148bf87472.tar.bz2 |
Fix entering recovery mode on iOS 14.5+ which now requires a pairing
Diffstat (limited to 'src')
-rw-r--r-- | src/normal.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/normal.c b/src/normal.c index d098066..ad6aeff 100644 --- a/src/normal.c +++ b/src/normal.c @@ -223,7 +223,7 @@ int normal_enter_recovery(struct idevicerestore_client_t* client) lockdown_error = lockdownd_client_new(device, &lockdown, "idevicerestore"); if (lockdown_error != LOCKDOWN_E_SUCCESS) { - error("ERROR: Unable to connect to lockdownd service\n"); + error("ERROR: Unable to connect to lockdownd: %s (%d)\n", lockdownd_strerror(lockdown_error), lockdown_error); idevice_free(device); return -1; } @@ -235,8 +235,18 @@ int normal_enter_recovery(struct idevicerestore_client_t* client) } lockdown_error = lockdownd_enter_recovery(lockdown); + if (lockdown_error == LOCKDOWN_E_SESSION_INACTIVE) { + lockdownd_client_free(lockdown); + lockdown = NULL; + if (LOCKDOWN_E_SUCCESS != (lockdown_error = lockdownd_client_new_with_handshake(device, &lockdown, "idevicerestore"))) { + error("ERROR: Could not connect to lockdownd: %s (%d)\n", lockdownd_strerror(lockdown_error), lockdown_error); + idevice_free(device); + return 1; + } + lockdown_error = lockdownd_enter_recovery(lockdown); + } if (lockdown_error != LOCKDOWN_E_SUCCESS) { - error("ERROR: Unable to place device in recovery mode\n"); + error("ERROR: Unable to place device in recovery mode: %s (%d)\n", lockdownd_strerror(lockdown_error), lockdown_error); lockdownd_client_free(lockdown); idevice_free(device); return -1; |