From 648eeecea5bf029513e0266a47d7b0cb4e62d1b8 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Wed, 4 Jul 2012 13:59:33 +0200 Subject: irecv_open: allow passing ecid 0x1222 to only get 0x1222/WTF devices --- libirecovery.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/libirecovery.c b/libirecovery.c index 0c166ff..d6b1c5b 100644 --- a/libirecovery.c +++ b/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; -- cgit v1.1-32-gdbae