This commit is contained in:
parent
0e252b3751
commit
0239820321
|
@ -20,6 +20,8 @@ import com.android.grape.util.ScriptUtil
|
|||
import com.android.grape.util.ShellUtils
|
||||
import com.android.grape.util.StoragePermissionHelper
|
||||
import com.android.grape.util.Util
|
||||
import com.android.grape.util.Util.AUTO_JSPACKAGENAME
|
||||
import com.android.grape.util.Util.killRecordProcess
|
||||
|
||||
class MainActivity : AppCompatActivity() {
|
||||
private val viewModel by viewModels<MainViewModel>()
|
||||
|
@ -42,8 +44,7 @@ class MainActivity : AppCompatActivity() {
|
|||
MonitorService.onEvent(MainApplication.instance)
|
||||
}
|
||||
viewBinding.stop.setOnClickListener {
|
||||
val isRoot = ShellUtils.hasRootAccess()
|
||||
Log.d("TAG", "onCreate: isRoot $isRoot")
|
||||
killRecordProcess(this, packageName)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -103,10 +103,10 @@ public class ShellUtils {
|
|||
|
||||
public static String execRootCmdAndGetResult(String cmd) {
|
||||
Log.d("ShellUtils", "execRootCmdAndGetResult - Started execution for command: " + cmd);
|
||||
if (!isCommandSafe(cmd)) { // 检查命令的合法性
|
||||
Log.e("ShellUtils", "Detected unsafe command. Aborting execution.");
|
||||
throw new IllegalArgumentException("Detected unsafe command.");
|
||||
}
|
||||
// if (!isCommandSafe(cmd)) { // 检查命令的合法性
|
||||
// Log.e("ShellUtils", "Detected unsafe command. Aborting execution.");
|
||||
// throw new IllegalArgumentException("Detected unsafe command.");
|
||||
// }
|
||||
|
||||
Process process = null;
|
||||
ExecutorService executor = Executors.newFixedThreadPool(2);
|
||||
|
|
Loading…
Reference in New Issue