manager: improved mount system info fetching logic

This commit is contained in:
rifsxd
2025-04-02 15:45:20 +06:00
parent 02dbb7d0f7
commit 5cec5aa656
19 changed files with 28 additions and 24 deletions
@@ -446,15 +446,11 @@ private fun InfoCard() {
Spacer(Modifier.height(16.dp))
InfoCardItem(
label = stringResource(R.string.home_module_mount),
content = when {
ksuVersion == null -> stringResource(R.string.unavailable)
useOverlayFs -> stringResource(R.string.home_overlayfs_mount)
else -> stringResource(R.string.home_magic_mount)
},
label = stringResource(R.string.home_mount_system),
content = currentMountSystem().ifEmpty { stringResource(R.string.unavailable) },
icon = Icons.Filled.SettingsSuggest,
)
Spacer(Modifier.height(16.dp))
val suSFS = getSuSFS()
if (suSFS == "Supported") {
val isSUS_SU = getSuSFSFeatures() == "CONFIG_KSU_SUSFS_SUS_SU"
@@ -463,6 +459,7 @@ private fun InfoCard() {
val modeString = if (mode == "2") stringResource(R.string.enabled) else stringResource(R.string.disabled)
"| SuS SU: $modeString"
} else ""
Spacer(Modifier.height(16.dp))
InfoCardItem(
label = stringResource(R.string.home_susfs_version),
content = "${getSuSFSVersion()} (${getSuSFSVariant()}) $susSUMode",
@@ -600,6 +600,13 @@ fun susfsSUS_SU_Mode(): String {
return result
}
fun currentMountSystem(): String {
val shell = getRootShell()
val cmd = "module mount"
val result = ShellUtils.fastCmd(shell, "${getKsuDaemonPath()} $cmd").trim()
return result.substringAfter(":").substringAfter(" ").trim()
}
fun setAppProfileTemplate(id: String, template: String): Boolean {
val shell = getRootShell()
val escapedTemplate = template.replace("\"", "\\\"")