mirror of
https://github.com/tiann/KernelSU.git
synced 2025-02-20 11:43:32 +08:00
ksud: enter root shell when arg0 equals su
This commit is contained in:
parent
ed0e9cff4b
commit
bdd5e31b6f
@ -138,6 +138,12 @@ pub fn run() -> Result<()> {
|
||||
#[cfg(not(target_os = "android"))]
|
||||
env_logger::init();
|
||||
|
||||
// the kernel executes su with argv[0] = "su" and replace it with us
|
||||
let arg0 = std::env::args().next().unwrap_or_default();
|
||||
if arg0 == "su" || arg0 == "/system/bin/su" {
|
||||
return crate::ksu::grant_root();
|
||||
}
|
||||
|
||||
let cli = Args::parse();
|
||||
|
||||
log::info!("command: {:?}", cli.command);
|
||||
|
Loading…
x
Reference in New Issue
Block a user