I’m trying to execute an ARM executable
in my android app without root permission to read & write commands.
I tried a solution but it failed because of Behavioural changes (API 29+)
I want to also read and write commands in the program, so both InputStream
and OutputStream
will be required
I tried to execute a Hello world
program written in c++ and compiled in Ubuntu 22.04
It works in Java natively in Ubuntu with just, but fails to give any error/output in Android with the command chmod -R 777 full_executable_path
Since the environment was different, I tried executing an ARM specific executable in my app
But there was no output, and if I tried to pass any command through OutputStreamWriter
it shows this error:
java.io.IOException: write failed: EPIPE (Broken pipe)
at libcore.io.IoBridge.write(IoBridge.java:540)
at java.io.FileOutputStream.write(FileOutputStream.java:398)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:297)
...
When I searched for this problem I found an answer which said I need root permission
Is there any correct way to do this without root?
Any help would be appreciated!
Thanks!