From 90ed4b3c49e4a95112fa272b09ccd927500de422 Mon Sep 17 00:00:00 2001 From: osm0sis Date: Mon, 20 May 2019 22:27:36 -0300 Subject: [PATCH] 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 --- native/jni/magiskboot/bootimg.cpp | 4 ---- native/jni/magiskboot/format.cpp | 4 ---- native/jni/magiskboot/format.h | 4 ---- 3 files changed, 12 deletions(-) diff --git a/native/jni/magiskboot/bootimg.cpp b/native/jni/magiskboot/bootimg.cpp index 4057afb3f..07ba2e160 100644 --- a/native/jni/magiskboot/bootimg.cpp +++ b/native/jni/magiskboot/bootimg.cpp @@ -90,10 +90,6 @@ int boot_img::parse_file(const char *image) { case AOSP: return parse_image(head); - /* Unsupported */ - case ELF32: - case ELF64: - exit(UNSUPP_RET); default: break; } diff --git a/native/jni/magiskboot/format.cpp b/native/jni/magiskboot/format.cpp index 9c5f56a11..eda3ceaa7 100644 --- a/native/jni/magiskboot/format.cpp +++ b/native/jni/magiskboot/format.cpp @@ -27,10 +27,6 @@ format_t check_fmt(const void *buf, size_t len) { return CHROMEOS; } else if (MATCH(BOOT_MAGIC)) { return AOSP; - } else if (MATCH(ELF32_MAGIC)) { - return ELF32; - } else if (MATCH(ELF64_MAGIC)) { - return ELF64; } else if (MATCH(GZIP1_MAGIC) || MATCH(GZIP2_MAGIC)) { return GZIP; } else if (MATCH(LZOP_MAGIC)) { diff --git a/native/jni/magiskboot/format.h b/native/jni/magiskboot/format.h index 1d53ddb13..6ec8ab042 100644 --- a/native/jni/magiskboot/format.h +++ b/native/jni/magiskboot/format.h @@ -8,8 +8,6 @@ typedef enum { /* Boot formats */ CHROMEOS, AOSP, - ELF32, - ELF64, DHTB, BLOB, /* Compression formats */ @@ -29,8 +27,6 @@ typedef enum { #define BOOT_MAGIC "ANDROID!" #define CHROMEOS_MAGIC "CHROMEOS" -#define ELF32_MAGIC "\x7f""ELF\x01" -#define ELF64_MAGIC "\x7f""ELF\x02" #define GZIP1_MAGIC "\x1f\x8b" #define GZIP2_MAGIC "\x1f\x9e" #define LZOP_MAGIC "\x89""LZO"