From 97138f1e911d4d0527bc89b17817ea2c819f1eb5 Mon Sep 17 00:00:00 2001 From: Wang Han <416810799@qq.com> Date: Sat, 17 Jan 2026 14:38:51 +0800 Subject: [PATCH] magiskboot: Fix tail offset calculation --- native/src/boot/bootimg.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/native/src/boot/bootimg.cpp b/native/src/boot/bootimg.cpp index daa178b4e..eef7de6f6 100644 --- a/native/src/boot/bootimg.cpp +++ b/native/src/boot/bootimg.cpp @@ -915,8 +915,6 @@ void repack(Utf8CStr src_img, Utf8CStr out_img, bool skip_comp) { file_align(); } - off.tail = lseek(fd, 0, SEEK_CUR); - // Proprietary stuffs if (boot.flags[SEANDROID_FLAG]) { xwrite(fd, SEANDROID_MAGIC, 16); @@ -927,6 +925,7 @@ void repack(Utf8CStr src_img, Utf8CStr out_img, bool skip_comp) { xwrite(fd, LG_BUMP_MAGIC, 16); } + off.tail = lseek(fd, 0, SEEK_CUR); file_align(); // vbmeta