I am rather new to mobile develoipment, can somebody tell me how exactly I can allow files to run on Android? I want to run proot commands with bash like it’s done in Termux
I took proot from here and build binary like in instructions. It looks fine
I took bash binary from here
I add my binary proot and bash to assets and in code I transfer them with escalation of permissions
assets.open(filename).use { inputStream ->
FileOutputStream(file).use { outputStream ->
inputStream.copyTo(outputStream)
}
}
file.setExecutable(true)
Then I use them from that file dir
try {
val prootCommand = "${filesDir}/proot -0 -b /dev -b /proc -b ${filesDir}:/data /bin/sh -c "$command""
val process = Runtime.getRuntime().exec(prootCommand)
val results = process.inputStream.bufferedReader().use { it.readText() }
} catch (e: IOException) {
e.printStackTrace()
}
I always get the permission error 13.