manager: Detect SuSFS support

This commit is contained in:
Rifat Azad
2024-12-22 02:54:20 +06:00
parent 996eac9c01
commit fd637d30cf
3 changed files with 39 additions and 0 deletions

View File

@@ -267,6 +267,11 @@ private fun StatusCard(
text = stringResource(R.string.home_module_count, getModuleCount()),
style = MaterialTheme.typography.bodyMedium
)
Spacer(Modifier.height(4.dp))
Text(
text = stringResource(R.string.home_susfs, getSuSFS()),
style = MaterialTheme.typography.bodyMedium
)
}
}
@@ -393,6 +398,16 @@ private fun InfoCard() {
content = getSELinuxStatus(),
icon = Icons.Filled.Security,
)
Spacer(Modifier.height(16.dp))
val suSfsStatus = getSuSFS()
if (suSfsStatus != "Unsupported") {
InfoCardItem(
label = stringResource(R.string.home_susfs_version),
content = getSuSFSVersion(),
icon = Icons.Filled.SettingsSuggest,
)
}
}
}
}

View File

@@ -120,6 +120,28 @@ fun getModuleCount(): Int {
}.getOrElse { return 0 }
}
fun getSuSFS(): String {
val shell = getRootShell()
val result = ShellUtils.fastCmd(shell, "dmesg | grep -i susfs")
return if (result.isNotBlank()) {
"Supported"
} else {
"Unsupported"
}
}
fun getSuSFSVersion(): String {
val shell = getRootShell()
val result = ShellUtils.fastCmd(shell, "su -c ksu_susfs show version")
return if (result.startsWith("v")) {
result
} else {
"Unavailable"
}
}
fun getSuperuserCount(): Int {
return Natives.allowList.size
}

View File

@@ -19,6 +19,8 @@
<string name="home_failure">KernelSU Next v2 signature not found in kernel! [ !KSU_NEXT || != size/hash ]</string>
<string name="home_failure_tip">Ask your kernel developer to integrate KernelSU Next!</string>
<string name="home_kernel">Kernel</string>
<string name="home_susfs">SuSFS: %s</string>
<string name="home_susfs_version">SuSFS</string>
<string name="home_android">Android</string>
<string name="home_manager_version">Manager</string>
<string name="home_selinux_status">SELinux</string>