42 lines
895 B
Rust
Raw Normal View History

2023-05-09 18:54:38 -07:00
use daemon::*;
2022-07-24 06:14:49 -07:00
use logging::*;
2023-05-21 23:51:30 -07:00
use std::ffi::CStr;
2022-07-05 21:13:09 -07:00
2023-05-23 21:30:30 -07:00
#[path = "../include/consts.rs"]
mod consts;
2023-05-09 18:54:38 -07:00
mod daemon;
2022-07-05 21:13:09 -07:00
mod logging;
2022-07-01 04:53:41 -07:00
#[cxx::bridge]
pub mod ffi {
2023-05-21 23:51:30 -07:00
extern "C++" {
2023-05-22 21:36:15 -07:00
include!("resetprop/resetprop.hpp");
2023-05-21 23:51:30 -07:00
unsafe fn get_prop_rs(name: *const c_char, persist: bool) -> String;
}
2022-07-01 04:53:41 -07:00
extern "Rust" {
fn rust_test_entry();
2022-07-05 21:13:09 -07:00
fn android_logging();
fn magisk_logging();
fn zygisk_logging();
}
2023-05-16 02:09:05 -07:00
#[namespace = "rust"]
2023-05-09 18:54:38 -07:00
extern "Rust" {
fn daemon_entry();
fn zygisk_entry();
type MagiskD;
fn get_magiskd() -> &'static MagiskD;
fn get_log_pipe(self: &MagiskD) -> i32;
fn close_log_pipe(self: &MagiskD);
fn setup_logfile(self: &MagiskD);
}
}
2022-07-01 04:53:41 -07:00
fn rust_test_entry() {}
2023-05-21 23:51:30 -07:00
pub fn get_prop(name: &CStr, persist: bool) -> String {
unsafe { ffi::get_prop_rs(name.as_ptr(), persist) }
}