I have an executable binary file named “main.” I’m trying to run this binary using Android Studio’s exec and ProcessBuilder. It works on API levels 28 and below, but when I target API 29 or higher, it returns a “permission denied” error.
To resolve this, I attempted various solutions, including setting permissions with chmod and adjusting file access settings. Despite these efforts, the issue persisted. I expected these methods to grant the necessary permissions and allow the binary to execute, but they did not work.
I suspect the issue is due to security changes introduced in API 29 and above. Starting with API 29, Android has implemented stricter security measures, such as Scoped Storage, which restricts direct access to the filesystem. Additionally, executing binaries in the app’s data directory has been restricted for non-shell users.
I hope someone could help me! ????
Michael Agan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.