Hi all,
I successfully compiled a static ARM binary and created an addon, which loads it as a daemon. Well, it works fine on an RPi2, but on my phone, it gives a 'No such file or directory'....
AFAIK, it caused, because the external storages (like /storage/emulated/0, or /storage/sdcard1) is mounted with the noexec flag. Which is okay, because it makes my sdcard more safety. But I want to run this binary.
Well, is there a way to move the binaries under /data/data/org.xbmc.kodi/... folder, where hopefully, I Can run theese binaries? Or what Can I do? (Unfortunately, I haven't got root access)
Many thanks!
Analysis is correct. You will have to bundle in the kodi apk or build an apk for the addon that installs into kodi dir.
But I have to do that with the addon itself. The apk rebuild is an easy way, but not So elegant. And harder to install for the users.
Please remember that we are not going to be keen on a binary addon being promoted here without being able to see your source code. Is it on github?
Okay, that's true.
Will upload it to Github!
Cheers
Assuming your addon is not about piracy and that it's self-compiling and you can build an apk, I'm quite interested to use it as guinea pig to find out how to integrate those with Kodi...
this is what i have in my 2013 notes;
'droid cannot use zip files due to noexec stuff. we should build add-ons as native packages, then tap into whatever api's droid has for managing extensions/plugins for applications. this way, add-ons can simply be separate things in the store and we do not have to do distribution mess ourself'
- investigate what apis are available (is there such an api? can we use our own frontend?).
- check whether cpack can build apk's
Yep, binary addons apk is still the goal, as it's definitely how it should be.
MX Player does it to distribute its "grey" codecs, so there is definitely a way
Qt for Android uses some kind of middleware; to be investigated as well
Well, my addon contains a native ARM Transmission binary, which is fully static!
I created a Git repo too, as You requested:
https://github.com/MrDini123/service.transmission
This is my first addon, So please ignore my noobness! I am a hobby C developer, not python prof.
Feel free to upload Pull reqs!
Thanks a lot!
Off: Is there a way to keep the daemon running, when the python script exits? Because now, it is unusable...
Okay, I fixed the addon (see the linked github page). Now works nice on my RPi2. But I think it will not work on my Android device...
Mod: yes, I tried to install it, and said the following error:
Code:
Traceback (most recent call last):
File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/service.transmission/default.py", line 30, in <module>
startTransmission()
File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/service.transmission/default.py", line 15, in startTransmission
subprocess.call('chmod +x ' + __path__ + '/bin/*', shell=True)
File "/home/jenkins/workspace/Android-ARM/tools/depends/xbmc-depends/arm-linux-androideabi-android-17/lib/python2.6/subprocess.py", line 480, in call
File "/home/jenkins/workspace/Android-ARM/tools/depends/xbmc-depends/arm-linux-androideabi-android-17/lib/python2.6/subprocess.py", line 633, in __init__
File "/home/jenkins/workspace/Android-ARM/tools/depends/xbmc-depends/arm-linux-androideabi-android-17/lib/python2.6/subprocess.py", line 1139, in _execute_child
OSError: [Errno 2] No such file or directory
-->End of Python script error report<--
Well, it looks like a compile error, because this Jenkins folder doesn't exist on my device:
/home/jenkins/workspace/Android-ARM/tools/depends/xbmc-depends/arm-linux-androideabi-android-17/lib/python2.6/
If you would tell where it prints out that jenkins path i could guess that this is not a path which it tries to access during runtime but a path which it prints out for debug purposes and which just is an information which was collected during compile time...
Probably first thing first. How did you compile the "*.bin" in your repo?
And that has little chance to work on droid:
Code:
subprocess.call('chmod +x ' + __path__ + '/bin/*', shell=True)
cmd = __path__+'/bin/transmission.start '+__path__
subprocess.call(cmd, shell=True)
(2017-02-11, 13:46)Memphiz Wrote: [ -> ]If you would tell where it prints out that jenkins path i could guess that this is not a path which it tries to access during runtime but a path which it prints out for debug purposes and which just is an information which was collected during compile time...
I copied this part from the kodi.log file.
(2017-02-11, 13:50)Koying Wrote: [ -> ]Probably first thing first. How did you compile the "*.bin" in your repo?
And that has little chance to work on droid:
Code:
subprocess.call('chmod +x ' + __path__ + '/bin/*', shell=True)
cmd = __path__+'/bin/transmission.start '+__path__
subprocess.call(cmd, shell=True)
I compiled theese binaries on an ARMv5 box. So it runs on RPi1, Rpi2, Rpi3 and on Android too, if I copy the binaries under the data partition, and run from here.
I forced the static flag, So theese binaries are static and theese only require a libc.so.6 and a linker.
Thanks for the code, will try it! But if the internal storage mounted with noexec flag, the chmod +x has no effect. I Cannot start binaries from here. I Can only run it from data system, etc partitions. But theese folders Can only accessible, when I have root permissions...