Run Script through Android app and prevent killing process

I have a script that is run from an android application via:

Process su = Runtime.getRuntime().exec("su");

DataOutputStream outputStream = new DataOutputStream(su.getOutputStream());

outputStream.writeBytes("sh /system/bin/androidtolinux.sh"+ "\n");
outputStream.flush();

outputStream.writeBytes ("\n\nexit\n");
outputStream.flush();

su.waitFor();

      

This works great, however part of the script stops zygote with:

setprop ctl.stop media & setprop ctl.stop zygote

      

After that, the application will be destroyed along with all the processes that it starts, including the process running the script.

SO my question is, how can I run my script through the application, but so that the scripting process is not killed as soon as it is executed setprop ctl.stop media & setprop ctl.stop zygote

.

+3
android


source to share


No one has answered this question yet

Check out similar questions:

2097
Is there a way to run Python on Android?
915
Running / installing / debugging Android apps over Wi-Fi?
890
How to check if a service is running on Android?
436
Building and running an application through Gradle and Android Studio is slower than through Eclipse
97
Android kills activity, kills processes
6
Android: child process (logcat) keeps running after parent process (app) dies
6
android runtime.getruntime (). exec () get process id
1
Executing a script through an Android application
1
Is it possible to execute a script in android when the user exits the application / kills the process?
0
Android: init.d script to monitor and kill a process



All Articles
Loading...
X
Show
Funny
Dev
Pics