mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-28 04:27:39 +00:00
magiskboot: clean up remaining unneeded ELF detection bits
- default for no format match is UNSUPP_RET (unsupported) so there is no needed to explicitly detect ELF still
This commit is contained in:
parent
290a17a764
commit
90ed4b3c49
@ -90,10 +90,6 @@ int boot_img::parse_file(const char *image) {
|
|||||||
case AOSP:
|
case AOSP:
|
||||||
return parse_image(head);
|
return parse_image(head);
|
||||||
|
|
||||||
/* Unsupported */
|
|
||||||
case ELF32:
|
|
||||||
case ELF64:
|
|
||||||
exit(UNSUPP_RET);
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -27,10 +27,6 @@ format_t check_fmt(const void *buf, size_t len) {
|
|||||||
return CHROMEOS;
|
return CHROMEOS;
|
||||||
} else if (MATCH(BOOT_MAGIC)) {
|
} else if (MATCH(BOOT_MAGIC)) {
|
||||||
return AOSP;
|
return AOSP;
|
||||||
} else if (MATCH(ELF32_MAGIC)) {
|
|
||||||
return ELF32;
|
|
||||||
} else if (MATCH(ELF64_MAGIC)) {
|
|
||||||
return ELF64;
|
|
||||||
} else if (MATCH(GZIP1_MAGIC) || MATCH(GZIP2_MAGIC)) {
|
} else if (MATCH(GZIP1_MAGIC) || MATCH(GZIP2_MAGIC)) {
|
||||||
return GZIP;
|
return GZIP;
|
||||||
} else if (MATCH(LZOP_MAGIC)) {
|
} else if (MATCH(LZOP_MAGIC)) {
|
||||||
|
@ -8,8 +8,6 @@ typedef enum {
|
|||||||
/* Boot formats */
|
/* Boot formats */
|
||||||
CHROMEOS,
|
CHROMEOS,
|
||||||
AOSP,
|
AOSP,
|
||||||
ELF32,
|
|
||||||
ELF64,
|
|
||||||
DHTB,
|
DHTB,
|
||||||
BLOB,
|
BLOB,
|
||||||
/* Compression formats */
|
/* Compression formats */
|
||||||
@ -29,8 +27,6 @@ typedef enum {
|
|||||||
|
|
||||||
#define BOOT_MAGIC "ANDROID!"
|
#define BOOT_MAGIC "ANDROID!"
|
||||||
#define CHROMEOS_MAGIC "CHROMEOS"
|
#define CHROMEOS_MAGIC "CHROMEOS"
|
||||||
#define ELF32_MAGIC "\x7f""ELF\x01"
|
|
||||||
#define ELF64_MAGIC "\x7f""ELF\x02"
|
|
||||||
#define GZIP1_MAGIC "\x1f\x8b"
|
#define GZIP1_MAGIC "\x1f\x8b"
|
||||||
#define GZIP2_MAGIC "\x1f\x9e"
|
#define GZIP2_MAGIC "\x1f\x9e"
|
||||||
#define LZOP_MAGIC "\x89""LZO"
|
#define LZOP_MAGIC "\x89""LZO"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user