android update

pull/1/head
DiMartinoXBMC 2015-07-26 12:59:08 +03:00
parent bd8df8776a
commit 43b72172f7
2 changed files with 22 additions and 28 deletions

View File

@ -65,36 +65,30 @@ try:
log('CDLL = ' + str(liblibtorrent))
import libtorrent
elif platform['system'] in ['android_armv7', 'android_x86']:
import imp
from ctypes import CDLL
try:
import libtorrent
log('Imported libtorrent v' + libtorrent.version + ' from system')
except Exception, e:
log('Error importing libtorrent from system. Exception: ' + str(e))
import imp
from ctypes import CDLL
try:
dll_path=os.path.join(dest_path, 'liblibtorrent.so')
log('CDLL path = ' + dll_path)
liblibtorrent=CDLL(dll_path)
log('CDLL = ' + str(liblibtorrent))
except:
# If no permission in dest_path we need to go deeper!
# http://i3.kym-cdn.com/photos/images/original/000/531/557/a88.jpg
dest_path=lm.android_workaround()
dll_path=os.path.join(dest_path, 'liblibtorrent.so')
log('NEW CDLL path = ' + dll_path)
dll_path=os.path.join(dest_path, 'liblibtorrent.so')
log('CDLL path = ' + dll_path)
liblibtorrent=CDLL(dll_path)
log('CDLL = ' + str(liblibtorrent))
path_list = [dest_path]
log('path_list = ' + str(path_list))
fp, pathname, description = imp.find_module('libtorrent', path_list)
log('fp = ' + str(fp))
log('pathname = ' + str(pathname))
try:
libtorrent = imp.load_module('libtorrent', fp, pathname, description)
finally:
if fp: fp.close()
except:
# If no permission in dest_path we need to go deeper!
# http://i3.kym-cdn.com/photos/images/original/000/531/557/a88.jpg
dest_path=lm.android_workaround()
dll_path=os.path.join(dest_path, 'liblibtorrent.so')
log('NEW CDLL path = ' + dll_path)
liblibtorrent=CDLL(dll_path)
log('CDLL = ' + str(liblibtorrent))
path_list = [dest_path]
log('path_list = ' + str(path_list))
fp, pathname, description = imp.find_module('libtorrent', path_list)
log('fp = ' + str(fp))
log('pathname = ' + str(pathname))
try:
libtorrent = imp.load_module('libtorrent', fp, pathname, description)
finally:
if fp: fp.close()
log('Imported libtorrent v' + libtorrent.version + ' from "' + dest_path + '"')

View File

@ -76,7 +76,7 @@ class LibraryManager():
return True
def android_workaround(self):
new_dest_path=os.path.join(xbmc.translatePath('special://xbmc'), self.platform['system'])
new_dest_path='/data/data/org.xbmc.kodi/lib/'
for libname in get_libname(self.platform):
libpath=os.path.join(self.dest_path, libname)
size=str(os.path.getsize(libpath))