summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2012-02-02 02:07:50 +0100
committerGravatar Nikias Bassen2012-02-02 02:07:50 +0100
commit3913f910a840068ec34fd62f60b3bb78f7a9edd3 (patch)
tree019631306ff5bbffd97e39e3beb27eceb1255593
parent5d29908d728c824f067cca13bf4e03f4f44afa7b (diff)
downloadidevicerestore-3913f910a840068ec34fd62f60b3bb78f7a9edd3.tar.gz
idevicerestore-3913f910a840068ec34fd62f60b3bb78f7a9edd3.tar.bz2
main: store product version & build in client struct for later checks
-rw-r--r--src/common.h2
-rw-r--r--src/idevicerestore.c22
-rw-r--r--src/idevicerestore.h2
3 files changed, 12 insertions, 14 deletions
diff --git a/src/common.h b/src/common.h
index 5568930..87b91aa 100644
--- a/src/common.h
+++ b/src/common.h
@@ -136,6 +136,8 @@ struct idevicerestore_client_t {
struct idevicerestore_device_t* device;
struct idevicerestore_entry_t** entries;
struct idevicerestore_mode_t* mode;
+ char* version;
+ char* build;
};
static struct idevicerestore_mode_t idevicerestore_modes[] = {
diff --git a/src/idevicerestore.c b/src/idevicerestore.c
index b4127a2..13966d0 100644
--- a/src/idevicerestore.c
+++ b/src/idevicerestore.c
@@ -163,7 +163,10 @@ int main(int argc, char* argv[]) {
}
/* print iOS information from the manifest */
- build_manifest_print_information(buildmanifest);
+ build_manifest_get_version_information(buildmanifest, &client->version, &client->build);
+
+ info("Product Version: %s\n", client->version);
+ info("Product Build: %s\n", client->build);
if (client->flags & FLAG_CUSTOM) {
/* prevent signing custom firmware */
@@ -662,31 +665,24 @@ int ipsw_get_component_by_path(const char* ipsw, plist_t tss, const char* path,
return 0;
}
-void build_manifest_print_information(plist_t build_manifest) {
- char* value = NULL;
+void build_manifest_get_version_information(plist_t build_manifest, char** product_version, char** product_build) {
plist_t node = NULL;
+ *product_version = NULL;
+ *product_build = NULL;
node = plist_dict_get_item(build_manifest, "ProductVersion");
if (!node || plist_get_node_type(node) != PLIST_STRING) {
error("ERROR: Unable to find ProductVersion node\n");
return;
}
- plist_get_string_val(node, &value);
-
- info("Product Version: %s\n", value);
- free(value);
+ plist_get_string_val(node, product_version);
node = plist_dict_get_item(build_manifest, "ProductBuildVersion");
if (!node || plist_get_node_type(node) != PLIST_STRING) {
error("ERROR: Unable to find ProductBuildVersion node\n");
return;
}
- plist_get_string_val(node, &value);
-
- info("Product Build: %s\n", value);
- free(value);
-
- node = NULL;
+ plist_get_string_val(node, product_build);
}
void build_identity_print_information(plist_t build_identity) {
diff --git a/src/idevicerestore.h b/src/idevicerestore.h
index 4f59a02..c34dc26 100644
--- a/src/idevicerestore.h
+++ b/src/idevicerestore.h
@@ -38,7 +38,7 @@ int get_ecid(struct idevicerestore_client_t* client, uint64_t* ecid);
int get_bdid(struct idevicerestore_client_t* client, uint32_t* bdid);
int get_cpid(struct idevicerestore_client_t* client, uint32_t* cpid);
int get_shsh_blobs(struct idevicerestore_client_t* client, uint64_t ecid, plist_t build_identity, plist_t* tss);
-void build_manifest_print_information(plist_t build_manifest);
+void build_manifest_get_version_information(plist_t build_manifest, char** product_version, char** product_build);
plist_t build_manifest_get_build_identity(plist_t build_manifest, uint32_t identity);
int build_manifest_get_build_count(plist_t build_manifest);
void build_identity_print_information(plist_t build_identity);