New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Just curious: Do the binaries actually need the .so extension? #3
Comments
@ChristianCiach you are correct, the executables are renamed that way to look like shared objects because they are bundled as JNI libraries even though they are not. Otherwise they might not get extracted from the APK on install on some devices. It's a bit hacky but I don't know of any other way to get a file with execute permission on Android 10 and up. When I noticed Elementum uses sockets for inter-process communication I realized how easy it would be to get it to work this way. |
Thanks! |
Turns out, naming the binaries That being said, I wonder how hard it is to build the elementum core as an actual library instead of an executable. I know you are currently just copying the executable from the official release artifact, so re-building it from source as a library is more work. Your code and the gradle files seem quite hacky anyway. I briefly considered sending some PRs to clean up some stuff. But then again.... It's currently working fine and the development of Elementum has been mostly stopped anyway, so why bother? If it works, it works :) |
So nothing has changed from the last time I looked into shipping executables. |
It's unusual to name executables using the "so" file extension. Is there anything in android that forces you to name the files that way? I see that you bundle the binaries as JNI libraries into the APK (which is maybe the reason for naming the files that way), but isn't it also possible to just package them as resources (for example using the
processResources
gradle task)?There is no actual issue that I am trying to fix. I am just curious about some of the choices you've made.
That being said, I think your solution to the W^X issue is very elegant: Since android only allows the execution of binaries bundled with the APK, let's just put them into an APK. Nice! Luckily the Kodi extension uses sockets to communicate with the core process, otherwise we would have lot more work to do :)
Thanks for this project btw!
The text was updated successfully, but these errors were encountered: