Revert "su: allocate new pty (#1693)"

This reverts commit 935dc18faa.
This commit is contained in:
weishu
2024-05-08 21:17:24 +08:00
parent 98757bcdb3
commit a3df721b84
7 changed files with 2 additions and 236 deletions

View File

@@ -1,6 +1,6 @@
use anyhow::{Ok, Result};
use clap::Parser;
use std::path::{Path, PathBuf};
use std::path::PathBuf;
#[cfg(target_os = "android")]
use android_logger::Config;
@@ -283,7 +283,7 @@ pub fn run() -> Result<()> {
// the kernel executes su with argv[0] = "su" and replace it with us
let arg0 = std::env::args().next().unwrap_or_default();
if Path::new(&arg0).file_name().and_then(|f| f.to_str()) == Some("su") {
if arg0 == "su" || arg0 == "/system/bin/su" {
return crate::su::root_shell();
}