summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2012-02-14 13:20:25 +0100
committerGravatar Nikias Bassen2012-02-14 13:20:25 +0100
commit85df38d5e9e51aa4856b0fdd14f2f5f1ff1eccfe (patch)
treef9baed283ccbe3b489a7f3205ea0f48cafc188c1
parentf8ddc75b339351d9536b2df6868d5f92702742f4 (diff)
downloadidevicerestore-85df38d5e9e51aa4856b0fdd14f2f5f1ff1eccfe.tar.gz
idevicerestore-85df38d5e9e51aa4856b0fdd14f2f5f1ff1eccfe.tar.bz2
libirecovery: allow passing ecid 0x1222 to only get 0x1222/WTF devices
-rw-r--r--src/libirecovery.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/libirecovery.c b/src/libirecovery.c
index 3545fd0..c0a20bd 100644
--- a/src/libirecovery.c
+++ b/src/libirecovery.c
@@ -177,6 +177,15 @@ irecv_error_t mobiledevice_connect(irecv_client_t* client, unsigned long long ec
continue;
}
+ if (ecid == kWTFMode) {
+ if (_client->mode != kWTFMode) {
+ // special ecid case, ignore !kWTFMode
+ continue;
+ } else {
+ ecid = 0;
+ }
+ }
+
if ((ecid != 0) && (_client->mode == kWTFMode)) {
// we can't get ecid in WTF mode
mobiledevice_closepipes(_client);
@@ -496,6 +505,15 @@ irecv_error_t irecv_open(irecv_client_t* pclient, unsigned long long ecid) {
usb_descriptor.idProduct == kWTFMode ||
usb_descriptor.idProduct == kDfuMode) {
+ if (ecid == kWTFMode) {
+ if (usb_descriptor.idProduct != kWTFMode) {
+ // special ecid case, ignore !kWTFMode
+ continue;
+ } else {
+ ecid = 0;
+ }
+ }
+
if ((ecid != 0) && (usb_descriptor.idProduct == kWTFMode)) {
// we can't get ecid in WTF mode
continue;