diff options
author | Nikias Bassen | 2019-02-13 23:57:57 +0100 |
---|---|---|
committer | Nikias Bassen | 2019-02-13 23:57:57 +0100 |
commit | fbaafdaf87cc01197ad86812a46cf17b7b392b8e (patch) | |
tree | 07e822df776d7d34bc7286f11f17ec69dff383fc /src | |
parent | c72e7fe84df031d2d2c7154114bb3df01e06ec22 (diff) | |
download | idevicerestore-fbaafdaf87cc01197ad86812a46cf17b7b392b8e.tar.gz idevicerestore-fbaafdaf87cc01197ad86812a46cf17b7b392b8e.tar.bz2 |
dfu/recovery: Don't select first DFU/Recovery mode device found when --udid was given
Diffstat (limited to 'src')
-rw-r--r-- | src/dfu.c | 7 | ||||
-rw-r--r-- | src/recovery.c | 7 |
2 files changed, 12 insertions, 2 deletions
@@ -2,8 +2,8 @@ * dfu.c * Functions for handling idevices in DFU mode * + * Copyright (c) 2012-2019 Nikias Bassen. All Rights Reserved. * Copyright (c) 2010-2013 Martin Szulecki. All Rights Reserved. - * Copyright (c) 2012-2015 Nikias Bassen. All Rights Reserved. * Copyright (c) 2010 Joshua Hill. All Rights Reserved. * * This library is free software; you can redistribute it and/or @@ -90,6 +90,11 @@ int dfu_check_mode(struct idevicerestore_client_t* client, int* mode) { irecv_client_t dfu = NULL; int probe_mode = -1; + if (client->udid && client->ecid == 0) { + /* if we have a UDID but no ECID we can't make sure this is the correct device */ + return -1; + } + irecv_init(); if (irecv_open_with_ecid(&dfu, client->ecid) != IRECV_E_SUCCESS) { return -1; diff --git a/src/recovery.c b/src/recovery.c index b54a8b2..436261f 100644 --- a/src/recovery.c +++ b/src/recovery.c @@ -2,8 +2,8 @@ * recovery.c * Functions for handling idevices in recovery mode * + * Copyright (c) 2012-2019 Nikias Bassen. All Rights Reserved. * Copyright (c) 2010-2012 Martin Szulecki. All Rights Reserved. - * Copyright (c) 2012 Nikias Bassen. All Rights Reserved. * Copyright (c) 2010 Joshua Hill. All Rights Reserved. * * This library is free software; you can redistribute it and/or @@ -103,6 +103,11 @@ int recovery_check_mode(struct idevicerestore_client_t* client) { irecv_error_t recovery_error = IRECV_E_SUCCESS; int mode = 0; + if (client->udid && client->ecid == 0) { + /* if we have a UDID but no ECID we can't make sure this is the correct device */ + return -1; + } + irecv_init(); recovery_error=irecv_open_with_ecid(&recovery, client->ecid); |