I try to run python application on Android in my application.
This script work correct in Better Terminal Emulator Pro
su
busybox chroot /data/local/debian /bin/bash
/usr/bin/python /usr/src/script.py
Then I enter value
>>value1
result
But if I tried it in my app that:
String line;
Runtime.getRuntime().exec("su");
Runtime.getRuntime().exec("busybox chroot /data/local/debpsla /bin/bash");
Process proc = Runtime.getRuntime().exec("ls");
OutputStreamWriter osw = new OutputStreamWriter(proc.getOutputStream());
proc.waitFor();
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(proc.getInputStream()));
while ((line = bufferedReader.readLine()) != null){
publishProgress(line);
}
Command ls return not right list of files. This means that root directory don't changed.
What I do incorrect?
Thanks!