我的脚本有问题,很奇怪,我在终端中编写了下面的脚本,并且工作正常,但是当我尝试在我的应用程序中运行它时,就像开始运行然后手机重启一样,有什么想法吗? ?
String command = "pidof -s " + intent.getComponent().getPackageName() + " | kill -9 .";
Process su = Runtime.getRuntime().exec("su");
DataOutputStream os = new DataOutputStream(su.getOutputStream());
os.writeBytes(command + "\n");
os.flush();