diff options
author | Aaron Burghardt | 2013-09-25 21:24:29 -0400 |
---|---|---|
committer | Martin Szulecki | 2013-10-24 14:37:25 +0200 |
commit | 926b77a9fbb58f3020cf5c67921d727f5ff51266 (patch) | |
tree | 4e1ba308759696ad7026ee5ed3eaecd4569b87a8 | |
parent | 27d18c86865601673375d08573a0c512c401b280 (diff) | |
download | idevicerestore-926b77a9fbb58f3020cf5c67921d727f5ff51266.tar.gz idevicerestore-926b77a9fbb58f3020cf5c67921d727f5ff51266.tar.bz2 |
Added test for limera1n compatibility before attempting to inject it.
Signed-off-by: Martin Szulecki <m.szulecki@libimobiledevice.org>
-rw-r--r-- | src/idevicerestore.c | 2 | ||||
-rw-r--r-- | src/limera1n.c | 7 | ||||
-rw-r--r-- | src/limera1n.h | 1 |
3 files changed, 9 insertions, 1 deletions
diff --git a/src/idevicerestore.c b/src/idevicerestore.c index 5e9b700..c32db88 100644 --- a/src/idevicerestore.c +++ b/src/idevicerestore.c @@ -743,7 +743,7 @@ int idevicerestore_start(struct idevicerestore_client_t* client) // if the device is in DFU mode, place device into recovery mode if (client->mode->index == MODE_DFU) { recovery_client_free(client); - if (client->flags & FLAG_CUSTOM) { + if ((client->flags & FLAG_CUSTOM) && limera1n_is_supported(client->device)) { info("connecting to DFU\n"); if (dfu_client_new(client) < 0) { if (delete_fs && filesystem) diff --git a/src/limera1n.c b/src/limera1n.c index 6ceb65a..25d9e40 100644 --- a/src/limera1n.c +++ b/src/limera1n.c @@ -30,6 +30,13 @@ #include "limera1n.h" #include "limera1n_payload.h" +int limera1n_is_supported(struct irecv_device *device) +{ + return ((device->chip_id == irecv_devices[DEVICE_IPHONE4].chip_id) || + (device->chip_id == irecv_devices[DEVICE_IPHONE3GS].chip_id) || + (device->chip_id == irecv_devices[DEVICE_IPOD3G].chip_id)); +} + int limera1n_exploit(struct irecv_device *device, irecv_client_t *pclient) { irecv_error_t err = IRECV_E_SUCCESS; diff --git a/src/limera1n.h b/src/limera1n.h index c417170..2c92001 100644 --- a/src/limera1n.h +++ b/src/limera1n.h @@ -23,6 +23,7 @@ #define __LIMERA1N_H #include <libirecovery.h> +int limera1n_is_supported(struct irecv_device *device); int limera1n_exploit(struct irecv_device *device, irecv_client_t *client); #endif /* __LIMERA1N_H */ |