manager: Set up in real time using the correct method
This commit is contained in:
@@ -79,6 +79,7 @@ fun SettingScreen(navigator: DestinationsNavigator) {
|
||||
val snackBarHost = LocalSnackbarHost.current
|
||||
val context = LocalContext.current
|
||||
val prefs = context.getSharedPreferences("settings", Context.MODE_PRIVATE)
|
||||
var isSuLogEnabled by remember { mutableStateOf(Natives.isSuLogEnabled()) }
|
||||
var selectedEngine by rememberSaveable {
|
||||
mutableStateOf(
|
||||
prefs.getString("webui_engine", "default") ?: "default"
|
||||
@@ -280,7 +281,7 @@ fun SettingScreen(navigator: DestinationsNavigator) {
|
||||
)
|
||||
}
|
||||
SuperDropdown(
|
||||
icon = Icons.Rounded.RemoveCircle,
|
||||
icon = Icons.Filled.NoAccounts,
|
||||
title = stringResource(id = R.string.settings_disable_sulog),
|
||||
summary = stringResource(id = R.string.settings_disable_sulog_summary),
|
||||
items = modeItems,
|
||||
@@ -292,6 +293,7 @@ fun SettingScreen(navigator: DestinationsNavigator) {
|
||||
execKsud("feature save", true)
|
||||
prefs.edit { putInt("kernel_sulog_mode", 0) }
|
||||
kernelSuLogMode = 0
|
||||
isSuLogEnabled = true
|
||||
}
|
||||
|
||||
// Temporarily disable: save enabled state first, then disable
|
||||
@@ -300,6 +302,7 @@ fun SettingScreen(navigator: DestinationsNavigator) {
|
||||
if (Natives.setSuLogEnabled(false)) {
|
||||
prefs.edit { putInt("kernel_sulog_mode", 0) }
|
||||
kernelSuLogMode = 1
|
||||
isSuLogEnabled = false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -308,6 +311,7 @@ fun SettingScreen(navigator: DestinationsNavigator) {
|
||||
execKsud("feature save", true)
|
||||
prefs.edit { putInt("kernel_sulog_mode", 2) }
|
||||
kernelSuLogMode = 2
|
||||
isSuLogEnabled = false
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -445,7 +449,7 @@ fun SettingScreen(navigator: DestinationsNavigator) {
|
||||
|
||||
// 查看使用日志
|
||||
KsuIsValid {
|
||||
if (Natives.isSuLogEnabled()) {
|
||||
if (isSuLogEnabled) {
|
||||
SettingItem(
|
||||
icon = Icons.Filled.Visibility,
|
||||
title = stringResource(R.string.log_viewer_view_logs),
|
||||
|
||||
@@ -751,6 +751,6 @@
|
||||
<string name="apply_config">应用配置</string>
|
||||
<string name="config_applied">配置已应用到内核</string>
|
||||
<string name="group_contains_apps">包含 %1$d 个应用</string>
|
||||
<string name="settings_disable_sulog">禁用 KernelSU 超级用户访问日志记录</string>
|
||||
<string name="settings_disable_sulog_summary">禁用超级用户日志记录功能</string>
|
||||
<string name="settings_disable_sulog"> 禁用超级用户日志 </string>
|
||||
<string name="settings_disable_sulog_summary">禁用 KernelSU 超级用户访问记录</string>
|
||||
</resources>
|
||||
|
||||
@@ -761,6 +761,6 @@ Important Note:\n
|
||||
<string name="config_applied">Configuration applied to kernel</string>
|
||||
<string name="mnt_detach">MNT_DETACH</string>
|
||||
<string name="group_contains_apps">Contains %d apps</string>
|
||||
<string name="settings_disable_sulog">Disable KernelSU superuser access logging</string>
|
||||
<string name="settings_disable_sulog_summary">Disable superuser logging functionality</string>
|
||||
<string name="settings_disable_sulog">Disable superuser logging</string>
|
||||
<string name="settings_disable_sulog_summary">Disable KernelSU superuser access logging</string>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user