Refactor magiskboot cpio

This commit is contained in:
LoveSy
2023-06-09 21:43:26 +08:00
committed by John Wu
parent c1038ac6f9
commit b8cb9cd84d
13 changed files with 881 additions and 567 deletions
+11
View File
@@ -1,18 +1,27 @@
#![feature(format_args_nl)]
#![feature(btree_drain_filter)]
#![feature(iter_collect_into)]
extern crate core;
pub use base;
pub use cpio::*;
pub use payload::*;
pub use ramdisk::*;
mod cpio;
mod payload;
mod ramdisk;
mod update_metadata;
#[cxx::bridge]
pub mod ffi {
unsafe extern "C++" {
include!("compress.hpp");
include!("magiskboot.hpp");
fn decompress(buf: &[u8], fd: i32) -> bool;
fn patch_encryption(buf: &mut [u8]);
fn patch_verity(buf: &mut [u8]);
}
#[namespace = "rust"]
@@ -22,5 +31,7 @@ pub mod ffi {
in_path: *const c_char,
out_path: *const c_char,
) -> bool;
unsafe fn cpio_commands(argc: i32, argv: *const *const c_char) -> bool;
}
}