I was testing some c++ executable in my old smartphone (Android 8, no root). Here's the description of the problem:
I have both Termux and Cxxdroid installed in that phone. And in termux, I have clang installed.
Let's enter Termux.
cd /storage/emulated/0/c++ # current dir is now c++ which sits in the internal storage ls # this prints 'hello.cpp', a simple hello world program. let's compile it. clang++ hello.cxx -o hello ls # this prints two files now, hello and hello.cxx. let's execute hello. ./hello # prints: bash: ./hello: Permission denied. let's grant permission. chmod +x hello ./hello # prints: bash: ./hello: Permission denied
As you can see, there's no way I can execute hello in the c++ directory. I know that if I move hello in $HOME and run it, it would work right away. But that's not the case.
Now, let's enter Cxxdroid. Enter 'Terminal' from left menu. Let's execute our hello binary.
cd /storage/emulated/0/c++ ls # contains two files. hello.cxx and hello (which is the binary generated from Termux clang). let's run it. ./hello # prints 'Hello World'
See? The same binary does not run in Termux but runs right away in Cxxdroid. Why? What technique is Cxxdroid using under the hood? Permission of the hello binary for both Termux and Cxxdroid is:
ls -l hello # prints: -rw-rw---- 1 root everybody 115588 Apr 25 00:32 hello
Any help is appreciated.