manager: disabled KMI/LKM installation

manager: check if overlayfs is available to allow mount system switching
ksud: disabled KMI/LKM commands
ci: disabled LKM build workflow
ksud: removed ksuinit
This commit is contained in:
rifsxd
2025-05-01 15:58:18 +06:00
parent 4f35240203
commit 1336996129
9 changed files with 135 additions and 134 deletions

View File

@@ -19,12 +19,12 @@ on:
workflow_dispatch:
jobs:
build-lkm:
uses: ./.github/workflows/build-lkm.yml
secrets: inherit
# build-lkm:
# uses: ./.github/workflows/build-lkm.yml
# secrets: inherit
build-susfsd:
needs: build-lkm
# needs: build-lkm // DISBAND LKM MODE
strategy:
matrix:
include:

View File

@@ -19,12 +19,12 @@ on:
workflow_dispatch:
jobs:
build-lkm:
uses: ./.github/workflows/build-lkm.yml
secrets: inherit
# build-lkm:
# uses: ./.github/workflows/build-lkm.yml
# secrets: inherit // DISBAND LKM MODE
build-susfsd:
needs: build-lkm
# needs: build-lkm
strategy:
matrix:
include:

View File

@@ -34,7 +34,7 @@ import androidx.compose.ui.unit.dp
import androidx.core.content.pm.PackageInfoCompat
import com.ramcosta.composedestinations.annotation.Destination
import com.ramcosta.composedestinations.annotation.RootGraph
import com.ramcosta.composedestinations.generated.destinations.InstallScreenDestination
// import com.ramcosta.composedestinations.generated.destinations.InstallScreenDestination // DISBAND LKM MODE
import com.ramcosta.composedestinations.navigation.DestinationsNavigator
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
@@ -60,9 +60,9 @@ fun HomeScreen(navigator: DestinationsNavigator) {
TopBar(
kernelVersion,
ksuVersion,
onInstallClick = {
navigator.navigate(InstallScreenDestination)
},
// onInstallClick = {
// navigator.navigate(InstallScreenDestination)
// }, // DISBAND LKM MODE
scrollBehavior = scrollBehavior
)
},
@@ -81,7 +81,7 @@ fun HomeScreen(navigator: DestinationsNavigator) {
}
StatusCard(kernelVersion, ksuVersion, lkmMode) {
navigator.navigate(InstallScreenDestination)
// navigator.navigate(InstallScreenDestination) // DISBAND LKM MODE
}
if (isManager && Natives.requireNewKernel()) {
WarningCard(
@@ -167,20 +167,20 @@ fun RebootDropdownItem(@StringRes id: Int, reason: String = "") {
private fun TopBar(
kernelVersion: KernelVersion,
ksuVersion: Int?,
onInstallClick: () -> Unit,
// onInstallClick: () -> Unit, // DISBAND LKM MODE
scrollBehavior: TopAppBarScrollBehavior? = null
) {
TopAppBar(
title = { Text(stringResource(R.string.app_name)) },
actions = {
if (kernelVersion.isGKI()) {
IconButton(onClick = onInstallClick) {
Icon(
imageVector = Icons.Filled.Archive,
contentDescription = stringResource(id = R.string.install)
)
}
}
// if (kernelVersion.isGKI()) {
// IconButton(onClick = onInstallClick) {
// Icon(
// imageVector = Icons.Filled.Archive,
// contentDescription = stringResource(id = R.string.install)
// )
// }
// } // DISBAND LKM MODE
if (ksuVersion != null) {
var showDropdown by remember { mutableStateOf(false) }

View File

@@ -228,7 +228,9 @@ fun SettingScreen(navigator: DestinationsNavigator) {
var showRebootDialog by remember { mutableStateOf(false) }
if (ksuVersion != null) {
val isOverlayAvailable = overlayFsAvailable()
if (ksuVersion != null && isOverlayAvailable) {
SwitchItem(
icon = Icons.Filled.Build,
title = stringResource(id = R.string.use_overlay_fs),
@@ -336,23 +338,7 @@ fun SettingScreen(navigator: DestinationsNavigator) {
}
}
if (ksuVersion != null) {
val backupRestore = stringResource(id = R.string.backup_restore)
ListItem(
leadingContent = {
Icon(
Icons.Filled.Backup,
backupRestore
)
},
headlineContent = { Text(backupRestore) },
modifier = Modifier.clickable {
navigator.navigate(BackupRestoreScreenDestination)
}
)
}
if (useOverlayFs) {
if (isOverlayAvailable && useOverlayFs) {
val shrink = stringResource(id = R.string.shrink_sparse_image)
val shrinkMessage = stringResource(id = R.string.shrink_sparse_image_message)
ListItem(
@@ -376,6 +362,21 @@ fun SettingScreen(navigator: DestinationsNavigator) {
)
}
if (ksuVersion != null) {
val backupRestore = stringResource(id = R.string.backup_restore)
ListItem(
leadingContent = {
Icon(
Icons.Filled.Backup,
backupRestore
)
},
headlineContent = { Text(backupRestore) },
modifier = Modifier.clickable {
navigator.navigate(BackupRestoreScreenDestination)
}
)
}
val lkmMode = Natives.version >= Natives.MINIMAL_SUPPORTED_KERNEL_LKM && Natives.isLkmMode
if (lkmMode) {

0
manager/gradlew vendored Normal file → Executable file
View File

View File

@@ -38,11 +38,11 @@ enum Commands {
/// Trigger `boot-complete` event
BootCompleted,
/// Install KernelSU Next userspace component to system
Install {
#[arg(long, default_value = None)]
magiskboot: Option<PathBuf>,
},
// /// Install KernelSU Next userspace component to system
// Install {
// #[arg(long, default_value = None)]
// magiskboot: Option<PathBuf>,
// }, // DISBAND LKM MODE
/// Uninstall KernelSU Next modules and itself(LKM Only)
Uninstall {
@@ -63,44 +63,44 @@ enum Commands {
command: Profile,
},
/// Patch boot or init_boot images to apply KernelSU Next
BootPatch {
/// boot image path, if not specified, will try to find the boot image automatically
#[arg(short, long)]
boot: Option<PathBuf>,
// /// Patch boot or init_boot images to apply KernelSU Next
// BootPatch {
// /// boot image path, if not specified, will try to find the boot image automatically
// #[arg(short, long)]
// boot: Option<PathBuf>,
/// kernel image path to replace
#[arg(short, long)]
kernel: Option<PathBuf>,
// /// kernel image path to replace
// #[arg(short, long)]
// kernel: Option<PathBuf>,
/// LKM module path to replace, if not specified, will use the builtin one
#[arg(short, long)]
module: Option<PathBuf>,
// /// LKM module path to replace, if not specified, will use the builtin one
// #[arg(short, long)]
// module: Option<PathBuf>,
/// init to be replaced
#[arg(short, long, requires("module"))]
init: Option<PathBuf>,
// /// init to be replaced
// #[arg(short, long, requires("module"))]
// init: Option<PathBuf>,
/// will use another slot when boot image is not specified
#[arg(short = 'u', long, default_value = "false")]
ota: bool,
// /// will use another slot when boot image is not specified
// #[arg(short = 'u', long, default_value = "false")]
// ota: bool,
/// Flash it to boot partition after patch
#[arg(short, long, default_value = "false")]
flash: bool,
// /// Flash it to boot partition after patch
// #[arg(short, long, default_value = "false")]
// flash: bool,
/// output path, if not specified, will use current directory
#[arg(short, long, default_value = None)]
out: Option<PathBuf>,
// /// output path, if not specified, will use current directory
// #[arg(short, long, default_value = None)]
// out: Option<PathBuf>,
/// magiskboot path, if not specified, will search from $PATH
#[arg(long, default_value = None)]
magiskboot: Option<PathBuf>,
// /// magiskboot path, if not specified, will search from $PATH
// #[arg(long, default_value = None)]
// magiskboot: Option<PathBuf>,
/// KMI version, if specified, will use the specified KMI
#[arg(long, default_value = None)]
kmi: Option<String>,
},
// /// KMI version, if specified, will use the specified KMI
// #[arg(long, default_value = None)]
// kmi: Option<String>,
// },
/// Restore boot or init_boot images patched by KernelSU Next
BootRestore {
@@ -320,7 +320,7 @@ pub fn run() -> Result<()> {
Module::List => module::list_modules(),
}
}
Commands::Install { magiskboot } => utils::install(magiskboot),
// Commands::Install { magiskboot } => utils::install(magiskboot), // DISBAND LKM MODE
Commands::Uninstall { magiskboot } => utils::uninstall(magiskboot),
Commands::Sepolicy { command } => match command {
Sepolicy::Patch { sepolicy } => crate::sepolicy::live_patch(&sepolicy),
@@ -355,17 +355,17 @@ pub fn run() -> Result<()> {
Debug::Test => assets::ensure_binaries(false),
},
Commands::BootPatch {
boot,
init,
kernel,
module,
ota,
flash,
out,
magiskboot,
kmi,
} => crate::boot_patch::patch(boot, kernel, module, init, ota, flash, out, magiskboot, kmi),
// Commands::BootPatch {
// boot,
// init,
// kernel,
// module,
// ota,
// flash,
// out,
// magiskboot,
// kmi,
// } => crate::boot_patch::patch(boot, kernel, module, init, ota, flash, out, magiskboot, kmi), // DISBAND LKM MODE
Commands::BootInfo { command } => match command {
BootInfo::CurrentKmi => {

View File

@@ -34,11 +34,11 @@ enum Commands {
/// Trigger `boot-complete` event
BootCompleted,
/// Install KernelSU Next userspace component to system
Install {
#[arg(long, default_value = None)]
magiskboot: Option<PathBuf>,
},
// /// Install KernelSU Next userspace component to system
// Install {
// #[arg(long, default_value = None)]
// magiskboot: Option<PathBuf>,
// }, // DISBAND LKM MODE
/// Uninstall KernelSU Next modules and itself(LKM Only)
Uninstall {
@@ -59,44 +59,44 @@ enum Commands {
command: Profile,
},
/// Patch boot or init_boot images to apply KernelSU Next
BootPatch {
/// boot image path, if not specified, will try to find the boot image automatically
#[arg(short, long)]
boot: Option<PathBuf>,
// /// Patch boot or init_boot images to apply KernelSU Next
// BootPatch {
// /// boot image path, if not specified, will try to find the boot image automatically
// #[arg(short, long)]
// boot: Option<PathBuf>,
/// kernel image path to replace
#[arg(short, long)]
kernel: Option<PathBuf>,
// /// kernel image path to replace
// #[arg(short, long)]
// kernel: Option<PathBuf>,
/// LKM module path to replace, if not specified, will use the builtin one
#[arg(short, long)]
module: Option<PathBuf>,
// /// LKM module path to replace, if not specified, will use the builtin one
// #[arg(short, long)]
// module: Option<PathBuf>,
/// init to be replaced
#[arg(short, long, requires("module"))]
init: Option<PathBuf>,
// /// init to be replaced
// #[arg(short, long, requires("module"))]
// init: Option<PathBuf>,
/// will use another slot when boot image is not specified
#[arg(short = 'u', long, default_value = "false")]
ota: bool,
// /// will use another slot when boot image is not specified
// #[arg(short = 'u', long, default_value = "false")]
// ota: bool,
/// Flash it to boot partition after patch
#[arg(short, long, default_value = "false")]
flash: bool,
// /// Flash it to boot partition after patch
// #[arg(short, long, default_value = "false")]
// flash: bool,
/// output path, if not specified, will use current directory
#[arg(short, long, default_value = None)]
out: Option<PathBuf>,
// /// output path, if not specified, will use current directory
// #[arg(short, long, default_value = None)]
// out: Option<PathBuf>,
/// magiskboot path, if not specified, will search from $PATH
#[arg(long, default_value = None)]
magiskboot: Option<PathBuf>,
// /// magiskboot path, if not specified, will search from $PATH
// #[arg(long, default_value = None)]
// magiskboot: Option<PathBuf>,
/// KMI version, if specified, will use the specified KMI
#[arg(long, default_value = None)]
kmi: Option<String>,
},
// /// KMI version, if specified, will use the specified KMI
// #[arg(long, default_value = None)]
// kmi: Option<String>,
// }, // DISBAND LKM MODE
/// Restore boot or init_boot images patched by KernelSU Next
BootRestore {
@@ -327,7 +327,7 @@ pub fn run() -> Result<()> {
Module::Shrink => module::shrink_ksu_images(),
}
}
Commands::Install { magiskboot } => utils::install(magiskboot),
// Commands::Install { magiskboot } => utils::install(magiskboot), // DISBAND LKM MODE
Commands::Uninstall { magiskboot } => utils::uninstall(magiskboot),
Commands::Sepolicy { command } => match command {
Sepolicy::Patch { sepolicy } => crate::sepolicy::live_patch(&sepolicy),
@@ -370,17 +370,17 @@ pub fn run() -> Result<()> {
Debug::Test => assets::ensure_binaries(false),
},
Commands::BootPatch {
boot,
init,
kernel,
module,
ota,
flash,
out,
magiskboot,
kmi,
} => crate::boot_patch::patch(boot, kernel, module, init, ota, flash, out, magiskboot, kmi),
// Commands::BootPatch {
// boot,
// init,
// kernel,
// module,
// ota,
// flash,
// out,
// magiskboot,
// kmi,
// } => crate::boot_patch::patch(boot, kernel, module, init, ota, flash, out, magiskboot, kmi), // DISBAND LKM MODE
Commands::BootInfo { command } => match command {
BootInfo::CurrentKmi => {