ElementumService
A service that executes binaries for Kodi's addon Elementum on Android without a W^X violation.
Download
Use source https://StefanIlchev.github.io/ElementumService.
Install
Install an .apk
with an Application Binary Interface (ABI) that your device supports or the bigger universal one.
Add Elementum to Kodi from the .android_client.zip
. When the addon completes installation it'll start the service app which may ask you for some Android permissions.
On Android 11 and up the service app may ask you to allow it to manage all files or try to open its settings if your device doesn't let it. If nothing else works the service app will show you the following command that will allow it to manage all files which you might have to execute for Elementum to work properly:
adb shell appops set --uid service.elementum.android MANAGE_EXTERNAL_STORAGE allow
Auto-update
Reinstall the addon from the added Elementum Service Repository
and Kodi should keep it up to date. If you don't see the repository as an option check if it's not disabled.
When updating itself the service app might ask you to allow it to install apps and to confirm the update. After an update the service won't be started automatically. A start can be triggered by interacting with the addon which will try to start the service if it's not responding.
The service app won't work if it's a different version from the addon and will show a message like:
<service-version> ≠ <client-version>
Build
Prepare an Elementum addon .zip
at path/to/plugin.video.elementum-<version>.zip
containing Android binaries for your device either by building the Elementum project or by downloading it from a release's assets.
Assuming you already have Android Studio setup, execute the following command in a terminal:
gradlew clean assembleRelease zipAndroidClient -DaddonZip="path/to/plugin.video.elementum-<version>.zip"
and when it completes successfully look for the following files in the newly created build
folder:
-
plugin.video.elementum-<version>.android_client.zip
found directly in thebuild
folder is the addon.zip
you provided with its binaries removed and scripts modified to work with the service app; -
ElementumService-<ABI>-release-<version>.apk
found in thebuild/outputs/apk/release
subfolder are one or more.apk
files containing the binaries from the addon.zip
you provided.
Notes
From now on when Elementum starts its daemon it'll actually start the service app and when it stops it'll stop the service app.
You'll no longer be able to use paths to Kodi's data folder as they will be translated to the service app's data folder.
The output from the binaries will no longer appear in Kodi's log and will go to Android's log instead.