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
Merge branch 'rifsxd:next' into next
This commit is contained in:
@@ -212,7 +212,7 @@ pub fn restore(
|
|||||||
flash: bool,
|
flash: bool,
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
let tmpdir = tempfile::Builder::new()
|
let tmpdir = tempfile::Builder::new()
|
||||||
.prefix("KernelSU")
|
.prefix("KernelSU-Next")
|
||||||
.tempdir()
|
.tempdir()
|
||||||
.context("create temp dir failed")?;
|
.context("create temp dir failed")?;
|
||||||
let workdir = tmpdir.path();
|
let workdir = tmpdir.path();
|
||||||
@@ -235,7 +235,7 @@ pub fn restore(
|
|||||||
ensure!(status.success(), "magiskboot unpack failed");
|
ensure!(status.success(), "magiskboot unpack failed");
|
||||||
|
|
||||||
let is_kernelsu_patched = is_kernelsu_patched(&magiskboot, workdir)?;
|
let is_kernelsu_patched = is_kernelsu_patched(&magiskboot, workdir)?;
|
||||||
ensure!(is_kernelsu_patched, "boot image is not patched by KernelSU");
|
ensure!(is_kernelsu_patched, "boot image is not patched by KernelSU-Next");
|
||||||
|
|
||||||
let mut new_boot = None;
|
let mut new_boot = None;
|
||||||
let mut from_backup = false;
|
let mut from_backup = false;
|
||||||
@@ -370,7 +370,7 @@ fn do_patch(
|
|||||||
}
|
}
|
||||||
|
|
||||||
let tmpdir = tempfile::Builder::new()
|
let tmpdir = tempfile::Builder::new()
|
||||||
.prefix("KernelSU")
|
.prefix("KernelSU-Next")
|
||||||
.tempdir()
|
.tempdir()
|
||||||
.context("create temp dir failed")?;
|
.context("create temp dir failed")?;
|
||||||
let workdir = tmpdir.path();
|
let workdir = tmpdir.path();
|
||||||
@@ -460,7 +460,7 @@ fn do_patch(
|
|||||||
"Cannot work with Magisk patched image"
|
"Cannot work with Magisk patched image"
|
||||||
);
|
);
|
||||||
|
|
||||||
println!("- Adding KernelSU LKM");
|
println!("- Adding KernelSU-Next LKM");
|
||||||
let is_kernelsu_patched = is_kernelsu_patched(&magiskboot, workdir)?;
|
let is_kernelsu_patched = is_kernelsu_patched(&magiskboot, workdir)?;
|
||||||
|
|
||||||
let mut need_backup = false;
|
let mut need_backup = false;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ use log::LevelFilter;
|
|||||||
use crate::defs::KSUD_VERBOSE_LOG_FILE;
|
use crate::defs::KSUD_VERBOSE_LOG_FILE;
|
||||||
use crate::{apk_sign, assets, debug, defs, init_event, ksucalls, module, utils};
|
use crate::{apk_sign, assets, debug, defs, init_event, ksucalls, module, utils};
|
||||||
|
|
||||||
/// KernelSU userspace cli
|
/// KernelSU-Next userspace cli
|
||||||
#[derive(Parser, Debug)]
|
#[derive(Parser, Debug)]
|
||||||
#[command(author, version = defs::VERSION_NAME, about, long_about = None)]
|
#[command(author, version = defs::VERSION_NAME, about, long_about = None)]
|
||||||
struct Args {
|
struct Args {
|
||||||
@@ -23,7 +23,7 @@ struct Args {
|
|||||||
|
|
||||||
#[derive(clap::Subcommand, Debug)]
|
#[derive(clap::Subcommand, Debug)]
|
||||||
enum Commands {
|
enum Commands {
|
||||||
/// Manage KernelSU modules
|
/// Manage KernelSU-Next modules
|
||||||
Module {
|
Module {
|
||||||
#[command(subcommand)]
|
#[command(subcommand)]
|
||||||
command: Module,
|
command: Module,
|
||||||
@@ -38,13 +38,13 @@ enum Commands {
|
|||||||
/// Trigger `boot-complete` event
|
/// Trigger `boot-complete` event
|
||||||
BootCompleted,
|
BootCompleted,
|
||||||
|
|
||||||
/// Install KernelSU userspace component to system
|
/// Install KernelSU-Next userspace component to system
|
||||||
Install {
|
Install {
|
||||||
#[arg(long, default_value = None)]
|
#[arg(long, default_value = None)]
|
||||||
magiskboot: Option<PathBuf>,
|
magiskboot: Option<PathBuf>,
|
||||||
},
|
},
|
||||||
|
|
||||||
/// Uninstall KernelSU modules and itself(LKM Only)
|
/// Uninstall KernelSU-Next modules and itself(LKM Only)
|
||||||
Uninstall {
|
Uninstall {
|
||||||
/// magiskboot path, if not specified, will search from $PATH
|
/// magiskboot path, if not specified, will search from $PATH
|
||||||
#[arg(long, default_value = None)]
|
#[arg(long, default_value = None)]
|
||||||
@@ -63,7 +63,7 @@ enum Commands {
|
|||||||
command: Profile,
|
command: Profile,
|
||||||
},
|
},
|
||||||
|
|
||||||
/// Patch boot or init_boot images to apply KernelSU
|
/// Patch boot or init_boot images to apply KernelSU-Next
|
||||||
BootPatch {
|
BootPatch {
|
||||||
/// boot image path, if not specified, will try to find the boot image automatically
|
/// boot image path, if not specified, will try to find the boot image automatically
|
||||||
#[arg(short, long)]
|
#[arg(short, long)]
|
||||||
@@ -102,7 +102,7 @@ enum Commands {
|
|||||||
kmi: Option<String>,
|
kmi: Option<String>,
|
||||||
},
|
},
|
||||||
|
|
||||||
/// Restore boot or init_boot images patched by KernelSU
|
/// Restore boot or init_boot images patched by KernelSU-Next
|
||||||
BootRestore {
|
BootRestore {
|
||||||
/// boot image path, if not specified, will try to find the boot image automatically
|
/// boot image path, if not specified, will try to find the boot image automatically
|
||||||
#[arg(short, long)]
|
#[arg(short, long)]
|
||||||
@@ -277,7 +277,7 @@ pub fn run() -> Result<()> {
|
|||||||
android_logger::init_once(
|
android_logger::init_once(
|
||||||
Config::default()
|
Config::default()
|
||||||
.with_max_level(LevelFilter::Trace) // limit log level
|
.with_max_level(LevelFilter::Trace) // limit log level
|
||||||
.with_tag("KernelSU"), // logs will show under mytag tag
|
.with_tag("KernelSU-Next"), // logs will show under mytag tag
|
||||||
);
|
);
|
||||||
|
|
||||||
#[cfg(not(target_os = "android"))]
|
#[cfg(not(target_os = "android"))]
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ pub fn grant_root(_global_mnt: bool) -> Result<()> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn print_usage(program: &str, opts: Options) {
|
fn print_usage(program: &str, opts: Options) {
|
||||||
let brief = format!("KernelSU Next\n\nUsage: {program} [options] [-] [user [argument...]]");
|
let brief = format!("KernelSU-Next\n\nUsage: {program} [options] [-] [user [argument...]]");
|
||||||
print!("{}", opts.usage(&brief));
|
print!("{}", opts.usage(&brief));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -154,7 +154,7 @@ pub fn root_shell() -> Result<()> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if matches.opt_present("v") {
|
if matches.opt_present("v") {
|
||||||
println!("{}:KernelSU", defs::VERSION_NAME);
|
println!("{}:KernelSU-Next", defs::VERSION_NAME);
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user