You've already forked ZygiskNext
mirror of
https://github.com/Dr-TSNG/ZygiskNext.git
synced 2025-08-27 23:46:34 +00:00
ba8c313122
# Conflicts: # loader/src/Android.mk # loader/src/external/Android.mk # loader/src/injector/hook.cpp # module/src/customize.sh # zygiskd/Cargo.toml # zygiskd/src/utils.rs # zygiskd/src/watchdog.rs
68 lines
2.5 KiB
Rust
68 lines
2.5 KiB
Rust
use bitflags::bitflags;
|
|
use const_format::concatcp;
|
|
use konst::primitive::parse_i32;
|
|
use konst::unwrap_ctx;
|
|
use log::LevelFilter;
|
|
use num_enum::TryFromPrimitive;
|
|
use crate::lp_select;
|
|
|
|
pub const MIN_KSU_VERSION: i32 = unwrap_ctx!(parse_i32(env!("MIN_KSU_VERSION")));
|
|
pub const MAX_KSU_VERSION: i32 = unwrap_ctx!(parse_i32(env!("MAX_KSU_VERSION")));
|
|
pub const MIN_MAGISK_VERSION: i32 = unwrap_ctx!(parse_i32(env!("MIN_MAGISK_VERSION")));
|
|
|
|
#[cfg(debug_assertions)]
|
|
pub const MAX_LOG_LEVEL: LevelFilter = LevelFilter::Trace;
|
|
#[cfg(not(debug_assertions))]
|
|
pub const MAX_LOG_LEVEL: LevelFilter = LevelFilter::Info;
|
|
|
|
pub const PROP_CTL_RESTART: &str = "ctl.restart";
|
|
pub const PROP_CTL_SIGSTOP_OFF: &str = "ctl.sigstop_off";
|
|
|
|
pub const PATH_WORK_DIR: &str = "/dev/zygisk"; // TODO: Replace with /debug_ramdisk/zygisk
|
|
pub const PATH_PROP_OVERLAY: &str = concatcp!(PATH_WORK_DIR, "/module.prop");
|
|
pub const PATH_CP_SOCKET: &str = concatcp!(PATH_WORK_DIR, lp_select!("/cp32.sock", "/cp64.sock"));
|
|
pub const PATH_PT_LOCK32: &str = concatcp!(PATH_WORK_DIR, "/lock32");
|
|
pub const PATH_PT_LOCK64: &str = concatcp!(PATH_WORK_DIR, "/lock64");
|
|
|
|
pub const PATH_MODULES_DIR: &str = "..";
|
|
pub const PATH_MODULE_PROP: &str = "module.prop";
|
|
pub const PATH_CP_BIN32: &str = "bin/zygisk-cp32";
|
|
pub const PATH_CP_BIN64: &str = "bin/zygisk-cp64";
|
|
pub const PATH_PT_BIN32: &str = "bin/zygisk-ptracer32";
|
|
pub const PATH_PT_BIN64: &str = "bin/zygisk-ptracer64";
|
|
|
|
|
|
pub const STATUS_LOADED: &str = "😋 Zygisk Next is loaded";
|
|
pub const STATUS_CRASHED: &str = "❌ Zygisk Next has crashed";
|
|
pub const STATUS_ROOT_IMPL_NONE: &str = "❌ Unknown root implementation";
|
|
pub const STATUS_ROOT_IMPL_TOO_OLD: &str = "❌ Root implementation version too old";
|
|
pub const STATUS_ROOT_IMPL_ABNORMAL: &str = "❌ Abnormal root implementation version";
|
|
pub const STATUS_ROOT_IMPL_MULTIPLE: &str = "❌ Multiple root implementations installed";
|
|
|
|
pub const MAX_RESTART_COUNT: i32 = 5;
|
|
pub const ZYGOTE_SERVICE_PROP: &str = "init.svc.zygote";
|
|
|
|
#[derive(Debug, Eq, PartialEq, TryFromPrimitive)]
|
|
#[repr(u8)]
|
|
pub enum DaemonSocketAction {
|
|
PingHeartbeat,
|
|
RequestLogcatFd,
|
|
GetProcessFlags,
|
|
ReadModules,
|
|
RequestCompanionSocket,
|
|
GetModuleDir,
|
|
ZygoteRestarted,
|
|
}
|
|
|
|
// Zygisk process flags
|
|
bitflags! {
|
|
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
|
|
pub struct ProcessFlags: u32 {
|
|
const PROCESS_GRANTED_ROOT = 1 << 0;
|
|
const PROCESS_ON_DENYLIST = 1 << 1;
|
|
const PROCESS_ROOT_IS_KSU = 1 << 29;
|
|
const PROCESS_ROOT_IS_MAGISK = 1 << 30;
|
|
const PROCESS_IS_SYSUI = 1 << 31;
|
|
}
|
|
}
|