You've already forked KernelSU-Next
mirror of
https://github.com/KernelSU-Next/KernelSU-Next.git
synced 2025-08-27 23:46:34 +00:00
manager: fixed "static field FLAG_REDIRECT_STDERR: Int' is deprecated"
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user