ksud: Add uninstall

This commit is contained in:
weishu
2024-04-22 20:41:42 +08:00
parent 4922d89823
commit 0697db618e
3 changed files with 30 additions and 4 deletions

View File

@@ -37,6 +37,13 @@ enum Commands {
/// Install KernelSU userspace component to system
Install,
/// Uninstall KernelSU modules and itself(LKM Only)
Uninstall {
/// magiskboot path, if not specified, will search from $PATH
#[arg(long, default_value = None)]
magiskboot_path: Option<PathBuf>,
},
/// SELinux policy Patch tool
Sepolicy {
#[command(subcommand)]
@@ -301,6 +308,7 @@ pub fn run() -> Result<()> {
}
}
Commands::Install => utils::install(),
Commands::Uninstall { magiskboot_path } => utils::uninstall(magiskboot_path),
Commands::Sepolicy { command } => match command {
Sepolicy::Patch { sepolicy } => crate::sepolicy::live_patch(&sepolicy),
Sepolicy::Apply { file } => crate::sepolicy::apply_file(file),