mirror of
https://github.com/kvorschk/Magisk.git
synced 2026-12-06 07:20:47 -05:00
Move daemon utilities from base to core
Move utilities that are exclusively used by the daemon (core module) from base to core: - fork_dont_care, fork_no_orphan, new_daemon_thread, init_argv0, set_nice_name, and switch_mnt_ns into utils.cpp - exec_command* functions and exec_t into scripting.cpp as static functions, as scripting is their sole consumer Also remove the unused exec_command_sync overload. Assisted-by: Gemini 3.8 Flash
This commit is contained in:
@@ -25,6 +25,11 @@ use std::os::fd::FromRawFd;
|
||||
use su::{get_pty_num, pump_tty};
|
||||
use zygisk::zygisk_should_load_module;
|
||||
|
||||
pub type ThreadEntry = extern "C" fn(usize) -> usize;
|
||||
unsafe extern "C" {
|
||||
pub fn new_daemon_thread(entry: ThreadEntry, arg: usize);
|
||||
}
|
||||
|
||||
mod bootstages;
|
||||
#[path = "../include/consts.rs"]
|
||||
mod consts;
|
||||
@@ -150,6 +155,8 @@ pub mod ffi {
|
||||
fn resolve_preinit_dir(base_dir: Utf8CStrRef) -> String;
|
||||
fn check_key_combo() -> bool;
|
||||
fn unlock_blocks();
|
||||
fn fork_dont_care() -> i32;
|
||||
fn set_nice_name(name: Utf8CStrRef);
|
||||
fn update_deny_flags(uid: i32, process: &str, flags: &mut u32);
|
||||
fn initialize_denylist();
|
||||
fn switch_mnt_ns(pid: i32) -> i32;
|
||||
|
||||
Reference in New Issue
Block a user