tis-removebloat

3
Retire les bloatwares
1790 downloads
Download

  Description 

  • package : tis-removebloat
  • version : 3
  • architecture : all
  • categories :
  • maintainer : Tranquil-IT-Systems
  • description : Retire les bloatwares
  • locale :
  • target_os :
  • min_os_version :
  • max_os_version :
  • min_wapt_version :
  • sources :
  • installed_size :
  • impacted_process :
  • description_fr :
  • description_pl :
  • description_de :
  • description_es :
  • description_pt :
  • description_it :
  • description_nl :
  • description_ru :
  • editor :
  • licence :
  • signature_date : 2020-02-27T15:11:55.314223

  Setup.py 

# -*- coding: utf-8 -*-
from setuphelpers import *
import re

uninstallkey = []

# re: regular match for soft name
# key:  exact match for uninstallkey
# run: provide direct command for uninstall
# metro: remove a metro app with powershell
# str or list : keywords in key and/or name

# tuple : (search,process_to_kill,title)

# look to http://www.shouldiremoveit.com/oems-bloatware.aspx for information about bloatwares

crapwares = [
    're:ask toolbar',
    'key:TFTPUtil',
    'key:CCleaner',
    ('key:{7DB9F1E5-9ACB-410D-A7DC-7A3D023CE045}','welcome.exe','Dell Getting Started Guide'),
    ('key:{2290A680-4083-410A-ADCC-7092C67FC052}','topi.exe','Toshiba Online Product Information'),
    'Intel Security True Key',
    'Amazon Cloud Player',
    'Fire.fm',
    'StumbleUpon',
    'VTzilla',
    'Complitly',
 ]

def find_soft_re(softs,pattern):
    return [s for s in softs if pattern.findall(s['name'])]

def find_soft_keywords(softs,keywords):
    def check_words(target,words):
        mywords = target.lower()
        result = not words or mywords
        for w in words:
            result = result and w in mywords
        return result

    return [s for s in softs if check_words(s['key'] + ' '+ s['name'],keywords)]

def install():
    all_softs = installed_softwares()

    for crapware in crapwares:
        # split if processes to kill is supplied too
        if  isinstance(crapware,tuple):
            if len(crapware) == 3:
                (crapware,to_kill,title) = crapware
            elif len(crapware) == 2:
                (crapware,to_kill) = crapware
                title = crapware
        else:
            to_kill = None
            title = crapware

        run = None
        if isinstance(crapware,re._pattern_type):
            uninstall_entries = find_soft_re(all_softs,crapware)
        elif isinstance(crapware,(unicode,str)) and crapware.startswith('re:'):
            uninstall_entries = find_soft_re(all_softs,re.compile(crapware[3:],re.IGNORECASE))
        elif isinstance(crapware,(unicode,str)) and crapware.startswith('key:'):
            uninstall_entries = [s for s in all_softs if s['key'] == crapware[4:]]
        elif isinstance(crapware,(unicode,str)) and crapware.startswith('run:'):
            uninstall_entries = []
            run = crapware[4:]
            # check if command exists


        else:
            if isinstance(crapware,(str,unicode)):
                mykeywords = crapware.lower().split()
            else:
                mykeywords = [ ensure_unicode(k).lower() for k in crapware ]
            uninstall_entries = find_soft_keywords(all_softs,mykeywords)

        if uninstall_entries or run:
            print('Processing removal of %s '%(title,))
            if to_kill:
                print('  Killing processes %s' % (to_kill,))
                killalltasks(to_kill)

            for uninstall in uninstall_entries:
                cmd = WAPT.uninstall_cmd(uninstall['key'])
                print(u'  Uninstalling %s' % (uninstall['name'],))
                print run_notfatal(cmd)

            if run:
                print(u'  Launching %s' % (run,))
                print run_notfatal(run)


										

  Changelog 


No changelog
  manifest.sha256 
[["setup.py","da977a08b5320e14ed006ed512bbcb22d185967a625f4a5dfbcb2ac7effaae1f"],["WAPT/certificate.crt","a5a97261381e1d0ad46ee15916abec9c2631d0201f5cc50ceb0197a165a0bbbf"],["WAPT/wapt.psproj","b1ce3b4267b131b7829ec336eb3e9847d5f1942db81473f4c37d83f390d9ff37"],["WAPT/control","51cd962c86bec3e22f793f46b7da5a5f99b7c007eaefe65068620bf5b8a6bc81"]]