manager: allow hide susfs status information
Signed-off-by: WenHao2130 <WenHao2130@outlook.com>
This commit is contained in:
@@ -65,6 +65,7 @@ fun HomeScreen(navigator: DestinationsNavigator) {
|
|||||||
var isSimpleMode by rememberSaveable { mutableStateOf(false) }
|
var isSimpleMode by rememberSaveable { mutableStateOf(false) }
|
||||||
var isHideVersion by rememberSaveable { mutableStateOf(false) }
|
var isHideVersion by rememberSaveable { mutableStateOf(false) }
|
||||||
var isHideOtherInfo by rememberSaveable { mutableStateOf(false) }
|
var isHideOtherInfo by rememberSaveable { mutableStateOf(false) }
|
||||||
|
var isHideSusfsStatus by rememberSaveable { mutableStateOf(false) }
|
||||||
|
|
||||||
// 从 SharedPreferences 加载简洁模式状态
|
// 从 SharedPreferences 加载简洁模式状态
|
||||||
LaunchedEffect(Unit) {
|
LaunchedEffect(Unit) {
|
||||||
@@ -81,6 +82,11 @@ fun HomeScreen(navigator: DestinationsNavigator) {
|
|||||||
isHideOtherInfo = context.getSharedPreferences("settings", Context.MODE_PRIVATE)
|
isHideOtherInfo = context.getSharedPreferences("settings", Context.MODE_PRIVATE)
|
||||||
.getBoolean("is_hide_other_info", false)
|
.getBoolean("is_hide_other_info", false)
|
||||||
}
|
}
|
||||||
|
// 从 SharedPreferences 加载隐藏 SuSFS 状态开关状态
|
||||||
|
LaunchedEffect(Unit) {
|
||||||
|
isHideSusfsStatus = context.getSharedPreferences("settings", Context.MODE_PRIVATE)
|
||||||
|
.getBoolean("is_hide_susfs_status", false)
|
||||||
|
}
|
||||||
val kernelVersion = getKernelVersion()
|
val kernelVersion = getKernelVersion()
|
||||||
val scrollBehavior = TopAppBarDefaults.pinnedScrollBehavior(rememberTopAppBarState())
|
val scrollBehavior = TopAppBarDefaults.pinnedScrollBehavior(rememberTopAppBarState())
|
||||||
|
|
||||||
@@ -322,6 +328,9 @@ private fun StatusCard(
|
|||||||
val isHideOtherInfo = LocalContext.current.getSharedPreferences("settings", Context.MODE_PRIVATE)
|
val isHideOtherInfo = LocalContext.current.getSharedPreferences("settings", Context.MODE_PRIVATE)
|
||||||
.getBoolean("is_hide_other_info", false)
|
.getBoolean("is_hide_other_info", false)
|
||||||
|
|
||||||
|
val isHideSusfsStatus = LocalContext.current.getSharedPreferences("settings", Context.MODE_PRIVATE)
|
||||||
|
.getBoolean("is_hide_susfs_status", false)
|
||||||
|
|
||||||
Icon(Icons.Outlined.CheckCircle, stringResource(R.string.home_working))
|
Icon(Icons.Outlined.CheckCircle, stringResource(R.string.home_working))
|
||||||
Column(Modifier.padding(start = 20.dp)) {
|
Column(Modifier.padding(start = 20.dp)) {
|
||||||
Text(
|
Text(
|
||||||
@@ -356,7 +365,7 @@ private fun StatusCard(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!isHideSusfsStatus) {
|
||||||
Spacer(modifier = Modifier.height(4.dp))
|
Spacer(modifier = Modifier.height(4.dp))
|
||||||
|
|
||||||
val suSFS = getSuSFS()
|
val suSFS = getSuSFS()
|
||||||
@@ -374,6 +383,7 @@ private fun StatusCard(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
kernelVersion.isGKI() -> {
|
kernelVersion.isGKI() -> {
|
||||||
Icon(Icons.Outlined.Warning, stringResource(R.string.home_not_installed))
|
Icon(Icons.Outlined.Warning, stringResource(R.string.home_not_installed))
|
||||||
@@ -599,9 +609,10 @@ private fun InfoCard() {
|
|||||||
InfoCardItem(stringResource(R.string.home_kpm_version), displayVersion)
|
InfoCardItem(stringResource(R.string.home_kpm_version), displayVersion)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val isHideSusfsStatus = LocalContext.current.getSharedPreferences("settings", Context.MODE_PRIVATE)
|
||||||
|
.getBoolean("is_hide_susfs_status", false)
|
||||||
|
|
||||||
|
if ((!isSimpleMode) && (!isHideSusfsStatus)) {
|
||||||
if (!isSimpleMode) {
|
|
||||||
Spacer(modifier = Modifier.height(16.dp))
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
|
|
||||||
val suSFS = getSuSFS()
|
val suSFS = getSuSFS()
|
||||||
|
|||||||
@@ -128,6 +128,17 @@ fun MoreSettingsScreen(navigator: DestinationsNavigator) {
|
|||||||
isHideOtherInfo = newValue
|
isHideOtherInfo = newValue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 隐藏 SuSFS 状态开关状态
|
||||||
|
var isHideSusfsStatus by remember {
|
||||||
|
mutableStateOf(prefs.getBoolean("is_hide_susfs_status", false))
|
||||||
|
}
|
||||||
|
|
||||||
|
// 隐藏 SuSFS 状态开关状态
|
||||||
|
val onHideSusfsStatusChange = { newValue: Boolean ->
|
||||||
|
prefs.edit { putBoolean("is_hide_susfs_status", newValue) }
|
||||||
|
isHideSusfsStatus = newValue
|
||||||
|
}
|
||||||
|
|
||||||
// SELinux 状态
|
// SELinux 状态
|
||||||
var selinuxEnabled by remember {
|
var selinuxEnabled by remember {
|
||||||
mutableStateOf(Shell.cmd("getenforce").exec().out.firstOrNull() == "Enforcing")
|
mutableStateOf(Shell.cmd("getenforce").exec().out.firstOrNull() == "Enforcing")
|
||||||
@@ -274,6 +285,20 @@ fun MoreSettingsScreen(navigator: DestinationsNavigator) {
|
|||||||
onHideOtherInfoChange(it)
|
onHideOtherInfoChange(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
AnimatedVisibility(
|
||||||
|
visible = isExpanded,
|
||||||
|
modifier = Modifier.fillMaxWidth().padding(horizontal = 24.dp)
|
||||||
|
) {
|
||||||
|
// SuSFS 状态信息
|
||||||
|
SwitchItem(
|
||||||
|
icon = Icons.Filled.VisibilityOff,
|
||||||
|
title = stringResource(R.string.hide_susfs_status),
|
||||||
|
summary = stringResource(R.string.hide_susfs_status_summary),
|
||||||
|
checked = isHideSusfsStatus
|
||||||
|
) {
|
||||||
|
onHideSusfsStatusChange(it)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// region SUSFS 配置(仅在支持时显示)
|
// region SUSFS 配置(仅在支持时显示)
|
||||||
val suSFS = getSuSFS()
|
val suSFS = getSuSFS()
|
||||||
|
|||||||
@@ -193,6 +193,8 @@
|
|||||||
<string name="hide_kernel_kernelsu_version_summary">隐藏内核部分的 KernelSU 版本号</string>
|
<string name="hide_kernel_kernelsu_version_summary">隐藏内核部分的 KernelSU 版本号</string>
|
||||||
<string name="hide_other_info">强迫症开关</string>
|
<string name="hide_other_info">强迫症开关</string>
|
||||||
<string name="hide_other_info_summary">隐藏主页上的超级用户数、模块数和 KPM 模块数信息</string>
|
<string name="hide_other_info_summary">隐藏主页上的超级用户数、模块数和 KPM 模块数信息</string>
|
||||||
|
<string name="hide_susfs_status">隐藏 SuSFS 状态信息</string>
|
||||||
|
<string name="hide_susfs_status_summary">隐藏主页上的 SuSFS 状态信息</string>
|
||||||
<string name="theme_mode">主题模式</string>
|
<string name="theme_mode">主题模式</string>
|
||||||
<string name="theme_follow_system">跟随系统</string>
|
<string name="theme_follow_system">跟随系统</string>
|
||||||
<string name="theme_light">浅色</string>
|
<string name="theme_light">浅色</string>
|
||||||
|
|||||||
@@ -194,6 +194,8 @@
|
|||||||
<string name="hide_kernel_kernelsu_version_summary">Hide kernel version</string>
|
<string name="hide_kernel_kernelsu_version_summary">Hide kernel version</string>
|
||||||
<string name="hide_other_info">Hide other info</string>
|
<string name="hide_other_info">Hide other info</string>
|
||||||
<string name="hide_other_info_summary">Hides information about the number of super users, modules and KPM modules on the home page</string>
|
<string name="hide_other_info_summary">Hides information about the number of super users, modules and KPM modules on the home page</string>
|
||||||
|
<string name="hide_susfs_status">Hide SuSFS status</string>
|
||||||
|
<string name="hide_susfs_status_summary">Hide SuSFS status information on the home page</string>
|
||||||
<string name="theme_mode">Theme Mode</string>
|
<string name="theme_mode">Theme Mode</string>
|
||||||
<string name="theme_follow_system">follow-up system</string>
|
<string name="theme_follow_system">follow-up system</string>
|
||||||
<string name="theme_light">light color</string>
|
<string name="theme_light">light color</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user