summaryrefslogtreecommitdiffstats
path: root/src/dfu.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dfu.c')
-rw-r--r--src/dfu.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/dfu.c b/src/dfu.c
index df9379e..37fa2d4 100644
--- a/src/dfu.c
+++ b/src/dfu.c
@@ -241,6 +241,22 @@ int dfu_get_cpid(struct idevicerestore_client_t* client, unsigned int* cpid) {
return 0;
}
+int dfu_is_image4_supported(struct idevicerestore_client_t* client)
+{
+ if(client->dfu == NULL) {
+ if (dfu_client_new(client) < 0) {
+ return 0;
+ }
+ }
+
+ const struct irecv_device_info *device_info = irecv_get_device_info(client->dfu->client);
+ if (!device_info) {
+ return 0;
+ }
+
+ return (device_info->ibfl & IBOOT_FLAG_IMAGE4_AWARE);
+}
+
int dfu_get_ap_nonce(struct idevicerestore_client_t* client, unsigned char** nonce, int* nonce_size) {
irecv_error_t dfu_error = IRECV_E_SUCCESS;
@@ -250,7 +266,6 @@ int dfu_get_ap_nonce(struct idevicerestore_client_t* client, unsigned char** non
}
}
-
const struct irecv_device_info *device_info = irecv_get_device_info(client->dfu->client);
if (!device_info) {
return -1;