Can binnary addons be installed as regular plugins?
#1
Dear all,

I am just wondering if we can install binnary addons as regular python plugins. I'm trying to do some modifications on a pvr addon and, for testing purposes, I'm compiling it for my test platforms linux/linux arm and android. The reason of this post is the last one, android. After installing the zip on linux I noticed the lib file is placed in the userdata/addons folder and the addon can sucessfully run.
However, I think in android the lib files can't be run from the sdcard and must be moved into the ext4 partition. Is kodi moving the library after instalation or the only way to test this at the moment is to repackage the whole apk file? If that's the case, are there any plans to make it happen in the future?

Cheers
Reply
#2
i believe this has not yet been adressed by the droidheads.
Reply
#3
IIRC, you can now load libraries from anywhere (at least, from where addons are stored).

Afaik, Droid requirements are still:
- must start with "lib" and end with ".so"
- must be version agnostic

or the lib just cannot be loaded
Reply
#4
(2015-07-02, 19:40)Koying Wrote: IIRC, you can now load libraries from anywhere (at least, from where addons are stored).

Afaik, Droid requirements are still:
- must start with "lib" and end with ".so"
- must be version agnostic

or the lib just cannot be loaded

Thanks for your answer. I sucessfully compiled the lib and added it to stock kodi in 2 different ways:

1) By repackaging the apk using APK Tools v3.50 placing the lib in place (+ the addon files). I was able to run the addon and test my changes with no problems.

2) By making the addon package and installing it as a regular addon. In this case it couldn't run the lib. It gives the error below:

Quote:23:31:00 T:18446744072043046016 ERROR: Unable to load /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/pvr.mypvr/libpvr.mypvr.so, reason: dlopen failed: couldn't map "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/pvr.mypvr/libpvr.mypvr.so" segment 2: Permission denied

Don't know if manually setting the permissions do anything. I don't have root on my test device yet
Reply
#5
Mmm... Right. The FS on which the lib resides must have "execute" permission, too.

I think the way forward for Binary addons on Android is to have them as separate apk's. Depending on a name convention on the addon package name (e.g. "org.blahblah.kodiaddon-myaddon"), we could hook the addon manager to look for them, and the libraries would be loadable.

If you could package your addon that way, I could take it as a starting point for Kodi developments...
Reply
#6
Wouldn't it be easier to extract the library name from the addon.xml when installing the addon and, if we are in android (and the folder where the lib resides don't have execute permissions) to just move the library to the standard kodi library folder (/data/data/org.xbmc.kodi/lib/)? I don't know so apologies if it doesn't make sense.

I also though of adding a service extension point to a python file that would do this on startup but I think the pvr addons are loaded before any python services are started?

If you want I can package one addon and send it over as a test example.

Thanks for your help and time answering
Reply
#7
Apps actually have no write access to their installation directory, so we cannot add libraries after installation.
No different than Linux, really. You have to be root to push anything to the lib directories.
Reply
#8
So basically your suggestion to the future is to have a, let's say, org.xbmc.mypvr apk containing the lib that once installed would move the library to /data/data/org.xbmc.mypvr/lib? If it is usefull I can spend some time trying to make an apk that fits your requirements for testing purposes.

So basically you are saying an android app can load libraries from any other android app installed on the system? I had the idea that every android app runs on their own sandbox/vm without access to other app's folders. Probably it's something related to the app list of permissions that has to be accepted by the user?
Reply
#9
No. My suggestion is to have whatever.whatever.kodiaddons-wahtever.
I can then check the installed packages, and load, from kodi, the library from where it sits (hopefully). It's basically how MX player loads it's codec extensions, from a different package, if I'm correct.

Hard to tell if it will work without actually trying it, though, so such a binary addon package is a prerequisite before knowing it can work...
Reply

Logout Mark Read Team Forum Stats Members Help
Can binnary addons be installed as regular plugins?0