From 99d58c8cfddac4d4d95fa0a11a021fc88f0075b1 Mon Sep 17 00:00:00 2001 From: ShirkNeko <109797057+ShirkNeko@users.noreply.github.com> Date: Tue, 18 Nov 2025 00:34:19 +0800 Subject: [PATCH] manager: Only display the option to use LKM files when the kernel version is greater than 5.10 --- .../com/sukisu/ultra/ui/screen/Install.kt | 62 ++++++++++--------- 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/manager/app/src/main/java/com/sukisu/ultra/ui/screen/Install.kt b/manager/app/src/main/java/com/sukisu/ultra/ui/screen/Install.kt index 15aa0781..5b04b89d 100644 --- a/manager/app/src/main/java/com/sukisu/ultra/ui/screen/Install.kt +++ b/manager/app/src/main/java/com/sukisu/ultra/ui/screen/Install.kt @@ -353,38 +353,40 @@ fun InstallScreen( .fillMaxWidth() .padding(16.dp) ) { - // 使用本地的LKM文件 - ElevatedCard( - colors = getCardColors(MaterialTheme.colorScheme.surfaceVariant), - elevation = getCardElevation(), - modifier = Modifier - .fillMaxWidth() - .padding(bottom = 12.dp), - ) { - ListItem( - headlineContent = { - Text(stringResource(id = R.string.install_upload_lkm_file)) - }, - supportingContent = { - (lkmSelection as? LkmSelection.LkmUri)?.let { - Text( - stringResource( - id = R.string.selected_lkm, - it.uri.lastPathSegment ?: "(file)" - ) - ) - } - }, - leadingContent = { - Icon( - Icons.AutoMirrored.Filled.Input, - contentDescription = null - ) - }, + if (isGKI) { + // 使用本地的LKM文件 + ElevatedCard( + colors = getCardColors(MaterialTheme.colorScheme.surfaceVariant), + elevation = getCardElevation(), modifier = Modifier .fillMaxWidth() - .clickable { onLkmUpload() } - ) + .padding(bottom = 12.dp), + ) { + ListItem( + headlineContent = { + Text(stringResource(id = R.string.install_upload_lkm_file)) + }, + supportingContent = { + (lkmSelection as? LkmSelection.LkmUri)?.let { + Text( + stringResource( + id = R.string.selected_lkm, + it.uri.lastPathSegment ?: "(file)" + ) + ) + } + }, + leadingContent = { + Icon( + Icons.AutoMirrored.Filled.Input, + contentDescription = null + ) + }, + modifier = Modifier + .fillMaxWidth() + .clickable { onLkmUpload() } + ) + } } (installMethod as? InstallMethod.HorizonKernel)?.let { method ->