def __init__(self): if xbmc.getCondVisibility('system.platform.Android'): if librtmp.android_hack_checker(): md5 = librtmp.abrir_url("http://anonymous-repo.googlecode.com/svn/trunk/xbmc-tools/librtmp/md5/android.xml.md5") xbmc_path = librtmp.android_xbmc_path() librtmp_path = os.path.join(xbmc_path, "lib", "librtmp.so") aux = os.path.join(xbmc_path, "lib", "libxbrtmp.so") if os.path.exists(aux): librtmp_path = aux if not librtmp.md5sum_verified(librtmp_path) == md5: my_librtmp = os.path.join(addonfolder,"resources","android_hack","librtmp.so") xbmc.sleep(int(selfAddon.getSetting('start_time'))*1000) os.system("su -c 'cat "+my_librtmp+" > "+librtmp_path+"'") os.system("su -c 'chmod 755 "+librtmp_path+"'") if auto_update_librtmp: librtmp.librtmp_android(True) elif xbmc.getCondVisibility('system.platform.windows'): if auto_update_librtmp: librtmp.librtmp_updater("windows",True) elif xbmc.getCondVisibility('System.Platform.OSX'): if auto_update_librtmp: librtmp.librtmp_updater("macos",True) elif xbmc.getCondVisibility('system.platform.IOS'): if auto_update_librtmp: librtmp.librtmp_updater("ios",True) elif xbmc.getCondVisibility('system.platform.linux') and not xbmc.getCondVisibility('system.platform.Android'): if os.uname()[4] == 'armv6l': if re.search(os.uname()[1],"openelec",re.IGNORECASE) or forcar_openelec: if auto_update_librtmp: librtmp.librtmp_openelec("raspberry",True) else: if auto_update_librtmp: librtmp.librtmp_linux("raspberry",True) elif os.uname()[4] == 'armv7l': return else: if re.search(os.uname()[1],"openelec",re.IGNORECASE): if auto_update_librtmp: librtmp.librtmp_openelec("-",True) else: if auto_update_librtmp: librtmp.librtmp_linux("linux",True) ################### Force Shutdown ################### if forcar_shutdown and (xbmc.getCondVisibility('system.platform.windows') or (xbmc.getCondVisibility('system.platform.linux') and not xbmc.getCondVisibility('system.platform.Android')) or xbmc.getCondVisibility('System.Platform.OSX')): while not xbmc.abortRequested: time.sleep(1) print('Forcing shutdown...') if xbmc.getCondVisibility('system.platform.windows'): if self.version() < 14: subprocess.call("taskkill /IM XBMC.exe /F") else: subprocess.call("taskkill /IM Kodi.exe /F") elif xbmc.getCondVisibility('system.platform.linux') and not xbmc.getCondVisibility('system.platform.Android'): if self.version() < 14: subprocess.call("killall -9 xbmc.bin", shell=True) else: subprocess.call("killall -9 kodi.bin", shell=True) elif xbmc.getCondVisibility('System.Platform.OSX'): if self.version() < 14: subprocess.call("killall -9 XBMC", shell=True) else: subprocess.call("killall -9 Kodi", shell=True)
def CATEGORIES(): if xbmc.getCondVisibility('system.platform.windows'): #WINDOWS if first_run: mensagem_os("Windows") dialog.ok(traducao(2000), traducao(2001)) selfAddon.setSetting('first_run',value='false') if xbmc_version < 14: addDir(traducao(2002),"windows",1,artfolder + "keyboard.png") addDir(traducao(2003),"windows",3,artfolder + "dll.png",False) addDir(traducao(2004),"windows",9,artfolder + "backup.png") addLink('','','nothing') librtmp.VersionChecker("windows") #----------------------------------------------------------------------- elif xbmc.getCondVisibility('System.Platform.OSX'): if first_run: mensagem_os("macOS") if os.uname()[4] == "i686" or os.uname()[4] == "i386": selfAddon.setSetting('mac_bits',value=str(0)) else: if librtmp.xbmc_bit_version() == "x32": selfAddon.setSetting('mac_bits',value=str(0)) elif librtmp.xbmc_bit_version() == "x64": selfAddon.setSetting('mac_bits',value=str(1)) else: ret = dialog.select(traducao(2056), ['x86', 'x64']) if ret == -1: sys.exit(0); return; selfAddon.setSetting('mac_bits',value=str(ret)) selfAddon.setSetting('first_run',value='false') addDir(traducao(2003),"macos",3,artfolder + "dll.png",False) addDir(traducao(2004),"macos",9,artfolder + "backup.png") addLink('','','nothing') librtmp.VersionChecker("macos") elif xbmc.getCondVisibility('system.platform.linux') and not xbmc.getCondVisibility('system.platform.Android'): if os.uname()[4] == 'armv6l': #RASPBERRY if re.search(os.uname()[1],"openelec",re.IGNORECASE) or forcar_openelec: mensagem_os("Openelec",True) addDir(traducao(2003),"raspberry",8,artfolder + "dll.png",False) addDir(traducao(2004),"openelec",9,artfolder + "backup.png") addLink('','','nothing') librtmp.VersionChecker("openelec") else: mensagem_os("RaspberryPI (OS)",True) librtmp.set_librtmp_path() if xbmc_version < 14: addDir(traducao(2002),"linux",1,artfolder + "keyboard.png") addDir(traducao(2003),"raspberry",7,artfolder + "dll.png",False) addDir(traducao(2004),"raspberry",9,artfolder + "backup.png") addLink('','','nothing') librtmp.VersionChecker("raspberry") #------------------------------------------------------------------- elif os.uname()[4] == 'armv7l': #ARMv7 erro_os() '''if re.search(os.uname()[1],"openelec",re.IGNORECASE) or forcar_openelec: mensagem_os("Openelec",True) addDir(traducao(2003),"raspberry",8,artfolder + "dll.png",False) addDir(traducao(2004),"openelec",9,artfolder + "backup.png") addLink('','','nothing') librtmp.VersionChecker("openelec") else: mensagem_os("Linux",True) librtmp.set_librtmp_path() addDir(traducao(2003),"armv7",3,artfolder + "dll.png",False) addDir(traducao(2004),"armv7",9,artfolder + "backup.png") addLink('','','nothing') librtmp.VersionChecker("raspberry")''' else: #LINUX if re.search(os.uname()[1],"openelec",re.IGNORECASE) or forcar_openelec: mensagem_os("Openelec",True) addDir(traducao(2003),"-",8,artfolder + "dll.png",False) addDir(traducao(2004),"openelec",9,artfolder + "backup.png") addLink('','','nothing') librtmp.VersionChecker("openelec pc") else: mensagem_os("Linux",True) librtmp.set_librtmp_path() if xbmc_version < 14: addDir(traducao(2002),"linux",1,artfolder + "keyboard.png") addDir(traducao(2003),"linux",7,artfolder + "dll.png",False) addDir(traducao(2004),"linux",9,artfolder + "backup.png") addLink('','','nothing') librtmp.VersionChecker("linux") #------------------------------------------------------------------- elif xbmc.getCondVisibility('system.platform.Android'): #ANDROID mensagem_os("Android",True) if xbmc_version < 14: addDir(traducao(2002),"android",1,artfolder + "keyboard.png") addDir("Download APK","-",11,artfolder + "apk.png",False) addDir(traducao(2003)+" [COLOR blue](XBMC Gotham 13)[/COLOR]","-",5,artfolder + "dll.png",False) if librtmp.android_hack_checker(): addDir(traducao(2059)+" [COLOR blue](On)[/COLOR]","-",12,artfolder + "hack.png",False) else: addDir(traducao(2059)+" [COLOR red](Off)[/COLOR]","-",13,artfolder + "hack.png",False) addDir(traducao(2004),"android",9,artfolder + "backup.png") addLink('','','nothing') librtmp.VersionChecker("android") #------------------------------------------------------------------- elif xbmc.getCondVisibility('system.platform.IOS'): #IOS mensagem_os("iOS",True) addDir(traducao(2003),"ios",3,artfolder + "dll.png",False) addDir(traducao(2004),"ios",9,artfolder + "backup.png") addLink('','','nothing') librtmp.VersionChecker("ios") #------------------------------------------------------------------- else: erro_os() addDir(traducao(2064),"-",14,artfolder + "settings.png", False) disponivel=versao_disponivel() # nas categorias if disponivel==versao: addLink('[B][COLOR white]'+traducao(2005)+' (' + versao + ')[/COLOR][/B]','',artfolder + 'versao.png') elif disponivel=='Erro ao verificar a versão!': addLink('[B][COLOR white]' + traducao(2006) + '[/COLOR][/B]','',artfolder + 'versao.png') else: addLink('[B][COLOR white]'+traducao(2007)+' ('+ disponivel + '). '+traducao(2008)+'[/COLOR][/B]','',artfolder + 'versao.png') print "--------- XBMC Tools ---------"
def __init__(self): if xbmc.getCondVisibility('system.platform.Android'): if librtmp.android_hack_checker(): md5 = librtmp.abrir_url( "http://anonymous-repo.googlecode.com/svn/trunk/xbmc-tools/librtmp/md5/android.xml.md5" ) xbmc_path = librtmp.android_xbmc_path() librtmp_path = os.path.join(xbmc_path, "lib", "librtmp.so") aux = os.path.join(xbmc_path, "lib", "libxbrtmp.so") if os.path.exists(aux): librtmp_path = aux if not librtmp.md5sum_verified(librtmp_path) == md5: my_librtmp = os.path.join(addonfolder, "resources", "android_hack", "librtmp.so") xbmc.sleep(int(selfAddon.getSetting('start_time')) * 1000) os.system("su -c 'cat " + my_librtmp + " > " + librtmp_path + "'") os.system("su -c 'chmod 755 " + librtmp_path + "'") if auto_update_librtmp: librtmp.librtmp_android(True) elif xbmc.getCondVisibility('system.platform.windows'): if auto_update_librtmp: librtmp.librtmp_updater("windows", True) elif xbmc.getCondVisibility('System.Platform.OSX'): if auto_update_librtmp: librtmp.librtmp_updater("macos", True) elif xbmc.getCondVisibility('system.platform.IOS'): if auto_update_librtmp: librtmp.librtmp_updater("ios", True) elif xbmc.getCondVisibility( 'system.platform.linux' ) and not xbmc.getCondVisibility('system.platform.Android'): if os.uname()[4] == 'armv6l': if re.search(os.uname()[1], "openelec", re.IGNORECASE) or forcar_openelec: if auto_update_librtmp: librtmp.librtmp_openelec("raspberry", True) else: if auto_update_librtmp: librtmp.librtmp_linux("raspberry", True) elif os.uname()[4] == 'armv7l': return else: if re.search(os.uname()[1], "openelec", re.IGNORECASE): if auto_update_librtmp: librtmp.librtmp_openelec("-", True) else: if auto_update_librtmp: librtmp.librtmp_linux("linux", True) ################### Force Shutdown ################### if forcar_shutdown and ( xbmc.getCondVisibility('system.platform.windows') or (xbmc.getCondVisibility('system.platform.linux') and not xbmc.getCondVisibility('system.platform.Android')) or xbmc.getCondVisibility('System.Platform.OSX')): while not xbmc.abortRequested: time.sleep(1) print('Forcing shutdown...') if xbmc.getCondVisibility('system.platform.windows'): if self.version() < 14: subprocess.call("taskkill /IM XBMC.exe /F") else: subprocess.call("taskkill /IM Kodi.exe /F") elif xbmc.getCondVisibility( 'system.platform.linux' ) and not xbmc.getCondVisibility('system.platform.Android'): if self.version() < 14: subprocess.call("killall -9 xbmc.bin", shell=True) else: subprocess.call("killall -9 kodi.bin", shell=True) elif xbmc.getCondVisibility('System.Platform.OSX'): if self.version() < 14: subprocess.call("killall -9 XBMC", shell=True) else: subprocess.call("killall -9 Kodi", shell=True)
def CATEGORIES(): if xbmc.getCondVisibility('system.platform.windows'): #WINDOWS if first_run: mensagem_os("Windows") dialog.ok(traducao(2000), traducao(2001)) selfAddon.setSetting('first_run', value='false') if xbmc_version < 14: addDir(traducao(2002), "windows", 1, artfolder + "keyboard.png") addDir(traducao(2003), "windows", 3, artfolder + "dll.png", False) addDir(traducao(2004), "windows", 9, artfolder + "backup.png") addLink('', '', 'nothing') librtmp.VersionChecker("windows") #----------------------------------------------------------------------- elif xbmc.getCondVisibility('System.Platform.OSX'): if first_run: mensagem_os("macOS") if os.uname()[4] == "i686" or os.uname()[4] == "i386": selfAddon.setSetting('mac_bits', value=str(0)) else: if librtmp.xbmc_bit_version() == "x32": selfAddon.setSetting('mac_bits', value=str(0)) elif librtmp.xbmc_bit_version() == "x64": selfAddon.setSetting('mac_bits', value=str(1)) else: ret = dialog.select(traducao(2056), ['x86', 'x64']) if ret == -1: sys.exit(0) return selfAddon.setSetting('mac_bits', value=str(ret)) selfAddon.setSetting('first_run', value='false') addDir(traducao(2003), "macos", 3, artfolder + "dll.png", False) addDir(traducao(2004), "macos", 9, artfolder + "backup.png") addLink('', '', 'nothing') librtmp.VersionChecker("macos") elif xbmc.getCondVisibility( 'system.platform.linux' ) and not xbmc.getCondVisibility('system.platform.Android'): if os.uname()[4] == 'armv6l': #RASPBERRY if re.search(os.uname()[1], "openelec", re.IGNORECASE) or forcar_openelec: mensagem_os("Openelec", True) addDir(traducao(2003), "raspberry", 8, artfolder + "dll.png", False) addDir(traducao(2004), "openelec", 9, artfolder + "backup.png") addLink('', '', 'nothing') librtmp.VersionChecker("openelec") else: mensagem_os("RaspberryPI (OS)", True) librtmp.set_librtmp_path() if xbmc_version < 14: addDir(traducao(2002), "linux", 1, artfolder + "keyboard.png") addDir(traducao(2003), "raspberry", 7, artfolder + "dll.png", False) addDir(traducao(2004), "raspberry", 9, artfolder + "backup.png") addLink('', '', 'nothing') librtmp.VersionChecker("raspberry") #------------------------------------------------------------------- elif os.uname()[4] == 'armv7l': #ARMv7 erro_os() '''if re.search(os.uname()[1],"openelec",re.IGNORECASE) or forcar_openelec: mensagem_os("Openelec",True) addDir(traducao(2003),"raspberry",8,artfolder + "dll.png",False) addDir(traducao(2004),"openelec",9,artfolder + "backup.png") addLink('','','nothing') librtmp.VersionChecker("openelec") else: mensagem_os("Linux",True) librtmp.set_librtmp_path() addDir(traducao(2003),"armv7",3,artfolder + "dll.png",False) addDir(traducao(2004),"armv7",9,artfolder + "backup.png") addLink('','','nothing') librtmp.VersionChecker("raspberry")''' else: #LINUX if re.search(os.uname()[1], "openelec", re.IGNORECASE) or forcar_openelec: mensagem_os("Openelec", True) addDir(traducao(2003), "-", 8, artfolder + "dll.png", False) addDir(traducao(2004), "openelec", 9, artfolder + "backup.png") addLink('', '', 'nothing') librtmp.VersionChecker("openelec pc") else: mensagem_os("Linux", True) librtmp.set_librtmp_path() if xbmc_version < 14: addDir(traducao(2002), "linux", 1, artfolder + "keyboard.png") addDir(traducao(2003), "linux", 7, artfolder + "dll.png", False) addDir(traducao(2004), "linux", 9, artfolder + "backup.png") addLink('', '', 'nothing') librtmp.VersionChecker("linux") #------------------------------------------------------------------- elif xbmc.getCondVisibility('system.platform.Android'): #ANDROID mensagem_os("Android", True) if xbmc_version < 14: addDir(traducao(2002), "android", 1, artfolder + "keyboard.png") addDir("Download APK", "-", 11, artfolder + "apk.png", False) addDir( traducao(2003) + " [COLOR blue](XBMC Gotham 13)[/COLOR]", "-", 5, artfolder + "dll.png", False) if librtmp.android_hack_checker(): addDir( traducao(2059) + " [COLOR blue](On)[/COLOR]", "-", 12, artfolder + "hack.png", False) else: addDir( traducao(2059) + " [COLOR red](Off)[/COLOR]", "-", 13, artfolder + "hack.png", False) addDir(traducao(2004), "android", 9, artfolder + "backup.png") addLink('', '', 'nothing') librtmp.VersionChecker("android") #------------------------------------------------------------------- elif xbmc.getCondVisibility('system.platform.IOS'): #IOS mensagem_os("iOS", True) addDir(traducao(2003), "ios", 3, artfolder + "dll.png", False) addDir(traducao(2004), "ios", 9, artfolder + "backup.png") addLink('', '', 'nothing') librtmp.VersionChecker("ios") #------------------------------------------------------------------- else: erro_os() addDir(traducao(2064), "-", 14, artfolder + "settings.png", False) disponivel = versao_disponivel() # nas categorias if disponivel == versao: addLink( '[B][COLOR white]' + traducao(2005) + ' (' + versao + ')[/COLOR][/B]', '', artfolder + 'versao.png') elif disponivel == 'Erro ao verificar a versão!': addLink('[B][COLOR white]' + traducao(2006) + '[/COLOR][/B]', '', artfolder + 'versao.png') else: addLink( '[B][COLOR white]' + traducao(2007) + ' (' + disponivel + '). ' + traducao(2008) + '[/COLOR][/B]', '', artfolder + 'versao.png') print "--------- XBMC Tools ---------"