kernel: Allow to re-enable sucompat

This commit is contained in:
weishu
2025-02-16 21:33:26 +08:00
parent 9bb39ff760
commit 4593ae81c7
2 changed files with 45 additions and 39 deletions

View File

@@ -181,7 +181,6 @@ fun SettingScreen(navigator: DestinationsNavigator) {
title = stringResource(id = R.string.settings_disable_su),
summary = stringResource(id = R.string.settings_disable_su_summary),
checked = isSuDisabled,
enabled = !isSuDisabled // we can't re-enable su if it's disabled.
) { checked ->
val shouldEnable = !checked
if (Natives.setSuEnabled(shouldEnable)) {
@@ -502,4 +501,4 @@ private fun TopBar(
@Composable
private fun SettingsPreview() {
SettingScreen(EmptyDestinationsNavigator)
}
}