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