Skip to content

Commit b86b6df

Browse files
committed
fix magiskboot error,try support kernel 6.12 patch
1 parent e3166ce commit b86b6df

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

.github/workflows/build.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ jobs:
3535
- name: Build resetprop
3636
run: ./build.py -vr native resetprop
3737

38+
- name: Build magiskboot
39+
run: ./build.py -vr native magiskboot
40+
3841
- name: Stop gradle daemon
3942
run: ./app/gradlew --stop
4043

native/src/boot/bootimg.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,8 @@ struct [[gnu::packed]] fdt_header {
272272
static int find_dtb_offset(const uint8_t *buf, unsigned sz) {
273273
const uint8_t * const end = buf + sz;
274274

275-
for (auto curr = buf; curr < end; curr += sizeof(fdt_header)) {
276-
curr = static_cast<uint8_t*>(memmem(curr, end - curr, DTB_MAGIC, sizeof(fdt_header::fdt32_t)));
275+
for (auto curr = buf; curr < end; curr += sizeof(fdt_header)+2) {
276+
curr = static_cast<uint8_t*>(memmem(curr, end - curr, DTB_MAGIC, sizeof(fdt_header::fdt32_t)+2));
277277
if (curr == nullptr)
278278
return -1;
279279

native/src/boot/magiskboot.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#define LZ41_MAGIC "\x03\x21\x4c\x18"
3131
#define LZ42_MAGIC "\x04\x22\x4d\x18"
3232
#define MTK_MAGIC "\x88\x16\x88\x58"
33-
#define DTB_MAGIC "\xd0\x0d\xfe\xed"
33+
#define DTB_MAGIC "\xd0\x0d\xfe\xed\x00\x05"
3434
#define LG_BUMP_MAGIC "\x41\xa9\xe4\x67\x74\x4d\x1d\x1b\xa4\x29\xf2\xec\xea\x65\x52\x79"
3535
#define DHTB_MAGIC "\x44\x48\x54\x42\x01\x00\x00\x00"
3636
#define SEANDROID_MAGIC "SEANDROIDENFORCE"

0 commit comments

Comments
 (0)