Posts: 2,078
Joined: Nov 2012
Reputation:
176
enen92
Team-Kodi Member
Posts: 2,078
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
Posts: 1,506
Joined: Nov 2013
i believe this has not yet been adressed by the droidheads.
Posts: 5,952
Joined: Sep 2008
Reputation:
201
Koying
Retired Team-Kodi Member
Posts: 5,952
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
Posts: 5,952
Joined: Sep 2008
Reputation:
201
Koying
Retired Team-Kodi Member
Posts: 5,952
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...
Posts: 2,078
Joined: Nov 2012
Reputation:
176
enen92
Team-Kodi Member
Posts: 2,078
2015-07-03, 15:56
(This post was last modified: 2015-07-03, 15:57 by enen92.)
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
Posts: 5,952
Joined: Sep 2008
Reputation:
201
Koying
Retired Team-Kodi Member
Posts: 5,952
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.
Posts: 2,078
Joined: Nov 2012
Reputation:
176
enen92
Team-Kodi Member
Posts: 2,078
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?
Posts: 5,952
Joined: Sep 2008
Reputation:
201
Koying
Retired Team-Kodi Member
Posts: 5,952
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...