summaryrefslogtreecommitdiffstats
path: root/src/idevicerestore.c
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2013-11-19 21:38:31 +0100
committerGravatar Nikias Bassen2013-11-19 21:38:31 +0100
commit3f8dea9bd12c4b4c52224b1a84835fa56df53fb2 (patch)
tree4a5ee3b9be4d6a521899e4342c49e9decb1c5a08 /src/idevicerestore.c
parentaee53bef0385841109432948dbf814907a7d2dca (diff)
downloadidevicerestore-3f8dea9bd12c4b4c52224b1a84835fa56df53fb2.tar.gz
idevicerestore-3f8dea9bd12c4b4c52224b1a84835fa56df53fb2.tar.bz2
Add helper function to check if device supports image4 format
Diffstat (limited to 'src/idevicerestore.c')
-rw-r--r--src/idevicerestore.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/idevicerestore.c b/src/idevicerestore.c
index e9580bd..a0f5a87 100644
--- a/src/idevicerestore.c
+++ b/src/idevicerestore.c
@@ -365,6 +365,9 @@ int idevicerestore_start(struct idevicerestore_client_t* client)
info("Product Version: %s\n", client->version);
info("Product Build: %s Major: %d\n", client->build, client->build_major);
+ client->image4supported = is_image4_supported(client);
+ info("Device supports Image4: %s\n", (client->image4supported) ? "true" : "false");
+
if (client->flags & FLAG_CUSTOM) {
/* prevent signing custom firmware */
tss_enabled = 0;
@@ -1182,6 +1185,27 @@ const char* check_product_type(struct idevicerestore_client_t* client) {
return product_type;
}
+int is_image4_supported(struct idevicerestore_client_t* client)
+{
+ int res = 0;
+
+ switch (client->mode->index) {
+ case MODE_NORMAL:
+ res = normal_is_image4_supported(client);
+ break;
+ case MODE_DFU:
+ res = dfu_is_image4_supported(client);
+ break;
+ case MODE_RECOVERY:
+ res = recovery_is_image4_supported(client);
+ break;
+ default:
+ error("ERROR: Device is in an invalid state\n");
+ return 0;
+ }
+ return res;
+}
+
int get_ecid(struct idevicerestore_client_t* client, uint64_t* ecid) {
switch (client->mode->index) {
case MODE_NORMAL: