summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2012-02-02 22:24:29 +0100
committerGravatar Nikias Bassen2012-02-02 22:24:29 +0100
commita657e472691dc02198f4849f2c9a05926b41fd66 (patch)
tree2af845579bd70c6f1640e73b7479a935b3530c7c /src
parentdc69608d4131a3d8bfe7710ed88ea679087b037f (diff)
downloadidevicerestore-a657e472691dc02198f4849f2c9a05926b41fd66.tar.gz
idevicerestore-a657e472691dc02198f4849f2c9a05926b41fd66.tar.bz2
idevicerestore: add get_component_name helper function
Diffstat (limited to 'src')
-rw-r--r--src/idevicerestore.c33
-rw-r--r--src/idevicerestore.h1
2 files changed, 34 insertions, 0 deletions
diff --git a/src/idevicerestore.c b/src/idevicerestore.c
index ef821f8..d02864e 100644
--- a/src/idevicerestore.c
+++ b/src/idevicerestore.c
@@ -925,3 +925,36 @@ int build_identity_get_component_path(plist_t build_identity, const char* compon
return 0;
}
+const char* get_component_name(const char* filename)
+{
+ if (!strncmp(filename, "LLB", 3)) {
+ return "LLB";
+ } else if (!strncmp(filename, "iBoot", 5)) {
+ return "iBoot";
+ } else if (!strncmp(filename, "DeviceTree", 10)) {
+ return "RestoreDeviceTree";
+ } else if (!strncmp(filename, "applelogo", 9)) {
+ return "AppleLogo";
+ } else if (!strncmp(filename, "recoverymode", 12)) {
+ return "RecoveryMode";
+ } else if (!strncmp(filename, "batterylow0", 11)) {
+ return "BatteryLow0";
+ } else if (!strncmp(filename, "batterylow1", 11)) {
+ return "BatteryLow1";
+ } else if (!strncmp(filename, "glyphcharging", 13)) {
+ return "BatteryCharging";
+ } else if (!strncmp(filename, "glyphplugin", 11)) {
+ return "BatteryPlugin";
+ } else if (!strncmp(filename, "batterycharging0", 16)) {
+ return "BatteryCharging0";
+ } else if (!strncmp(filename, "batterycharging1", 16)) {
+ return "BatteryCharging1";
+ } else if (!strncmp(filename, "batteryfull", 11)) {
+ return "BatteryFull";
+ } else if (!strncmp(filename, "SCAB", 4)) {
+ return "SCAB";
+ } else {
+ error("WARNING: Unhandled component '%s'", filename);
+ return NULL;
+ }
+}
diff --git a/src/idevicerestore.h b/src/idevicerestore.h
index a83ac5c..4d25428 100644
--- a/src/idevicerestore.h
+++ b/src/idevicerestore.h
@@ -46,6 +46,7 @@ void build_identity_print_information(plist_t build_identity);
int build_identity_get_component_path(plist_t build_identity, const char* component, char** path);
int ipsw_extract_filesystem(const char* ipsw, plist_t build_identity, char** filesystem);
int ipsw_get_component_by_path(const char* ipsw, plist_t tss, const char* component, const char* path, char** data, uint32_t* size);
+const char* get_component_name(const char* filename);
#ifdef __cplusplus
}