diff options
author | Nikias Bassen | 2013-11-19 21:38:31 +0100 |
---|---|---|
committer | Nikias Bassen | 2013-11-19 21:38:31 +0100 |
commit | 3f8dea9bd12c4b4c52224b1a84835fa56df53fb2 (patch) | |
tree | 4a5ee3b9be4d6a521899e4342c49e9decb1c5a08 /src/recovery.c | |
parent | aee53bef0385841109432948dbf814907a7d2dca (diff) | |
download | idevicerestore-3f8dea9bd12c4b4c52224b1a84835fa56df53fb2.tar.gz idevicerestore-3f8dea9bd12c4b4c52224b1a84835fa56df53fb2.tar.bz2 |
Add helper function to check if device supports image4 format
Diffstat (limited to 'src/recovery.c')
-rw-r--r-- | src/recovery.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/recovery.c b/src/recovery.c index f2104b7..9221dda 100644 --- a/src/recovery.c +++ b/src/recovery.c @@ -461,6 +461,22 @@ int recovery_get_ecid(struct idevicerestore_client_t* client, uint64_t* ecid) { return 0; } +int recovery_is_image4_supported(struct idevicerestore_client_t* client) +{ + if(client->recovery == NULL) { + if (recovery_client_new(client) < 0) { + return 0; + } + } + + const struct irecv_device_info *device_info = irecv_get_device_info(client->recovery->client); + if (!device_info) { + return 0; + } + + return (device_info->ibfl & IBOOT_FLAG_IMAGE4_AWARE); +} + int recovery_get_ap_nonce(struct idevicerestore_client_t* client, unsigned char** nonce, int* nonce_size) { irecv_error_t recovery_error = IRECV_E_SUCCESS; |