Пример #1
0
def SetupAccount():
    utils.checkOS()
    os = utils.GetSetting('OS')

    if os == 'MacOS':
        utils.dialogOK('It appears you are running on Mac OS.', '',
                       'You may need administrator access to run VPNicity.')

        sudo = utils.dialogKB(
            '', "Enter the 'User Account' password for your computer.")

        ADDON.setSetting('SUDO', 'true')
        ADDON.setSetting('SUDOPASS', sudo)

        utils.dialogOK('We will now finish your installation.',
                       'Please double check your settings after we are done.',
                       'Thank you!')
        xbmc.executebuiltin(
            'XBMC.RunScript(special://home/addons/plugin.program.vpnicity/install.py)'
        )

    if 'OpenELEC' in os:
        utils.dialogOK('It appears you are running on OpenELEC.',
                       'We will now finish your installation.',
                       'Please double check your settings after we are done.')
        xbmc.executebuiltin(
            'XBMC.RunScript(/storage/.kodi/addons/plugin.program.vpnicity/install.py)'
        )

    else:
        return
Пример #2
0
def SetupAccount():
    utils.checkOS()
    os = utils.GetSetting('OS')

    if os == 'MacOS':
        utils.dialogOK('It appears you are running on Mac OS.', '', 'You may need administrator access to run VPNicity.')

        sudo = utils.dialogKB('', "Enter the 'User Account' password for your computer.")

        ADDON.setSetting('SUDO', 'true')
        ADDON.setSetting('SUDOPASS', sudo)

        utils.dialogOK('We will now finish your installation.', 'Please double check your settings after we are done.', 'Thank you!')
        xbmc.executebuiltin('XBMC.RunScript(special://home/addons/plugin.program.vpnicity/install.py)')

    if 'OpenELEC' in os:
        utils.dialogOK('It appears you are running on OpenELEC.', 'We will now finish your installation.', 'Please double check your settings after we are done.')    
        xbmc.executebuiltin('XBMC.RunScript(/storage/.kodi/addons/plugin.program.vpnicity/install.py)')
        
    if 'Ember 3.x.x' in os:
        utils.dialogOK('It appears you are running on Ember.', 'We will now finish your installation.', 'Please double check your settings after we are done.')    
        xbmc.executebuiltin('XBMC.RunScript(/storage/.kodi/addons/plugin.program.vpnicity/install.py)')

    else:
        return
Пример #3
0
    def checkForAddon(self):
        #print "____________________________________________"
        #print xbmc.getInfoLabel('Container.FolderPath')
        #print xbmc.getInfoLabel('ListItem.FolderPath')
        #print xbmc.getInfoLabel('ListItem.Label')
        #print xbmc.getInfoLabel('ListItem.FilenameAndPath')
        #print xbmc.getInfoLabel('ListItem.Label')
        #print xbmc.getInfoLabel('ListItem.Thumb')
        #print xbmc.getInfoLabel('ListItem.Property(IsPlayable)').lower() == 'true'
        #print xbmc.getInfoLabel('ListItem.Property(Fanart_Image)')
        ##print xbmc.getCondVisibility('ListItem.IsFolder') == 1
        #print "ADDON"
        #print xbmcaddon.Addon().getAddonInfo('path')
        #print "____________________________________________"

        folder = ''

        try:
            folder = xbmc.getInfoLabel('Container.FolderPath').replace(
                'plugin://', '')
        except:
            pass

        if len(folder) == 0:
            return

        if (len(self.addon) > 0) and folder.startswith(self.addon):
            return

        currentVPN = xbmcgui.Window(10000).getProperty('VPNICITY_ABRV').lower()

        if len(self.addon) > 0 and len(currentVPN) > 0:
            if not xbmc.Player().isPlayingVideo():
                import kill
                import ipcheck
                kill.KillVPN()
                ipcheck.Network()

        self.addon = ''

        for addon in self.addons:
            plugin = addon[0]
            if folder.startswith(plugin):
                VPN = addon[2]
                self.addon = plugin
                if VPN != currentVPN:
                    import vpn
                    utils.checkOS()
                    vpn.AutoSelect(self.addon, [VPN])
                return
Пример #4
0
    def checkForAddon(self):
        #print "____________________________________________"
        #print xbmc.getInfoLabel('Container.FolderPath')
        #print xbmc.getInfoLabel('ListItem.FolderPath')
        #print xbmc.getInfoLabel('ListItem.Label')
        #print xbmc.getInfoLabel('ListItem.FilenameAndPath')
        #print xbmc.getInfoLabel('ListItem.Label')
        #print xbmc.getInfoLabel('ListItem.Thumb')    
        #print xbmc.getInfoLabel('ListItem.Property(IsPlayable)').lower() == 'true'
        #print xbmc.getInfoLabel('ListItem.Property(Fanart_Image)')
        ##print xbmc.getCondVisibility('ListItem.IsFolder') == 1
        #print "ADDON"
        #print xbmcaddon.Addon().getAddonInfo('path')
        #print "____________________________________________"

        folder = ''

        try:    folder = xbmc.getInfoLabel('Container.FolderPath').replace('plugin://', '')
        except: pass

        if len(folder) == 0:
            return

        if (len(self.addon) > 0) and folder.startswith(self.addon):
            return

        currentVPN = xbmcgui.Window(10000).getProperty('VPNICITY_ABRV').lower()

        if len(self.addon) > 0 and len(currentVPN) > 0:
            if not xbmc.Player().isPlayingVideo():
                import kill
                import ipcheck
                kill.KillVPN()
                ipcheck.Network()
                

        self.addon = ''

        for addon in self.addons:
            plugin = addon[0]
            if folder.startswith(plugin):
                VPN        = addon[2]
                self.addon = plugin
                if VPN != currentVPN:
                    import vpn
                    utils.checkOS()
                    vpn.AutoSelect(self.addon, [VPN])
                return
Пример #5
0
                return


def checkInstalled():
    import path
    exists = path.getPath(utils.GetSetting('OS'), silent=True)
    if not exists:
        if utils.yesno('Do you want to install the VPN application now'):
            import install
            install.install(silent=False)


# -------------------------------------------------------------------

utils.checkAutoStart()
utils.checkOS()
       
monitor = MyMonitor()


while (not xbmc.abortRequested):
    xbmc.sleep(1000)
    if xbmc.getCondVisibility('System.HasAddon(%s)' % utils.ADDONID) == 0: #i.e. not enabled/installed
        DeleteKeymap()
        xbmc.sleep(1000)
        xbmc.executebuiltin('Action(reloadkeymaps)')  
    else:
        monitor.checkForAddon()


if xbmc.getCondVisibility('System.HasAddon(%s)' % utils.ADDONID) == 0:
Пример #6
0
                return


def checkInstalled():
    import path
    exists = path.getPath(utils.GetSetting('OS'), silent=True)
    if not exists:
        if utils.yesno('Do you want to install the VPN application now'):
            import install
            install.install(silent=False)


# -------------------------------------------------------------------

utils.checkAutoStart()
utils.checkOS()

monitor = MyMonitor()

while (not xbmc.abortRequested):
    xbmc.sleep(1000)
    if xbmc.getCondVisibility('System.HasAddon(%s)' %
                              utils.ADDONID) == 0:  #i.e. not enabled/installed
        DeleteKeymap()
        xbmc.sleep(1000)
        xbmc.executebuiltin('Action(reloadkeymaps)')
    else:
        monitor.checkForAddon()

if xbmc.getCondVisibility('System.HasAddon(%s)' % utils.ADDONID) == 0:
    DeleteKeymap()