Skip to content

Commit

Permalink
ksud: Remove more Dead code, so the compiler doesn't complain
Browse files Browse the repository at this point in the history
Signed-off-by: rsuntk <rissu.ntk@gmail.com>
  • Loading branch information
rsuntk committed Dec 10, 2024
1 parent ec39668 commit 1b771be
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 24 deletions.
20 changes: 1 addition & 19 deletions userspace/ksud/src/assets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use crate::{defs::BINARY_DIR, utils};

pub const RESETPROP_PATH: &str = concatcp!(BINARY_DIR, "resetprop");
pub const BUSYBOX_PATH: &str = concatcp!(BINARY_DIR, "busybox");
pub const BOOTCTL_PATH: &str = concatcp!(BINARY_DIR, "bootctl");

#[cfg(all(target_arch = "x86_64", target_os = "android"))]
#[derive(RustEmbed)]
Expand All @@ -30,21 +29,4 @@ pub fn ensure_binaries(ignore_if_exist: bool) -> Result<()> {
utils::ensure_binary(format!("{BINARY_DIR}{file}"), &asset.data, ignore_if_exist)?
}
Ok(())
}

pub fn copy_assets_to_file(name: &str, dst: impl AsRef<Path>) -> Result<()> {
let asset = Asset::get(name).ok_or(anyhow::anyhow!("asset not found: {}", name))?;
std::fs::write(dst, asset.data)?;
Ok(())
}

pub fn list_supported_kmi() -> Result<Vec<String>> {
let mut list = Vec::new();
for file in Asset::iter() {
// kmi_name = "xxx_kernelsu.ko"
if let Some(kmi) = file.strip_suffix("_kernelsu.ko") {
list.push(kmi.to_string());
}
}
Ok(list)
}
}
2 changes: 1 addition & 1 deletion userspace/ksud/src/cli.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use anyhow::{Ok, Result};
use clap::Parser;
use std::path::{Path, PathBuf};
use std::path::Path;

#[cfg(target_os = "android")]
use android_logger::Config;
Expand Down
4 changes: 0 additions & 4 deletions userspace/ksud/src/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -409,10 +409,6 @@ pub fn disable_all_modules() -> Result<()> {
mark_all_modules(defs::DISABLE_FILE_NAME)
}

pub fn uninstall_all_modules() -> Result<()> {
mark_all_modules(defs::REMOVE_FILE_NAME)
}

fn mark_all_modules(flag_file: &str) -> Result<()> {
let dir = std::fs::read_dir(MODULE_DIR)?;
for entry in dir.flatten() {
Expand Down

0 comments on commit 1b771be

Please sign in to comment.