Implement preinit related features in Rust

This commit is contained in:
topjohnwu
2024-03-28 14:11:03 -07:00
parent 1eddbfd72c
commit a1b6568226
13 changed files with 312 additions and 164 deletions
+15 -4
View File
@@ -1,6 +1,17 @@
use const_format::concatcp;
use base::const_format::concatcp;
pub const LOGFILE: &str = "/cache/magisk.log";
pub const INTLROOT: &str = ".magisk";
pub const LOG_PIPE: &str = concatcp!(INTLROOT, "/device/log");
pub const MAIN_CONFIG: &str = concatcp!(INTLROOT, "/config");
// data paths
const SECURE_DIR: &str = "/data/adb";
pub const MODULEROOT: &str = concatcp!(SECURE_DIR, "modules");
// tmpfs paths
const INTERNAL_DIR: &str = ".magisk";
pub const LOG_PIPE: &str = concatcp!(INTERNAL_DIR, "/device/log");
pub const MAIN_CONFIG: &str = concatcp!(INTERNAL_DIR, "/config");
pub const PREINITMIRR: &str = concatcp!(INTERNAL_DIR, "/preinit");
pub const MODULEMNT: &str = concatcp!(INTERNAL_DIR, "/modules");
pub const WORKERDIR: &str = concatcp!(INTERNAL_DIR, "/worker");
pub const DEVICEDIR: &str = concatcp!(INTERNAL_DIR, "/device");
pub const PREINITDEV: &str = concatcp!(DEVICEDIR, "/preinit");