mirror of
https://github.com/kvorschk/Magisk.git
synced 2026-12-04 19:10:47 -05:00
Port find_dtb_offset from C++ to Rust in dtb.rs, using the fdt crate for header parsing and root node validation. Key changes: - Upgrade fdt crate to 0.2.0-alpha2 and adapt dtb.rs to updated APIs. - Implement find_dtb_offset using Fdt::new_unaligned_fallible. - Define MIN_NON_EMPTY_DTB_SIZE (0x48) per Linux kernel ARM zImage specification to ignore empty or false positive DTB headers. - Expose find_dtb_offset to C++ via CXX bridge and clean up legacy structs and declarations. Assisted-by: Gemini 3.7 Flash