Posts: 114
Joined: Feb 2014
2015-09-05, 11:04
(This post was last modified: 2015-09-10, 18:56 by Shani-08.)
I tried to extract the folder from latest apk and tried using on android but it failed.
Do you have the copy that works on android arm? I don't find any reference in your code, are you still using it in p2p?
Also where did you copy it? I am trying to load it from addons local folder but it says cannot find libAES etc. (will post the complete error later)
just jump on post 18 and see the solution i used.
http://forum.kodi.tv/showthread.php?tid=...pid2102490
Posts: 114
Joined: Feb 2014
2015-09-06, 20:00
(This post was last modified: 2015-09-06, 20:00 by Shani-08.)
Thanks, but where you copy this folder? Ia m testing this on ftv arm android.
when i try to copy it to my code folder, it show this
Code:
18:52:53 T:27950688 ERROR: File "/storage/sdcard/Android/data/org.xbmc.kodi/files/.kodi/addons/script.video.F4mProxy/lib/akhds.py", line 32, in <module>
18:52:53 T:27950688 ERROR: from Crypto.Cipher import AES
18:52:53 T:27950688 ERROR: File "/storage/sdcard/Android/data/org.xbmc.kodi/files/.kodi/addons/script.video.F4mProxy/lib/Crypto/Cipher/AES.py", line 50, in <module>
18:52:53 T:27950688 ERROR: from Crypto.Cipher import _AES
18:52:53 T:27950688 ERROR: ImportError: Cannot load library: load_library(linker.cpp:771): library "lib_AES.so" not found
when i try to copy the files to assets\python2.6\lib\python2.6\site-packages or assets\python2.6\lib\python2.6\lib-dynload and build my apk and deploy, i get this
Code:
18:55:31 T:26425720 ERROR: File "/storage/sdcard/Android/data/org.xbmc.kodi/files/.kodi/addons/script.video.F4mProxy/lib/akhds.py", line 32, in <module>
18:55:31 T:26425720 ERROR: from Crypto.Cipher import AES
18:55:31 T:26425720 ERROR: File "/data/app/org.xbmc.kodi-1.apk/assets/python2.6/lib/python2.6/site-packages/Crypto/Cipher/AES.py", line 50, in <module>
18:55:31 T:26425720 ERROR: ImportError: cannot import name _AES
feel like i am just missing the right folder., could you shed some light please? thanks
Posts: 114
Joined: Feb 2014
2015-09-07, 16:55
(This post was last modified: 2015-09-07, 16:56 by Shani-08.)
Yep, that why i was confused as how its working for you but i think you are not using the code directly and the crpto is loaded via python2.7.
I looked into the python for Android and was able to load Crypto there, so the easiest option is to write a server, and launch in py4A and then use kodi as client to get crypto working.
The prove of concept worked o my PC so will check later with my android.
Posts: 2,078
Joined: Nov 2012
Reputation:
175
enen92
Team-Kodi Member
Posts: 2,078
2015-09-07, 17:07
(This post was last modified: 2015-09-07, 17:08 by enen92.)
Instead of a server you can also (if the code is constant) just run it as any shell application and grab the std output. Probably better than running a server that steals memory (and ports) all the time.
Any executables might need also to be moved to the ext partition
Posts: 114
Joined: Feb 2014
Yes the code is constant but not the data. I can easily do shell , but the server will be stated and stopped with the addon once etc. Launching python to decrypt each frame (there will be 100 in a seconds and few are quite bigger) which load the pycrypto and do the operation will definitely be slow. i will have to compare but first let me try this concept on Android and if it works i will look into script.
Posts: 114
Joined: Feb 2014
OK - Update time. I am able to play the video on Android tablets. I have created a script that you can launch via py4a/sl4a and it creates the socket server.
The addon then use it to get the access to the Crypto.
Now, the problem is, py4a/sl4a is not working on FireTv as the requires components like Filebrowser/internet browser not available so need to find better/different solution
So, how can you embed py4a in the addon and execute python2.7 there? as on android (unrooted atleast) you cannot execute anything from data directories.
Posts: 114
Joined: Feb 2014
oh, this looks promising but am i right in thinking that we can't do this without root? as you are accessing /data/data which is not available without root or i am missing a trick here?
Posts: 2,078
Joined: Nov 2012
Reputation:
175
enen92
Team-Kodi Member
Posts: 2,078
2015-09-08, 17:21
(This post was last modified: 2015-09-08, 17:26 by enen92.)
You can do it (and I do it) without root. As long as it is sandboxed to the application folder you won't have problems. You just can't access other app's folders from your application (in this case kodi) since everything is sandboxed, with individual uid's and in individual vm's for security purposes. In this case you are acessing /data/data/org.xbmc.kodi from kodi itself so it works.
Posts: 114
Joined: Feb 2014
2015-09-08, 19:42
(This post was last modified: 2015-09-08, 19:43 by Shani-08.)
OK, so the trick is that the addon must access the /data/data folder not adb etc which make sense. This is the plan then! will try this on weekend! thanks a lot.
Posts: 114
Joined: Feb 2014
Many Thanks enen92! Got it working by copying the files manually (just to test) and launching it via the Addon. Working great!
You are right about the SSL approach, as i just need a faster AES CBC decryption, is there any hints if i can simply call Android System functions and use ssl lib from python?