mirror of
https://github.com/kvorschk/Magisk.git
synced 2026-12-04 19:10:47 -05:00
Detect the architecture and file format from input bytes to apply the proper BCJ pre-filter when compressing with XZ: - ELF binaries: map e_machine to x86, ARM-Thumb, ARM64, or RISC-V. - Linux kernels: detect ARM64 raw Image, RISC-V Image, and ARM32 raw vmlinux.bin via condition-code density. - Non-code data: omit BCJ filters to avoid degradation. Introduce get_encoder_bcj_detection and eliminate the redundant compress_bytes_kernel and compress_len_kernel helpers. Assisted-by: Gemini 3.8 Flash