summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2021-11-27 00:02:16 +0100
committerGravatar Nikias Bassen2021-11-27 00:04:07 +0100
commit38595f0b7dac3d53033f93e9893d9be49996ba95 (patch)
tree9c1b4ef1c92b559a3949597905aa3dda6afb4c95
parent1b19774be006645c424d1df52f792faa807a5db9 (diff)
downloadidevicerestore-master.tar.gz
idevicerestore-master.tar.bz2
Use macros for the different restore variant stringsHEADmaster
-rw-r--r--src/idevicerestore.c6
-rw-r--r--src/idevicerestore.h4
-rw-r--r--src/restore.c6
3 files changed, 10 insertions, 6 deletions
diff --git a/src/idevicerestore.c b/src/idevicerestore.c
index 017b45c..f0dc8ad 100644
--- a/src/idevicerestore.c
+++ b/src/idevicerestore.c
@@ -816,20 +816,20 @@ int idevicerestore_start(struct idevicerestore_client_t* client)
// add info
inf = plist_new_dict();
plist_dict_set_item(inf, "RestoreBehavior", plist_new_string((client->flags & FLAG_ERASE) ? "Erase" : "Update"));
- plist_dict_set_item(inf, "Variant", plist_new_string((client->flags & FLAG_ERASE) ? "Customer Erase Install (IPSW)" : "Customer Upgrade Install (IPSW)"));
+ plist_dict_set_item(inf, "Variant", plist_new_string((client->flags & FLAG_ERASE) ? RESTORE_VARIANT_CUSTOMER_ERASE : RESTORE_VARIANT_CUSTOMER_UPGRADE));
plist_dict_set_item(build_identity, "Info", inf);
// finally add manifest
plist_dict_set_item(build_identity, "Manifest", manifest);
}
} else if (client->flags & FLAG_ERASE) {
- build_identity = build_manifest_get_build_identity_for_model_with_variant(client->build_manifest, client->device->hardware_model, "Customer Erase Install (IPSW)");
+ build_identity = build_manifest_get_build_identity_for_model_with_variant(client->build_manifest, client->device->hardware_model, RESTORE_VARIANT_CUSTOMER_ERASE);
if (build_identity == NULL) {
error("ERROR: Unable to find any build identities\n");
return -1;
}
} else {
- build_identity = build_manifest_get_build_identity_for_model_with_variant(client->build_manifest, client->device->hardware_model, "Customer Upgrade Install (IPSW)");
+ build_identity = build_manifest_get_build_identity_for_model_with_variant(client->build_manifest, client->device->hardware_model, RESTORE_VARIANT_CUSTOMER_UPGRADE);
if (!build_identity) {
build_identity = build_manifest_get_build_identity_for_model(client->build_manifest, client->device->hardware_model);
}
diff --git a/src/idevicerestore.h b/src/idevicerestore.h
index 880f9ee..f9ab18f 100644
--- a/src/idevicerestore.h
+++ b/src/idevicerestore.h
@@ -47,6 +47,10 @@ extern "C" {
#define FLAG_NO_RESTORE (1 << 11)
#define FLAG_IGNORE_ERRORS (1 << 12)
+#define RESTORE_VARIANT_CUSTOMER_ERASE "Customer Erase Install (IPSW)"
+#define RESTORE_VARIANT_CUSTOMER_UPGRADE "Customer Upgrade Install (IPSW)"
+#define RESTORE_VARIANT_MACOS_RECOVERY_OS "macOS Customer"
+
struct idevicerestore_client_t;
enum {
diff --git a/src/restore.c b/src/restore.c
index 7b61766..e29ae97 100644
--- a/src/restore.c
+++ b/src/restore.c
@@ -2955,11 +2955,11 @@ plist_t restore_get_build_identity(struct idevicerestore_client_t* client, uint8
const char *variant;
if (is_recover_os)
- variant = "macOS Customer";
+ variant = RESTORE_VARIANT_MACOS_RECOVERY_OS;
else if (client->flags & FLAG_ERASE)
- variant = "Customer Erase Install (IPSW)";
+ variant = RESTORE_VARIANT_CUSTOMER_ERASE;
else
- variant = "Customer Upgrade Install (IPSW)";
+ variant = RESTORE_VARIANT_CUSTOMER_UPGRADE;
plist_t build_identity = build_manifest_get_build_identity_for_model_with_variant(
client->build_manifest,