Skip to content

Added Executor#1337

Closed
RohitKushvaha01 wants to merge 12 commits intoAcode-Foundation:mainfrom
RohitKushvaha01:executor
Closed

Added Executor#1337
RohitKushvaha01 wants to merge 12 commits intoAcode-Foundation:mainfrom
RohitKushvaha01:executor

Conversation

@RohitKushvaha01
Copy link
Member

This PR adds an Executor plugin that allows executing shell commands in Acode without requiring Termux.

Example usage:

Executor.exec(
    "echo hello",
    (stdout) => {
        console.log("Executor output: " + stdout);
    },
    (error) => {
        console.warn("Executor error: " + error);
    }
);

⚠️ Limitations

  1. No W^X support:
    Starting from Android 9, files with both write and execute permissions (W^X) are no longer allowed. As a result, binary files in internal storage cannot be executed directly.

    • Workaround: You can use /system/bin/linker or /system/bin/linker64 to load and execute non-static binaries, but this only works if the binary is outside internal storage and is dynamically linked.
  2. Shells are not fully supported:
    You can execute shell scripts using shell interpreters (like sh or bash), but do not execute the shell directly (e.g., just "sh"), as it will hang. shells remain active and wait for input until explicitly terminated via Ctrl+C or a kill signal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants