Merge remote-tracking branch 'upstream/dev' into dev
This commit is contained in:
commit
a9b57ad3ad
6 changed files with 61 additions and 8 deletions
|
|
@ -132,7 +132,6 @@ LAUNCHERS = {
|
|||
r' /logfile=%log_dir%\Tools\FastCopy.log'
|
||||
r' /acl'
|
||||
r' /cmd=noexist_only'
|
||||
r' /utf8'
|
||||
r' /skip_empty_dir'
|
||||
r' /linkdest'
|
||||
r' /exclude='
|
||||
|
|
@ -181,7 +180,6 @@ LAUNCHERS = {
|
|||
r' /logfile=%log_dir%\Tools\FastCopy.log'
|
||||
r' /acl'
|
||||
r' /cmd=noexist_only'
|
||||
r' /utf8'
|
||||
r' /skip_empty_dir'
|
||||
r' /linkdest'
|
||||
r' /exclude='
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import sys
|
|||
import time
|
||||
|
||||
from subprocess import CalledProcessError, DEVNULL
|
||||
from xml.dom.minidom import parse as xml_parse
|
||||
|
||||
from wk.cfg.main import KIT_NAME_FULL, KIT_NAME_SHORT, WINDOWS_TIME_ZONE
|
||||
from wk.cfg.repairs import (
|
||||
|
|
@ -97,6 +98,7 @@ GPUPDATE_SUCCESS_STRINGS = (
|
|||
)
|
||||
IN_CONEMU = 'ConEmuPID' in os.environ
|
||||
MENU_PRESETS = Menu()
|
||||
PROGRAMDATA = os.environ.get('{ALLUSERSPROFILE}', r'C:\ProgramData')
|
||||
PROGRAMFILES_32 = os.environ.get(
|
||||
'PROGRAMFILES(X86)', os.environ.get(
|
||||
'PROGRAMFILES', r'C:\Program Files (x86)',
|
||||
|
|
@ -1138,6 +1140,47 @@ def install_mbam():
|
|||
)
|
||||
|
||||
|
||||
def log_kvrt_results(log_path, report_path):
|
||||
"""Parse KVRT report and log results in plain text."""
|
||||
log_text = ''
|
||||
report_file = None
|
||||
|
||||
# Get latest KVRT report
|
||||
for item in reversed(sorted(report_path.iterdir())):
|
||||
if item.name.startswith('report'):
|
||||
report_file = item
|
||||
break
|
||||
if not report_file:
|
||||
log_path.write_text('Failed to find KVRT report.', encoding='utf-8')
|
||||
return
|
||||
|
||||
# Parse report
|
||||
dom_document = xml_parse(str(report_file))
|
||||
block_elements = dom_document.getElementsByTagName('Block0')
|
||||
if not block_elements:
|
||||
log_path.write_text('Failed to parse KVRT report.', encoding='utf-8')
|
||||
return
|
||||
attributes = block_elements[0].attributes
|
||||
events = block_elements[0].getElementsByTagName('*')
|
||||
|
||||
# Log summary
|
||||
for key, value in attributes.items():
|
||||
log_text += f'{key+":":<14} {value}\n'
|
||||
|
||||
# Log quarantined items
|
||||
quarantined_items = []
|
||||
for event in events:
|
||||
if not event.getAttribute('Action') == 'Quarantined':
|
||||
continue
|
||||
quarantined_items.append(event.getAttribute('Object'))
|
||||
if quarantined_items:
|
||||
log_text += '\nQuarantined Items:\n'
|
||||
log_text += '\n'.join(quarantined_items)
|
||||
|
||||
# Done
|
||||
log_path.write_text(log_text, encoding='utf-8')
|
||||
|
||||
|
||||
def run_adwcleaner():
|
||||
"""Run AdwCleaner."""
|
||||
settings_path = get_tool_path('AdwCleaner', 'AdwCleaner', check=False)
|
||||
|
|
@ -1217,12 +1260,18 @@ def run_kvrt():
|
|||
log_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
quarantine_path = set_quarantine_path('KVRT')
|
||||
quarantine_path.mkdir(parents=True, exist_ok=True)
|
||||
report_path = quarantine_path.joinpath('Reports')
|
||||
report_path.mkdir(parents=True, exist_ok=True)
|
||||
scan_list = log_path.with_suffix('.lst')
|
||||
scan_list.write_text(
|
||||
f'{PROGRAMDATA}\n{SYSTEMDRIVE}\\Users', encoding='utf-8',
|
||||
)
|
||||
cmd_args = (
|
||||
'-accepteula',
|
||||
'-d', str(quarantine_path),
|
||||
'-dontencrypt', '-fixednames',
|
||||
'-processlevel', '1',
|
||||
'-custom', SYSTEMDRIVE,
|
||||
'-customlist', str(scan_list),
|
||||
'-silent', '-adinsilent',
|
||||
)
|
||||
|
||||
|
|
@ -1239,6 +1288,7 @@ def run_kvrt():
|
|||
sleep(5)
|
||||
set_proc_priority('KVRT', 'HIGH', exact=False)
|
||||
wait_for_procs('KVRT.exe')
|
||||
log_kvrt_results(log_path, report_path)
|
||||
return
|
||||
|
||||
# Run in background
|
||||
|
|
@ -1249,7 +1299,7 @@ def run_kvrt():
|
|||
sleep(5)
|
||||
set_proc_priority('KVRT', 'HIGH', exact=False)
|
||||
proc.wait()
|
||||
log_path.write_text(proc.stdout, encoding='utf-8')
|
||||
log_kvrt_results(log_path, report_path)
|
||||
|
||||
|
||||
def run_mbam():
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ iwgtk
|
|||
mariadb-connector-c
|
||||
memtest86-efi
|
||||
mprime-bin
|
||||
opensuperclone-git
|
||||
pipes.sh
|
||||
python-mariadb-connector
|
||||
python-smbus2
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ ddrescue
|
|||
ddrescueview-bin
|
||||
device-mapper
|
||||
diffutils
|
||||
dkms
|
||||
dmidecode
|
||||
dmraid
|
||||
dos2unix
|
||||
|
|
@ -85,6 +86,7 @@ numlockx
|
|||
nvme-cli
|
||||
openbox
|
||||
openssh
|
||||
opensuperclone-git
|
||||
otf-font-awesome-4
|
||||
p7zip
|
||||
papirus-icon-theme
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ syslinux
|
|||
tigervnc
|
||||
wpa_supplicant
|
||||
|
||||
# hardinfo-gtk3
|
||||
# hardinfo-gtk3 / opensuperclone-git
|
||||
cmake
|
||||
|
||||
# iwgtk
|
||||
|
|
@ -25,9 +25,6 @@ scdoc
|
|||
# python-mariadb-connector
|
||||
mariadb-connector-c
|
||||
|
||||
# opensuperclone-git
|
||||
libusb-compat
|
||||
|
||||
# smartmontools-svn
|
||||
subversion
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
[Desktop Entry]
|
||||
Name=OSCViewer
|
||||
Comment=OpenSuperClone viewer
|
||||
Exec=oscviewer
|
||||
Type=Application
|
||||
Loading…
Reference in a new issue