From a54bdb54e4b62d4e22e355e16a577720b692ed3c Mon Sep 17 00:00:00 2001 From: 5ec1cff <56485584+5ec1cff@users.noreply.github.com> Date: Sun, 20 Jul 2025 16:02:11 +0800 Subject: [PATCH] Skip avb 1,0 verify if tail contains avb 2.0 header This way, magiskboot will not print "unexpected ASN.1 DER tag: expected SEQUENCE, got APPLICATION [1] (primitive)". --- native/src/boot/bootimg.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/native/src/boot/bootimg.cpp b/native/src/boot/bootimg.cpp index 61ad88107..c25d75182 100644 --- a/native/src/boot/bootimg.cpp +++ b/native/src/boot/bootimg.cpp @@ -523,10 +523,8 @@ bool boot_img::parse_image(const uint8_t *p, FileFormat type) { } else if (tail.sz() >= 16 && BUFFER_MATCH(tail.buf(), LG_BUMP_MAGIC)) { fprintf(stderr, "LG_BUMP_IMAGE\n"); flags[LG_BUMP_FLAG] = true; - } - - // Check if the image is signed - if (verify()) { + } else if (!(tail.sz() >= 4 && BUFFER_MATCH(tail.buf(), AVB_MAGIC)) && verify()) { + // Check if the image is avb 1.0 signed fprintf(stderr, "AVB1_SIGNED\n"); flags[AVB1_SIGNED_FLAG] = true; }