kernel: precise trigger timing of post-fs-data (#118)
* kernel: add report_event cmd * ksud: report event * kernel: trigger on_post_fs_data * ksud: comment unused code * [skip ci] run clang-format Signed-off-by: Ylarod <me@ylarod.cn> * ci: use custom key to sign official bootimgs * format ksud * reject non root * remove Signed-off-by: Ylarod <me@ylarod.cn>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
use anyhow::Result;
|
||||
use anyhow::{Ok, Result};
|
||||
use clap::Parser;
|
||||
|
||||
use crate::{event, module, debug, apk_sign};
|
||||
use crate::{apk_sign, debug, event, module};
|
||||
|
||||
/// KernelSU userspace cli
|
||||
#[derive(Parser, Debug)]
|
||||
@@ -58,6 +58,9 @@ enum Debug {
|
||||
apk: String,
|
||||
},
|
||||
|
||||
/// Get kernel version
|
||||
Version,
|
||||
|
||||
/// For testing
|
||||
Test,
|
||||
}
|
||||
@@ -115,17 +118,19 @@ pub fn run() -> Result<()> {
|
||||
Commands::Sepolicy => todo!(),
|
||||
Commands::Services => event::on_services(),
|
||||
|
||||
Commands::Debug { command } => {
|
||||
match command {
|
||||
Debug::SetManager { apk } => debug::set_manager(&apk),
|
||||
Debug::GetSign { apk } => {
|
||||
let sign = apk_sign::get_apk_signature(&apk)?;
|
||||
println!("size: {:#x}, hash: {:#x}", sign.0, sign.1);
|
||||
Ok(())
|
||||
},
|
||||
Debug::Test => todo!(),
|
||||
Commands::Debug { command } => match command {
|
||||
Debug::SetManager { apk } => debug::set_manager(&apk),
|
||||
Debug::GetSign { apk } => {
|
||||
let sign = apk_sign::get_apk_signature(&apk)?;
|
||||
println!("size: {:#x}, hash: {:#x}", sign.0, sign.1);
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
Debug::Version => {
|
||||
println!("Kernel Version: {}", crate::ksu::get_version());
|
||||
Ok(())
|
||||
}
|
||||
Debug::Test => todo!(),
|
||||
},
|
||||
};
|
||||
|
||||
if let Err(e) = &result {
|
||||
|
||||
Reference in New Issue
Block a user