how can I run Delta_plugin without getting error=13, Permission denied?

I’m using this bit of code and for now it’s setup as a text input just for testing. Actual command will be hard coded.

I can run commands like “ls” and it will show that the file is there but no matter what I do I can’t run it using “./delta_plugin”

The command would look like this “./delta_plugin /storage/emulated/0/omw/mods/”

private fun shellExec(cmd: String?, workingDir: String? = null): String {
    var output = ""
    try {
        val processBuilder = ProcessBuilder()
        if (workingDir != null) {
            processBuilder.directory(File(workingDir))
        }
        processBuilder.command(cmd)
        val process = processBuilder.start()

        val reader = BufferedReader(InputStreamReader(process.inputStream))
        var line: String?
        while (reader.readLine().also { line = it } != null) {
            output += line + "n" // Add newline for better formatting
        }
        process.waitFor() // Wait for the process to finish
    } catch (e: Exception) {
        Log.e("ShellExec", "Error executing command: ${e.message}")
        output = "Error executing command"
    }
    return output
}

What am I doing wrong? Is this even possible?

  1. Error executing command: Cannot run program “./delta_plugin” (in directory “/storage/emulated/0/omw_nightly/resources”): error=13, Permission denied
  2. Error executing command: Cannot run program “./delta_plugin”: error=2, No such file or directory