diff --git a/native/jni/magiskboot/bootimg.c b/native/jni/magiskboot/bootimg.c index 3964035f4..87710001a 100644 --- a/native/jni/magiskboot/bootimg.c +++ b/native/jni/magiskboot/bootimg.c @@ -124,7 +124,8 @@ int parse_img(const char *image, boot_img *boot) { fprintf(stderr, "PXA_BOOT_HDR\n"); boot->hdr = malloc(sizeof(pxa_boot_img_hdr)); memcpy(boot->hdr, head, sizeof(pxa_boot_img_hdr)); - } else if (memcmp(((boot_img_hdr*) head)->cmdline, NOOK_MAGIC, 12) == 0) { + } else if (memcmp(((boot_img_hdr*) head)->cmdline, NOOK_MAGIC, 12) == 0 + || memcmp(((boot_img_hdr*) head)->cmdline, NOOK_NEW_MAGIC, 26) == 0) { boot->flags |= NOOK_FLAG; fprintf(stderr, "NOOK_GREEN_LOADER\n"); head += NOOK_PRE_HEADER_SZ - 1; diff --git a/native/jni/magiskboot/format.h b/native/jni/magiskboot/format.h index eac6fe4ca..15385a075 100644 --- a/native/jni/magiskboot/format.h +++ b/native/jni/magiskboot/format.h @@ -39,6 +39,7 @@ typedef enum { #define SEANDROID_MAGIC "SEANDROIDENFORCE" #define TEGRABLOB_MAGIC "-SIGNED-BY-SIGNBLOB-" #define NOOK_MAGIC "Green Loader" +#define NOOK_NEW_MAGIC "eMMC boot.img+secondloader" #define NOOK_PRE_HEADER_SZ 1048576 #define SUP_LIST ((char *[]) { "gzip", "xz", "lzma", "bzip2", "lz4", "lz4_legacy", NULL })