Android - Kill App from another App (on a rooted device)

前端 未结 1 1711
一整个雨季
一整个雨季 2021-02-11 01:01

I have a rooted Android device. At one point I launch a secondary application from my primary application like so:

Intent intent = getPackageManager().getLaunchI         


        
相关标签:
1条回答
  • 2021-02-11 01:28

    Found a solution:

    Process suProcess = Runtime.getRuntime().exec("su");
    DataOutputStream os = new DataOutputStream(suProcess.getOutputStream());
    
    os.writeBytes("adb shell" + "\n");
    
    os.flush();
    
    os.writeBytes("am force-stop com.xxxxxx" + "\n");
    
    os.flush();
    
    0 讨论(0)
提交回复
热议问题