Skip to content

Mimicking Termux Behavior #4564

Answered by twaik
mcondarelli asked this question in Q&A
Discussion options

You must be logged in to vote

Termux is obviously able to run random executables without requiring this.

Termux can run random executables because of targetSdkVersion=28. If you set higher targetSdkVersion android will block execution of W^X executables.
But if you are planning to use executables on sdcard you can simply build your nodejs version with -Wl,-rpath=$ORIGIN in LDFLAGS and put the main nodejs executable (renamed to libnodejs.so) and all libraries into lib/<abi> of your apk, allowing it to be executed as regular code after extracting.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by mcondarelli
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants