File tree Expand file tree Collapse file tree
manager/app/src/main/java/me/weishu/kernelsu/ui/util Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -216,8 +216,6 @@ fun flashModule(
216216fun runModuleAction (
217217 moduleId : String , onStdout : (String ) -> Unit , onStderr : (String ) -> Unit
218218): Boolean {
219- val shell = createRootShell(true )
220-
221219 val stdoutCallback: CallbackList <String ?> = object : CallbackList <String ?>() {
222220 override fun onAddElement (s : String? ) {
223221 onStdout(s ? : " " )
@@ -230,8 +228,11 @@ fun runModuleAction(
230228 }
231229 }
232230
233- val result = shell.newJob().add(" ${getKsuDaemonPath()} module action $moduleId " )
234- .to(stdoutCallback, stderrCallback).exec()
231+ val result = withNewRootShell(true ) {
232+ newJob().add(" ${getKsuDaemonPath()} module action $moduleId " )
233+ .to(stdoutCallback, stderrCallback).exec()
234+ }
235+
235236 Log .i(" KernelSU" , " Module runAction result: $result " )
236237
237238 return result.isSuccess
You can’t perform that action at this time.
0 commit comments