manager: When the version is less than 13490, enable safe mode.

This commit is contained in:
ShirkNeko
2025-11-04 11:16:42 +08:00
parent 1853d9decf
commit 22e4b69231
4 changed files with 32 additions and 1 deletions

View File

@@ -157,6 +157,15 @@ fun HomeScreen(navigator: DestinationsNavigator) {
stringResource(id = R.string.grant_root_failed)
)
}
// 只有在没有其他警告信息时才显示不兼容内核警告
val shouldShowWarnings = viewModel.systemStatus.requireNewKernel ||
(viewModel.systemStatus.ksuVersion != null && !viewModel.systemStatus.isRootAvailable)
if (Natives.version >= Natives.MINIMAL_NEW_IOCTL_KERNEL && !shouldShowWarnings) {
IncompatibleKernelCard()
Spacer(Modifier.height(12.dp))
}
}
// 更新检查
@@ -891,6 +900,23 @@ private fun StatusCardPreview() {
}
}
@Composable
private fun IncompatibleKernelCard() {
val currentKver = remember { Natives.version }
val threshold = Natives.MINIMAL_NEW_IOCTL_KERNEL
val msg = stringResource(
id = R.string.incompatible_kernel_msg,
currentKver,
threshold
)
WarningCard(
message = msg,
color = MaterialTheme.colorScheme.error
)
}
@Preview
@Composable
private fun WarningCardPreview() {

View File

@@ -203,7 +203,7 @@ fun SettingScreen(navigator: DestinationsNavigator) {
}
)
// UID 扫描开关
if (Natives.version >= Natives.MINIMAL_SUPPORTED_UID_SCANNER) {
if (Natives.version >= Natives.MINIMAL_SUPPORTED_UID_SCANNER && Natives.version >= Natives.MINIMAL_NEW_IOCTL_KERNEL) {
UidScannerSection(prefs, snackBarHost, scope, context)
}
}

View File

@@ -721,4 +721,7 @@
<!-- MiUI Uninstall Desc -->
<string name="miui_uninstall_title">真要走?</string>
<string name="miui_uninstall_content">卸就卸。Root 功能可不会因为失去区区一个管理器就停止运作。别担心zakozako 只卸载管理器可干不掉 Root 呢zako~❤️</string>
<string name="incompatible_kernel_msg">
当前管理器与此内核不兼容!请将内核升级至版本 %2$d 或以上(当前 %1$d
</string>
</resources>

View File

@@ -729,4 +729,6 @@ Important Note:\n
<!-- MiUI Uninstall Desc -->
<string name="miui_uninstall_title">Confirm Uninstallation SukiSU Manager?</string>
<string name="miui_uninstall_content">Proceeding with the uninstallation will not affect the core functionality of your root access. The root is designed to operate independently of this manager.</string>
<string name="incompatible_kernel_msg">
The current manager is incompatible with this kernel! Please upgrade the kernel to version %2$d or higher (currently %1$d)
</resources>