You've already forked Magisk
mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-09-06 06:36:58 +00:00
Use Rust for formatting
The fprintf implementation included in crt0 is too rudimental
This commit is contained in:
@@ -1,13 +1,26 @@
|
||||
#![feature(format_args_nl)]
|
||||
|
||||
use logging::setup_klog;
|
||||
use rootdir::inject_magisk_rc;
|
||||
// Has to be pub so all symbols in that crate is included
|
||||
pub use magiskpolicy;
|
||||
|
||||
mod logging;
|
||||
mod rootdir;
|
||||
|
||||
#[cxx::bridge]
|
||||
pub mod ffi {
|
||||
#[namespace = "rust"]
|
||||
extern "Rust" {
|
||||
fn setup_klog();
|
||||
fn inject_magisk_rc(fd: i32, tmp_dir: Utf8CStrRef);
|
||||
}
|
||||
|
||||
unsafe extern "C++" {
|
||||
include!("../base/include/base.hpp");
|
||||
|
||||
#[namespace = "rust"]
|
||||
#[cxx_name = "Utf8CStr"]
|
||||
type Utf8CStrRef<'a> = base::ffi::Utf8CStrRef<'a>;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user