2020-01-13, 00:52
it worked with kodi 17 and below but kodi 18 fails to prompt the install. i found some code on here that says is suppose to work for 18 but im getting indent errors when trying to implant it into my addon.
its driving me nuts and i was wondering if anyone can look at if for me?
its driving me nuts and i was wondering if anyone can look at if for me?
python:import xbmc, xbmcgui
import urllib2,urllib
import os,sys,re
import time
import shutil
import base64,zipfile
import platform, subprocess
import xbmc, xbmcaddon, xbmcgui, xbmcplugin, os, subprocess
dialog = xbmcgui.Dialog()
def iiNT3LiiCheckURL(url):
try:
req = urllib2.Request(url)
req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3')
response = urllib2.urlopen(req)
link=response.read()
response.close()
return link
except:
return False
def iiNT3LiiBrothers(url):
Jose = url
Mathews = base64.b64decode(Jose)
iiNT3LiiG3NCii = base64.b64decode(Mathews)
Robb = base64.b64decode(iiNT3LiiG3NCii)
return Robb
def launch_command(command_launch):
try:
xbmc.log('[%s] %s' % ('LAUNCHING SUBPROCESS:', command_launch), 2)
external_command = subprocess.call(command_launch, shell = True, executable = '/system/bin/sh')
except Exception, e:
try:
xbmc.log('[%s] %s' % ('ERROR LAUNCHING COMMAND !!!', e.message, external_command), 2)
xbmc.log('[%s] %s' % ('LAUNCHING OS:', command_launch), 2)
external_command = os.system(command_launch)
except:
xbmc.log('[%s]' % ('ERROR LAUNCHING COMMAND !!!', external_command), 2)
if xbmc.getCondVisibility('system.platform.android'):
iiNT3LiiAPK = subprocess.Popen(['exec ''/system/bin/pm list packages -3'''], executable='/system/bin/sh', shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT).communicate()[0].rstrip('\n').splitlines()
for i in range(len(iiNT3LiiAPK)):
iiNT3LiiAPK[i] = iiNT3LiiAPK[i].partition(':')[2]
if 'com.retroarch' not in iiNT3LiiAPK:
path = xbmc.translatePath(os.path.join('special://home/addons','packages'))
lib = os.path.join(path, 'Retro.apk')
try: os.remove(lib)
except: pass
url = iiNT3LiiBrothers('WVVoU01HTklUVFpNZVRrelpETmpkVnBJU25aalIwcDJaVU0xYW1JeU1IWmplVGt3VGpOa00xcFhVVEJOV0ZKb1QwaHdiVmxYZDNaVmJWWXdZMjA1UW1OdFRtOU5hVFZvWTBkekwxcEhkemxOVVQwOQ==') # base64 encoded 3 times
urllib.urlretrieve(url, lib)
xbmcgui.Dialog().ok("[COLOR cyan]Standard-inc[/COLOR]","[COLOR cyan]Detected a Required App Not On The System![/COLOR]","[COLOR cyan]Please Install When Prompted To Install![/COLOR]","")
path = xbmc.translatePath(os.path.join('special://home/addons','packages'))
pathdownload = os.path.join(path, 'Retro.apk')
command = 'pm install -rgd' + pathdownload
launch_command(command)
theZip = os.path.join(path,"retroStuff.zip")
urllib.urlretrieve(iiNT3LiiBrothers("WVVoU01HTklUVFpNZVRrelpETmpkVnBJU25aalIwcDJaVU0xYW1JeU1IWmplVGx6WlZoQmVHVlhUbmRqUjNSdVRtNUdkbUZJUVhaVmJWWXdZMjA1UW1OdFRtOU1ibkJ3WTBRNWEySkVNSGc9"),theZip)
match = re.compile('(/Android/data/[^/]*/files/[^/]*/)').findall(xbmc.translatePath("special://home"))
if match:
thePath = xbmc.translatePath("special://home").replace(match[0],"/")
else:
thePath = "/sdcard/"
theUnzip = zipfile.ZipFile(theZip)
for i in theUnzip.infolist():
try:
theUnzip.extract(i,thePath)
except:
pass
xbmcgui.Dialog().ok("[COLOR cyan]Standard-inc[/COLOR]","","[COLOR cyan]Operation Completed![/COLOR]","")
try: os.remove(lib)
except: pass