Came across this project on github: https://github.com/tytydraco/LADB
Even though I don't read Kotlin, as far as I can tell, the developer is not importing methods from the libadb.so into his own code; he is simply treating the libadb.so as an executable. So, he just executes the file along with the actual command by running a background process, the end result would be something like this:
new ProcessBuilder(adbPath+command)).directory(this.getFilesDir()).start();
adbPath is the absolutePath of where the libadb.so is located. Pre-compilation the file is stored in the jniLibs folder.
command could be for instance pair localhost:2334 or shell.
The thing is I get this exception when starting the process:
2022-08-28 15:44:43.638 10591-13931/com.test.myapplication I/System.out: Cannot run program "/data/app/~~lCjz17EMQQ7-XVoYrYa1Jw==/com.test.myapplication-9MADOh8OORG__Li17fkr6Q==/lib/arm64/libadb.so" (in directory "/data/user/0/com.test.myapplication/files"): error=2, No such file or directory
Why there is no such file or directory? And what would I need to do to fix this?