2022-12-13 03:33:16 +00:00
|
|
|
#![feature(format_args_nl)]
|
2023-06-09 13:43:26 +00:00
|
|
|
#![feature(btree_drain_filter)]
|
|
|
|
#![feature(iter_collect_into)]
|
2022-12-13 03:33:16 +00:00
|
|
|
|
2023-05-26 06:45:38 +00:00
|
|
|
extern crate core;
|
|
|
|
|
2022-07-01 11:53:41 +00:00
|
|
|
pub use base;
|
2023-06-09 13:43:26 +00:00
|
|
|
pub use cpio::*;
|
2023-05-05 01:49:33 +00:00
|
|
|
pub use payload::*;
|
2023-06-09 13:43:26 +00:00
|
|
|
pub use ramdisk::*;
|
2023-05-05 01:49:33 +00:00
|
|
|
|
2023-06-09 13:43:26 +00:00
|
|
|
mod cpio;
|
2023-05-05 01:49:33 +00:00
|
|
|
mod payload;
|
2023-06-09 13:43:26 +00:00
|
|
|
mod ramdisk;
|
2023-05-05 01:49:33 +00:00
|
|
|
mod update_metadata;
|
2022-12-13 03:33:16 +00:00
|
|
|
|
2023-05-20 08:28:10 +00:00
|
|
|
#[cxx::bridge]
|
2023-05-05 01:49:33 +00:00
|
|
|
pub mod ffi {
|
2023-05-26 06:45:38 +00:00
|
|
|
unsafe extern "C++" {
|
2023-05-19 22:16:54 +00:00
|
|
|
include!("compress.hpp");
|
2023-06-09 13:43:26 +00:00
|
|
|
include!("magiskboot.hpp");
|
2023-05-26 06:45:38 +00:00
|
|
|
fn decompress(buf: &[u8], fd: i32) -> bool;
|
2023-06-09 13:43:26 +00:00
|
|
|
fn patch_encryption(buf: &mut [u8]);
|
|
|
|
fn patch_verity(buf: &mut [u8]);
|
2022-12-13 03:33:16 +00:00
|
|
|
}
|
|
|
|
|
2023-05-20 08:28:10 +00:00
|
|
|
#[namespace = "rust"]
|
2022-12-13 03:33:16 +00:00
|
|
|
extern "Rust" {
|
|
|
|
unsafe fn extract_boot_from_payload(
|
2023-05-26 06:45:38 +00:00
|
|
|
partition: *const c_char,
|
2022-12-13 03:33:16 +00:00
|
|
|
in_path: *const c_char,
|
|
|
|
out_path: *const c_char,
|
|
|
|
) -> bool;
|
2023-06-09 13:43:26 +00:00
|
|
|
|
|
|
|
unsafe fn cpio_commands(argc: i32, argv: *const *const c_char) -> bool;
|
2022-12-13 03:33:16 +00:00
|
|
|
}
|
|
|
|
}
|