summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2021-03-05 09:18:20 +0100
committerGravatar Nikias Bassen2021-03-05 09:18:20 +0100
commit6d3b6bba9127c02fc312468e4174e8148bf87472 (patch)
treecb2460b791be7a6f6857dffa00c8eee1dbe8e265
parent7fd59d571648b0b418b4c3728b0fb64898feba8c (diff)
downloadidevicerestore-6d3b6bba9127c02fc312468e4174e8148bf87472.tar.gz
idevicerestore-6d3b6bba9127c02fc312468e4174e8148bf87472.tar.bz2
Fix entering recovery mode on iOS 14.5+ which now requires a pairing
-rw-r--r--src/normal.c14
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;