manager: fixed "static field FLAG_REDIRECT_STDERR: Int' is deprecated"

This commit is contained in:
Rifat Azad
2025-01-20 13:26:08 +06:00
parent cf84dc8a32
commit cbe3ffe32a

View File

@@ -7,15 +7,13 @@ import com.rifsxd.ksunext.R
@Composable
fun getSELinuxStatus(): String {
val shell = Shell.Builder.create()
.setFlags(Shell.FLAG_REDIRECT_STDERR)
.build("sh")
val shell = Shell.getShell() // Get the default shell instance
val list = ArrayList<String>()
val result = shell.use {
it.newJob().add("getenforce").to(list, list).exec()
}
val output = result.out.joinToString("\n").trim()
val result = shell.newJob()
.add("getenforce")
.to(list, list)
.exec()
val output = list.joinToString("\n").trim()
if (result.isSuccess) {
return when (output) {