manager: When the version is less than 13490, enable safe mode.
This commit is contained in:
@@ -157,6 +157,15 @@ fun HomeScreen(navigator: DestinationsNavigator) {
|
|||||||
stringResource(id = R.string.grant_root_failed)
|
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
|
@Preview
|
||||||
@Composable
|
@Composable
|
||||||
private fun WarningCardPreview() {
|
private fun WarningCardPreview() {
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ fun SettingScreen(navigator: DestinationsNavigator) {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
// UID 扫描开关
|
// 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)
|
UidScannerSection(prefs, snackBarHost, scope, context)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -721,4 +721,7 @@
|
|||||||
<!-- MiUI Uninstall Desc -->
|
<!-- MiUI Uninstall Desc -->
|
||||||
<string name="miui_uninstall_title">真要走?</string>
|
<string name="miui_uninstall_title">真要走?</string>
|
||||||
<string name="miui_uninstall_content">哼,卸就卸。Root 功能可不会因为失去区区一个管理器就停止运作。别担心,zakozako 只卸载管理器可干不掉 Root 呢,zako~❤️</string>
|
<string name="miui_uninstall_content">哼,卸就卸。Root 功能可不会因为失去区区一个管理器就停止运作。别担心,zakozako 只卸载管理器可干不掉 Root 呢,zako~❤️</string>
|
||||||
|
<string name="incompatible_kernel_msg">
|
||||||
|
当前管理器与此内核不兼容!请将内核升级至版本 %2$d 或以上(当前 %1$d)
|
||||||
|
</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -729,4 +729,6 @@ Important Note:\n
|
|||||||
<!-- MiUI Uninstall Desc -->
|
<!-- MiUI Uninstall Desc -->
|
||||||
<string name="miui_uninstall_title">Confirm Uninstallation SukiSU Manager?</string>
|
<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="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>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user