You've already forked KernelSU-Next
mirror of
https://github.com/KernelSU-Next/KernelSU-Next.git
synced 2025-08-27 23:46:34 +00:00
ksud: added module restore cmd, replaced pkg id for debug and uninstall manager and changed banner
manager: implement restore module UI
This commit is contained in:
@@ -3,3 +3,7 @@
|
||||
| ' // _ \ '__| '_ \ / _ \ \___ \| | | |
|
||||
| . \ __/ | | | | | __/ |___) | |_| |
|
||||
|_|\_\___|_| |_| |_|\___|_|____/ \___/
|
||||
| \ | | _____ _| |_
|
||||
| \| |/ _ \ \/ / __|
|
||||
| |\ | __/> <| |_
|
||||
|_| \_|\___/_/\_\\__|
|
||||
|
||||
@@ -143,7 +143,7 @@ enum Debug {
|
||||
/// Set the manager app, kernel CONFIG_KSU_DEBUG should be enabled.
|
||||
SetManager {
|
||||
/// manager package name
|
||||
#[arg(default_value_t = String::from("me.weishu.kernelsu"))]
|
||||
#[arg(default_value_t = String::from("com.rifsxd.ksunext"))]
|
||||
apk: String,
|
||||
},
|
||||
|
||||
@@ -204,6 +204,12 @@ enum Module {
|
||||
id: String,
|
||||
},
|
||||
|
||||
/// Restore module <id>
|
||||
Restore {
|
||||
/// module id
|
||||
id: String,
|
||||
},
|
||||
|
||||
/// enable module <id>
|
||||
Enable {
|
||||
/// module id
|
||||
@@ -304,6 +310,7 @@ pub fn run() -> Result<()> {
|
||||
match command {
|
||||
Module::Install { zip } => module::install_module(&zip),
|
||||
Module::Uninstall { id } => module::uninstall_module(&id),
|
||||
Module::Restore { id } => module::restore_module(&id),
|
||||
Module::Enable { id } => module::enable_module(&id),
|
||||
Module::Disable { id } => module::disable_module(&id),
|
||||
Module::Action { id } => module::run_action(&id),
|
||||
|
||||
@@ -392,6 +392,10 @@ pub fn uninstall_module(id: &str) -> Result<()> {
|
||||
mark_module_state(id, defs::REMOVE_FILE_NAME, true)
|
||||
}
|
||||
|
||||
pub fn restore_module(id: &str) -> Result<()> {
|
||||
mark_module_state(id, defs::REMOVE_FILE_NAME, false)
|
||||
}
|
||||
|
||||
pub fn run_action(id: &str) -> Result<()> {
|
||||
let action_script_path = format!("/data/adb/modules/{}/action.sh", id);
|
||||
exec_script(&action_script_path, true)
|
||||
|
||||
@@ -225,7 +225,7 @@ pub fn uninstall(magiskboot_path: Option<PathBuf>) -> Result<()> {
|
||||
boot_patch::restore(None, magiskboot_path, true)?;
|
||||
println!("- Uninstall KernelSU manager..");
|
||||
Command::new("pm")
|
||||
.args(["uninstall", "me.weishu.kernelsu"])
|
||||
.args(["uninstall", "com.rifsxd.ksunext"])
|
||||
.spawn()?;
|
||||
println!("- Rebooting in 5 seconds..");
|
||||
std::thread::sleep(std::time::Duration::from_secs(5));
|
||||
|
||||
Reference in New Issue
Block a user