|
|
|
@@ -10,7 +10,7 @@
|
|
|
|
|
#
|
|
|
|
|
##################################### 載入模組套件 ###################################
|
|
|
|
|
|
|
|
|
|
import os, sys, time, psutil, subprocess
|
|
|
|
|
import os, sys, time, json, psutil, subprocess
|
|
|
|
|
from configparser import RawConfigParser
|
|
|
|
|
from pefile import PE, DIRECTORY_ENTRY
|
|
|
|
|
from hashlib import md5, sha1, sha256
|
|
|
|
@@ -46,79 +46,79 @@ def pyasb_remove():
|
|
|
|
|
|
|
|
|
|
def pyasp_remove():
|
|
|
|
|
try:
|
|
|
|
|
os.remove('Library/PYAS/Temp/PYASP.tmp')
|
|
|
|
|
if os.path.isfile('Library/PYAS/Temp/PYASP.tmp'):
|
|
|
|
|
os.remove('Library/PYAS/Temp/PYASP.tmp')
|
|
|
|
|
except:
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
#################################### 實時防護檢查 ###################################
|
|
|
|
|
|
|
|
|
|
def protect_autorun():
|
|
|
|
|
if os.path.isfile('Library/PYAS/Temp/PYASP.tmp'):
|
|
|
|
|
return True
|
|
|
|
|
else:
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
##################################### 資料庫檢查 ####################################
|
|
|
|
|
|
|
|
|
|
def pyas_library():
|
|
|
|
|
try:
|
|
|
|
|
if not os.path.isdir('Library/PYAS/Temp'):
|
|
|
|
|
os.makedirs('Library/PYAS/Temp')
|
|
|
|
|
if not os.path.isdir('Library/PYAS/Setup'):
|
|
|
|
|
os.makedirs('Library/PYAS/Setup')
|
|
|
|
|
if not os.path.isdir('Library/PYAS/Icon'):
|
|
|
|
|
os.makedirs('Library/PYAS/Icon')
|
|
|
|
|
if not os.path.isdir('Library/PYAE/Function'):
|
|
|
|
|
os.makedirs('Library/PYAE/Function')
|
|
|
|
|
if not os.path.isdir('Library/PYAE/Hashes'):
|
|
|
|
|
os.makedirs('Library/PYAE/Hashes')
|
|
|
|
|
checkPath = [
|
|
|
|
|
'Library/PYAS/Temp',
|
|
|
|
|
'Library/PYAS/Setup',
|
|
|
|
|
'Library/PYAS/Icon',
|
|
|
|
|
'Library/PYAE/Function',
|
|
|
|
|
'Library/PYAE/Hashes']
|
|
|
|
|
for i in checkPath:
|
|
|
|
|
if not os.path.isdir(i):
|
|
|
|
|
os.makedirs(i)
|
|
|
|
|
except Exception as e:
|
|
|
|
|
pyas_bug_log(e)
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
#################################### 實時防護檢查 ###################################
|
|
|
|
|
|
|
|
|
|
def protect_autorun():
|
|
|
|
|
if pyas_key() and os.path.isfile('Library/PYAS/Temp/PYASP.tmp'):
|
|
|
|
|
return True
|
|
|
|
|
else:
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
##################################### 更新資料庫 ####################################
|
|
|
|
|
|
|
|
|
|
# 這些變數命名方式不符合規範,請不要使用簡寫,以免造成混淆
|
|
|
|
|
def pyas_vl_update():
|
|
|
|
|
try:
|
|
|
|
|
v = open('Library/PYAE/Hashes/Viruslist.num','r').read()
|
|
|
|
|
v = open('Library/PYAE/Hashes/Viruslist.num', 'r').read()
|
|
|
|
|
except:
|
|
|
|
|
v = 0
|
|
|
|
|
try:
|
|
|
|
|
import requests as req
|
|
|
|
|
for i in range(int(v),10000):
|
|
|
|
|
for i in range(int(v), 10000):
|
|
|
|
|
try:
|
|
|
|
|
x = 5 - len(str(i))
|
|
|
|
|
y = '0'*x+str(i)
|
|
|
|
|
file = req.get('https://virusshare.com/hashfiles/VirusShare_'+y+'.md5', allow_redirects=True)
|
|
|
|
|
open('Library/PYAE/Hashes/'+y+'.md5', 'wb').write(file.content)
|
|
|
|
|
with open('Library/PYAE/Hashes/'+str(y)+'.md5',"rb") as f:
|
|
|
|
|
y = '0' * x + str(i)
|
|
|
|
|
file = req.get(f'https://virusshare.com/hashfiles/VirusShare_{y}.md5', allow_redirects=True)
|
|
|
|
|
open(f'Library/PYAE/Hashes/{y}.md5', 'wb').write(file.content)
|
|
|
|
|
with open(f'Library/PYAE/Hashes/{y}.md5',"rb") as f:
|
|
|
|
|
bytes = f.read()
|
|
|
|
|
readable_hash = str(md5(bytes).hexdigest())
|
|
|
|
|
f.close()
|
|
|
|
|
|
|
|
|
|
if '449a34c34a7507dffe1d39afad3eeac9' == readable_hash:
|
|
|
|
|
v = open('Library/PYAE/Hashes/Viruslist.num','w').write(str(i))
|
|
|
|
|
os.remove('Library/PYAE/Hashes/'+str(y)+'.md5')
|
|
|
|
|
print('[INFO] Hashes Update Complete (V'+str(i-1)+')')
|
|
|
|
|
v = open('Library/PYAE/Hashes/Viruslist.num', 'w').write(str(i))
|
|
|
|
|
os.remove(f'Library/PYAE/Hashes/{y}.md5')
|
|
|
|
|
print(f'[INFO] Hashes Update Complete (V{i - 1})')
|
|
|
|
|
break
|
|
|
|
|
else:
|
|
|
|
|
try:
|
|
|
|
|
with open('Library/PYAE/Hashes/'+str(y)+'.md5','r') as fi:
|
|
|
|
|
with open(f'Library/PYAE/Hashes/{y}.md5','r') as fi:
|
|
|
|
|
rfpl = fi.readlines()
|
|
|
|
|
with open('Library/PYAE/Hashes/Viruslist.md5','a') as vm:
|
|
|
|
|
for j in range(6,len(rfpl)):
|
|
|
|
|
for j in range(6, len(rfpl)):
|
|
|
|
|
vm.write(str(rfpl[j])[:10]+'\n')
|
|
|
|
|
vm.close()
|
|
|
|
|
fi.close()
|
|
|
|
|
except:
|
|
|
|
|
pass
|
|
|
|
|
v = open('Library/PYAE/Hashes/Viruslist.num','w').write(str(i+1))
|
|
|
|
|
os.remove('Library/PYAE/Hashes/'+str(y)+'.md5')
|
|
|
|
|
os.remove(f'Library/PYAE/Hashes/{y}.md5')
|
|
|
|
|
except:
|
|
|
|
|
print('[INFO] Hashes Update Fail (V'+str(i-1)+')')
|
|
|
|
|
print(f'[INFO] Hashes Update Fail (V{i - 1})')
|
|
|
|
|
break
|
|
|
|
|
except Exception as e:
|
|
|
|
|
pyas_bug_log(e)
|
|
|
|
|
sys.exit()
|
|
|
|
|
|
|
|
|
|
###################################### 密鑰認證 #####################################
|
|
|
|
|
|
|
|
|
@@ -135,16 +135,13 @@ def pyas_key():
|
|
|
|
|
bytes = f.read()
|
|
|
|
|
readable_hash = str(md5(bytes).hexdigest())
|
|
|
|
|
f.close()
|
|
|
|
|
try:
|
|
|
|
|
ft = open('Library/PYAS/Setup/PYAS.key','r')
|
|
|
|
|
fe = ft.read()
|
|
|
|
|
ft.close()
|
|
|
|
|
if fe == readable_hash:
|
|
|
|
|
return True
|
|
|
|
|
else:
|
|
|
|
|
return False
|
|
|
|
|
except:
|
|
|
|
|
pass
|
|
|
|
|
ft = open('Library/PYAS/Setup/PYAS.key','r')
|
|
|
|
|
fe = ft.read()
|
|
|
|
|
ft.close()
|
|
|
|
|
if fe == readable_hash:
|
|
|
|
|
return True
|
|
|
|
|
else:
|
|
|
|
|
return False
|
|
|
|
|
else:
|
|
|
|
|
return False
|
|
|
|
|
except Exception as e:
|
|
|
|
@@ -166,9 +163,13 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
|
|
|
|
|
def resizeEvent(self, event):
|
|
|
|
|
width, height = event.size().width(), event.size().height()
|
|
|
|
|
print('[INFO] '+str(event.size()))
|
|
|
|
|
print(f'[INFO] {event.size()}')
|
|
|
|
|
|
|
|
|
|
def setup_control(self):# TODO
|
|
|
|
|
def writeConfig(self, config):
|
|
|
|
|
with open('Library/PYAS/Setup/PYAS.json', 'w', encoding='utf-8') as f:
|
|
|
|
|
f.write(json.dumps(config, indent=4, ensure_ascii=False))
|
|
|
|
|
|
|
|
|
|
def setup_control(self):
|
|
|
|
|
self.init()#調用本地函數"init"
|
|
|
|
|
self.ui.Close_Button.clicked.connect(self.close)#讓物件名稱"Close_Button"連接到函數"close"
|
|
|
|
|
self.ui.Minimize_Button.clicked.connect(self.showMinimized)
|
|
|
|
@@ -239,8 +240,6 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
self.ui.Theme_Blue.clicked.connect(self.Change_Theme)
|
|
|
|
|
self.ui.Theme_Red.clicked.connect(self.Change_Theme)
|
|
|
|
|
|
|
|
|
|
##################################### 語言初始化 ####################################
|
|
|
|
|
|
|
|
|
|
def init(self):
|
|
|
|
|
self.ui.widget_2.lower()
|
|
|
|
|
self.ui.Navigation_Bar.raise_()
|
|
|
|
@@ -250,38 +249,33 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
self.Process_quantity = []
|
|
|
|
|
self.Virus_Scan = 0
|
|
|
|
|
self.Safe = True
|
|
|
|
|
self.Process_Timer=QTimer()
|
|
|
|
|
self.Process_Timer = QTimer()
|
|
|
|
|
self.Process_Timer.timeout.connect(self.Process_list)
|
|
|
|
|
self.ini_config = RawConfigParser()
|
|
|
|
|
if (not os.path.exists('Library/PYAS/Setup/PYAS.json')):
|
|
|
|
|
config = {"high_sensitivity":0,"language":"english"}
|
|
|
|
|
self.writeConfig(config)
|
|
|
|
|
with open('Library/PYAS/Setup/PYAS.json', 'r', encoding='utf-8') as f:
|
|
|
|
|
self.pyasConfig = json.load(f)
|
|
|
|
|
try:
|
|
|
|
|
self.ini_config.read(r"Library/PYAS/Setup/PYAS.ini")
|
|
|
|
|
if self.ini_config.get("Setting","language") == "zh_TW":
|
|
|
|
|
self.language = "zh_TW"
|
|
|
|
|
if self.pyasConfig['language'] == "zh_TW":
|
|
|
|
|
self.lang_init_zh_tw()
|
|
|
|
|
self.ui.Language_Traditional_Chinese.setChecked(True)
|
|
|
|
|
elif self.ini_config.get("Setting","language") == "zh_CN":
|
|
|
|
|
self.language = "zh_CN"
|
|
|
|
|
elif self.pyasConfig['language'] == "zh_CN":
|
|
|
|
|
self.lang_init_zh_cn()
|
|
|
|
|
self.ui.Language_Simplified_Chinese.setChecked(True)
|
|
|
|
|
else:
|
|
|
|
|
self.language = "english"
|
|
|
|
|
self.lang_init_en()
|
|
|
|
|
self.ui.Languahe_English.setChecked(True)
|
|
|
|
|
except:
|
|
|
|
|
try:
|
|
|
|
|
with open(r"Library/PYAS/Setup/PYAS.ini",mode="w",encoding="utf-8") as file:
|
|
|
|
|
file.write("[Setting]\nhigh_sensitivity = 0\nlanguage = english")
|
|
|
|
|
file.close()
|
|
|
|
|
except Exception as e:
|
|
|
|
|
pyas_bug_log(e)
|
|
|
|
|
self.language = "english"
|
|
|
|
|
config = {"high_sensitivity":0,"language":"english"}
|
|
|
|
|
self.writeConfig(config)
|
|
|
|
|
self.pyasConfig['language'] = "english"
|
|
|
|
|
self.lang_init_en()
|
|
|
|
|
self.ui.Languahe_English.setChecked(True)
|
|
|
|
|
try:
|
|
|
|
|
Thread(target = pyas_vl_update).start()
|
|
|
|
|
if protect_autorun:
|
|
|
|
|
Thread(target = self.pyas_protect_init_zh).start()
|
|
|
|
|
if self.ini_config.getint("Setting","high_sensitivity") == 1:
|
|
|
|
|
Thread(target = self.pyas_protect_init_zh).start()
|
|
|
|
|
if self.pyasConfig['high_sensitivity'] == 1:
|
|
|
|
|
self.show_virus_scan_progress_bar = 1
|
|
|
|
|
self.ui.Show_Virus_Scan_Progress_Bar_switch_Button.setText(self.text_Translate("已開啟"))
|
|
|
|
|
self.ui.Show_Virus_Scan_Progress_Bar_switch_Button.setStyleSheet("""
|
|
|
|
@@ -333,14 +327,13 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
|
|
|
|
|
def lang_init_en(self):
|
|
|
|
|
_translate = QtCore.QCoreApplication.translate
|
|
|
|
|
self.ui.State_output.clear()
|
|
|
|
|
if pyas_key():
|
|
|
|
|
self.ui.State_output.clear()
|
|
|
|
|
self.ui.Window_title.setText(_translate("MainWindow", "PYAS V"+pyas_version))
|
|
|
|
|
if not protect_autorun:
|
|
|
|
|
self.ui.State_output.append(str(time.strftime('%Y/%m/%d %H:%M:%S')) + ' > [Tips] Real-time Protect is not enabled')
|
|
|
|
|
else:
|
|
|
|
|
self.ui.Window_title.setText(_translate("MainWindow", "PYAS V"+pyas_version+" (Security Key Error)"))
|
|
|
|
|
self.ui.State_output.clear()
|
|
|
|
|
self.ui.State_output.append(str(time.strftime('%Y/%m/%d %H:%M:%S')) + ' > [Warning] PYAS Security Key Error')
|
|
|
|
|
self.ui.State_Button.setText(_translate("MainWindow", "State"))
|
|
|
|
|
self.ui.Virus_Scan_Button.setText(_translate("MainWindow", "Scan"))
|
|
|
|
@@ -379,7 +372,7 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
self.ui.System_Info_Button.setText(_translate("MainWindow", "System Information"))
|
|
|
|
|
self.ui.System_Tools_Back.setText(_translate("MainWindow", "Back"))
|
|
|
|
|
self.ui.Privacy_Tools_Back.setText(_translate("MainWindow", "Back"))
|
|
|
|
|
self.ui.Delete_Private_File_Button.setText(_translate("MainWindow", "Delete Private File"))
|
|
|
|
|
self.ui.Delete_Private_File_Button.setText(_translate("MainWindow", "Private File Shred"))
|
|
|
|
|
self.ui.Develop_Tools_Back.setText(_translate("MainWindow", "Back"))
|
|
|
|
|
self.ui.Customize_REG_Command_Button.setText(_translate("MainWindow", "Customize REG"))
|
|
|
|
|
self.ui.Customize_CMD_Command_Button.setText(_translate("MainWindow", "Customize CMD"))
|
|
|
|
@@ -400,7 +393,7 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
self.ui.Customize_CMD_Command_output_title.setText(_translate("MainWindow", "Output:"))
|
|
|
|
|
self.ui.Analyze_EXE_Back.setText(_translate("MainWindow", "Back"))
|
|
|
|
|
self.ui.Look_for_File_Back.setText(_translate("MainWindow", "Back"))
|
|
|
|
|
self.ui.Look_for_File_Run_Button.setText(_translate("MainWindow", "Find file"))
|
|
|
|
|
self.ui.Look_for_File_Run_Button.setText(_translate("MainWindow", "Search"))
|
|
|
|
|
self.ui.Encryption_Text_Back.setText(_translate("MainWindow", "Back"))
|
|
|
|
|
self.ui.Encryption_Text_Run_Button.setText(_translate("MainWindow", "Encrypt"))
|
|
|
|
|
self.ui.Encryption_Text_title2.setText(_translate("MainWindow", "After Encrypt & Decrypt"))
|
|
|
|
@@ -416,7 +409,7 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
self.ui.Testers_title.setText(_translate("MainWindow", "Testers:"))
|
|
|
|
|
self.ui.Testers_Name.setText(_translate("MainWindow", "yang5487"))
|
|
|
|
|
self.ui.PYAS_URL_title.setText(_translate("MainWindow", "Website:"))
|
|
|
|
|
self.ui.PYAS_URL.setText(_translate("MainWindow", "<html><head/><body><p><a href=\"https://pyantivirus.wixsite.com/pyas?lang=en\"><span style= \" text-decoration: underline; color:#0000ff;\">https://pyantivirus.wixsite.com/pyas</span></a></p></body></html>"))
|
|
|
|
|
self.ui.PYAS_URL.setText(_translate("MainWindow", "<html><head/><body><p><a href=\"https://pyantivirus.wixsite.com/pyas?lang=en\"><span style= \" text-decoration: underline; color:#000000;\">https://pyantivirus.wixsite.com/pyas</span></a></p></body></html>"))
|
|
|
|
|
cy = time.strftime('%Y')
|
|
|
|
|
if int(cy) < 2020:
|
|
|
|
|
cy = str('2020')
|
|
|
|
@@ -441,7 +434,7 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
self.ui.Customize_REG_Command_Run_Button.setText(_translate("MainWindow", "OK"))
|
|
|
|
|
self.ui.Value_HEKY_title.setText(_translate("MainWindow", "Value HEKY:"))
|
|
|
|
|
self.ui.Show_Virus_Scan_Progress_Bar_title.setText(_translate("MainWindow", "High Sensitivity Mode"))
|
|
|
|
|
self.ui.Show_Virus_Scan_Progress_Bar_illustrate.setText(_translate("MainWindow", "Enable this option can improve scanning sensitivity, but it can also cause manslaughter."))
|
|
|
|
|
self.ui.Show_Virus_Scan_Progress_Bar_illustrate.setText(_translate("MainWindow", "Enable this option can improve scanning sensitivity,\nbut it can also cause manslaughter."))
|
|
|
|
|
if self.ui.Show_Virus_Scan_Progress_Bar_switch_Button.text() == self.text_Translate("已開啟"):
|
|
|
|
|
self.ui.Show_Virus_Scan_Progress_Bar_switch_Button.setText(_translate("MainWindow", "On"))
|
|
|
|
|
else:
|
|
|
|
@@ -463,14 +456,13 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
|
|
|
|
|
def lang_init_zh_cn(self):
|
|
|
|
|
_translate = QtCore.QCoreApplication.translate
|
|
|
|
|
self.ui.State_output.clear()
|
|
|
|
|
if pyas_key():
|
|
|
|
|
self.ui.State_output.clear()
|
|
|
|
|
self.ui.Window_title.setText(_translate("MainWindow", "PYAS V"+pyas_version))
|
|
|
|
|
if not protect_autorun:
|
|
|
|
|
self.ui.State_output.append(str(time.strftime('%Y/%m/%d %H:%M:%S')) + ' > [提示] 尚未启用实时防护')
|
|
|
|
|
else:
|
|
|
|
|
self.ui.Window_title.setText(_translate("MainWindow", "PYAS V"+pyas_version+" (安全密钥错误)"))
|
|
|
|
|
self.ui.State_output.clear()
|
|
|
|
|
self.ui.State_output.append(str(time.strftime('%Y/%m/%d %H:%M:%S')) + ' > [警告] PYAS 安全密钥错误')
|
|
|
|
|
self.ui.State_Button.setText(_translate("MainWindow", "状态"))
|
|
|
|
|
self.ui.Virus_Scan_Button.setText(_translate("MainWindow", "扫描"))
|
|
|
|
@@ -479,7 +471,7 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
self.ui.Virus_Scan_title.setText(_translate("MainWindow", "病毒扫描"))
|
|
|
|
|
self.ui.Virus_Scan_text.setText(_translate("MainWindow", "请选择扫描方式"))
|
|
|
|
|
self.ui.Virus_Scan_choose_Button.setText(_translate("MainWindow", "病毒扫描"))
|
|
|
|
|
self.ui.File_Scan_Button.setText(_translate("MainWindow", "档案扫描"))
|
|
|
|
|
self.ui.File_Scan_Button.setText(_translate("MainWindow", "文件扫描"))
|
|
|
|
|
self.ui.Path_Scan_Button.setText(_translate("MainWindow", "路径扫描"))
|
|
|
|
|
self.ui.Disk_Scan_Button.setText(_translate("MainWindow", "全盘扫描"))
|
|
|
|
|
self.ui.Virus_Scan_Solve_Button.setText(_translate("MainWindow", "立即解决"))
|
|
|
|
@@ -501,15 +493,15 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
self.ui.More_Tools_Button.setText(_translate("MainWindow", "更多工具"))
|
|
|
|
|
self.ui.More_Tools_Back_Button.setText(_translate("MainWindow", "工具>"))
|
|
|
|
|
self.ui.System_Process_Manage_Button.setText(_translate("MainWindow", "系统进程管理"))
|
|
|
|
|
self.ui.Repair_System_Permission_Button.setText(_translate("MainWindow", "修复系统权限"))
|
|
|
|
|
self.ui.Repair_System_Files_Button.setText(_translate("MainWindow", "修复系统档案"))
|
|
|
|
|
self.ui.Clean_System_Files_Button.setText(_translate("MainWindow", "清理系统垃圾"))
|
|
|
|
|
self.ui.Repair_System_Permission_Button.setText(_translate("MainWindow", "系统权限修复"))
|
|
|
|
|
self.ui.Repair_System_Files_Button.setText(_translate("MainWindow", "系统文件修复"))
|
|
|
|
|
self.ui.Clean_System_Files_Button.setText(_translate("MainWindow", "系统垃圾清理"))
|
|
|
|
|
self.ui.Enable_Safe_Mode_Button.setText(_translate("MainWindow", "启动安全模式"))
|
|
|
|
|
self.ui.Disable_Safe_Mode_Button.setText(_translate("MainWindow", "关闭安全模式"))
|
|
|
|
|
self.ui.System_Info_Button.setText(_translate("MainWindow", "系统版本资讯"))
|
|
|
|
|
self.ui.System_Tools_Back.setText(_translate("MainWindow", "返回"))
|
|
|
|
|
self.ui.Privacy_Tools_Back.setText(_translate("MainWindow", "返回"))
|
|
|
|
|
self.ui.Delete_Private_File_Button.setText(_translate("MainWindow", "删除隐私档案"))
|
|
|
|
|
self.ui.Delete_Private_File_Button.setText(_translate("MainWindow", "私密文件粉碎"))
|
|
|
|
|
self.ui.Develop_Tools_Back.setText(_translate("MainWindow", "返回"))
|
|
|
|
|
self.ui.Customize_REG_Command_Button.setText(_translate("MainWindow", "自订REG指令"))
|
|
|
|
|
self.ui.Customize_CMD_Command_Button.setText(_translate("MainWindow", "自订CMD指令"))
|
|
|
|
@@ -517,7 +509,7 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
self.ui.Analyze_EXE_Bit_Button.setText(_translate("MainWindow", "分析文件位元"))
|
|
|
|
|
self.ui.Analyze_EXE_Funtion_Button.setText(_translate("MainWindow", "分析文件函数"))
|
|
|
|
|
self.ui.More_Tools_Back.setText(_translate("MainWindow", "返回"))
|
|
|
|
|
self.ui.Look_for_File_Button.setText(_translate("MainWindow", "寻找本机档案"))
|
|
|
|
|
self.ui.Look_for_File_Button.setText(_translate("MainWindow", "寻找本机文件"))
|
|
|
|
|
self.ui.Encryption_Text_Button.setText(_translate("MainWindow", "加密解密文字"))
|
|
|
|
|
self.ui.Change_Users_Password_Button.setText(_translate("MainWindow", "变更用户密码"))
|
|
|
|
|
self.ui.Internet_location_Query_Button.setText(_translate("MainWindow", "网路位置查询"))
|
|
|
|
@@ -530,7 +522,7 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
self.ui.Customize_CMD_Command_output_title.setText(_translate("MainWindow", "输出:"))
|
|
|
|
|
self.ui.Analyze_EXE_Back.setText(_translate("MainWindow", "返回"))
|
|
|
|
|
self.ui.Look_for_File_Back.setText(_translate("MainWindow", "返回"))
|
|
|
|
|
self.ui.Look_for_File_Run_Button.setText(_translate("MainWindow", "寻找档案"))
|
|
|
|
|
self.ui.Look_for_File_Run_Button.setText(_translate("MainWindow", "寻找文件"))
|
|
|
|
|
self.ui.Encryption_Text_Back.setText(_translate("MainWindow", "返回"))
|
|
|
|
|
self.ui.Encryption_Text_Run_Button.setText(_translate("MainWindow", "加密"))
|
|
|
|
|
self.ui.Encryption_Text_title2.setText(_translate("MainWindow", "加密&解密后"))
|
|
|
|
@@ -546,7 +538,7 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
self.ui.Testers_title.setText(_translate("MainWindow", "测试人员:"))
|
|
|
|
|
self.ui.Testers_Name.setText(_translate("MainWindow", "yang5487"))
|
|
|
|
|
self.ui.PYAS_URL_title.setText(_translate("MainWindow", "官方网站:"))
|
|
|
|
|
self.ui.PYAS_URL.setText(_translate("MainWindow", "<html><head/><body><p><a href=\"https://pyantivirus.wixsite.com/pyas\"><span style=\" text-decoration: underline; color:#0000ff;\">https://pyantivirus.wixsite.com/pyas</span></a></p></body></html>"))
|
|
|
|
|
self.ui.PYAS_URL.setText(_translate("MainWindow", "<html><head/><body><p><a href=\"https://pyantivirus.wixsite.com/pyas\"><span style=\" text-decoration: underline; color:#000000;\">https://pyantivirus.wixsite.com/pyas</span></a></p></body></html>"))
|
|
|
|
|
cy = time.strftime('%Y')
|
|
|
|
|
if int(cy) < 2020:
|
|
|
|
|
cy = str('2020')
|
|
|
|
@@ -593,14 +585,13 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
|
|
|
|
|
def lang_init_zh_tw(self):
|
|
|
|
|
_translate = QtCore.QCoreApplication.translate
|
|
|
|
|
self.ui.State_output.clear()
|
|
|
|
|
if pyas_key():
|
|
|
|
|
self.ui.State_output.clear()
|
|
|
|
|
self.ui.Window_title.setText(_translate("MainWindow", "PYAS V"+pyas_version))
|
|
|
|
|
if not protect_autorun:
|
|
|
|
|
self.ui.State_output.append(str(time.strftime('%Y/%m/%d %H:%M:%S')) + ' > [提示] 尚未啟用實時防護')
|
|
|
|
|
else:
|
|
|
|
|
self.ui.Window_title.setText(_translate("MainWindow", "PYAS V"+pyas_version+" (安全密鑰錯誤)"))
|
|
|
|
|
self.ui.State_output.clear()
|
|
|
|
|
self.ui.State_output.append(str(time.strftime('%Y/%m/%d %H:%M:%S')) + ' > [警告] PYAS 安全密鑰錯誤')
|
|
|
|
|
self.ui.State_Button.setText(_translate("MainWindow", "狀態"))
|
|
|
|
|
self.ui.Virus_Scan_Button.setText(_translate("MainWindow", "掃描"))
|
|
|
|
@@ -631,15 +622,15 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
self.ui.More_Tools_Button.setText(_translate("MainWindow", "更多工具"))
|
|
|
|
|
self.ui.More_Tools_Back_Button.setText(_translate("MainWindow", "工具>"))
|
|
|
|
|
self.ui.System_Process_Manage_Button.setText(_translate("MainWindow", "系統進程管理"))
|
|
|
|
|
self.ui.Repair_System_Permission_Button.setText(_translate("MainWindow", "修復系統權限"))
|
|
|
|
|
self.ui.Repair_System_Files_Button.setText(_translate("MainWindow", "修復系統檔案"))
|
|
|
|
|
self.ui.Clean_System_Files_Button.setText(_translate("MainWindow", "清理系統垃圾"))
|
|
|
|
|
self.ui.Repair_System_Permission_Button.setText(_translate("MainWindow", "系統權限修復"))
|
|
|
|
|
self.ui.Repair_System_Files_Button.setText(_translate("MainWindow", "系統檔案修復"))
|
|
|
|
|
self.ui.Clean_System_Files_Button.setText(_translate("MainWindow", "系統垃圾清理"))
|
|
|
|
|
self.ui.Enable_Safe_Mode_Button.setText(_translate("MainWindow", "啟動安全模式"))
|
|
|
|
|
self.ui.Disable_Safe_Mode_Button.setText(_translate("MainWindow", "關閉安全模式"))
|
|
|
|
|
self.ui.System_Info_Button.setText(_translate("MainWindow", "系統版本資訊"))
|
|
|
|
|
self.ui.System_Tools_Back.setText(_translate("MainWindow", "返回"))
|
|
|
|
|
self.ui.Privacy_Tools_Back.setText(_translate("MainWindow", "返回"))
|
|
|
|
|
self.ui.Delete_Private_File_Button.setText(_translate("MainWindow", "刪除隱私檔案"))
|
|
|
|
|
self.ui.Delete_Private_File_Button.setText(_translate("MainWindow", "私密檔案粉碎"))
|
|
|
|
|
self.ui.Develop_Tools_Back.setText(_translate("MainWindow", "返回"))
|
|
|
|
|
self.ui.Customize_REG_Command_Button.setText(_translate("MainWindow", "自訂REG指令"))
|
|
|
|
|
self.ui.Customize_CMD_Command_Button.setText(_translate("MainWindow", "自訂CMD指令"))
|
|
|
|
@@ -676,7 +667,7 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
self.ui.Testers_title.setText(_translate("MainWindow", "測試人員:"))
|
|
|
|
|
self.ui.Testers_Name.setText(_translate("MainWindow", "yang5487"))
|
|
|
|
|
self.ui.PYAS_URL_title.setText(_translate("MainWindow", "官方網站:"))
|
|
|
|
|
self.ui.PYAS_URL.setText(_translate("MainWindow", "<html><head/><body><p><a href=\"https://pyantivirus.wixsite.com/pyas\"><span style=\" text-decoration: underline; color:#0000ff;\">https://pyantivirus.wixsite.com/pyas</span></a></p></body></html>"))
|
|
|
|
|
self.ui.PYAS_URL.setText(_translate("MainWindow", "<html><head/><body><p><a href=\"https://pyantivirus.wixsite.com/pyas\"><span style=\" text-decoration: underline; color:#000000;\">https://pyantivirus.wixsite.com/pyas</span></a></p></body></html>"))
|
|
|
|
|
cy = time.strftime('%Y')
|
|
|
|
|
if int(cy) < 2020:
|
|
|
|
|
cy = str('2020')
|
|
|
|
@@ -719,10 +710,10 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
self.ui.Theme_Green.setText(_translate("MainWindow", "綠色主題"))
|
|
|
|
|
self.ui.Theme_Blue.setText(_translate("MainWindow", "藍色主題"))
|
|
|
|
|
|
|
|
|
|
##################################### 繁簡中翻譯 ####################################
|
|
|
|
|
####################################### 翻譯 #####################################
|
|
|
|
|
|
|
|
|
|
def text_Translate(self,text):
|
|
|
|
|
if self.language == "zh_CN":
|
|
|
|
|
def text_Translate(self, text):
|
|
|
|
|
if self.pyasConfig['language'] == "zh_CN":
|
|
|
|
|
text = text.replace("嗎","吗")
|
|
|
|
|
text = text.replace("項","项")
|
|
|
|
|
text = text.replace("護","护")
|
|
|
|
@@ -734,6 +725,7 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
text = text.replace("當","当")
|
|
|
|
|
text = text.replace("確","确")
|
|
|
|
|
text = text.replace("復","复")
|
|
|
|
|
text = text.replace("檔案","文件")
|
|
|
|
|
text = text.replace("錯誤","错误")
|
|
|
|
|
text = text.replace("實時","实时")
|
|
|
|
|
text = text.replace("發現","发现")
|
|
|
|
@@ -745,9 +737,8 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
text = text.replace("開啟","开启")
|
|
|
|
|
text = text.replace("關閉","关闭")
|
|
|
|
|
return text
|
|
|
|
|
elif self.language == "english":
|
|
|
|
|
translator = english_list[text]
|
|
|
|
|
return translator
|
|
|
|
|
elif self.pyasConfig['language'] == "english":
|
|
|
|
|
return english_list[text]
|
|
|
|
|
else:
|
|
|
|
|
return text
|
|
|
|
|
|
|
|
|
@@ -785,12 +776,11 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
self.anim2.start()
|
|
|
|
|
|
|
|
|
|
def Change_animation_3(self,widget,time):#這裡是設定透明度
|
|
|
|
|
if 1:#self.Virus_Scan != 1:
|
|
|
|
|
self.opacity = QtWidgets.QGraphicsOpacityEffect()
|
|
|
|
|
self.opacity.setOpacity(0)
|
|
|
|
|
widget.setGraphicsEffect(self.opacity)
|
|
|
|
|
widget.setAutoFillBackground(True)
|
|
|
|
|
self.draw(widget=widget,time=time)
|
|
|
|
|
self.opacity = QtWidgets.QGraphicsOpacityEffect()#if self.Virus_Scan != 1:
|
|
|
|
|
self.opacity.setOpacity(0)
|
|
|
|
|
widget.setGraphicsEffect(self.opacity)
|
|
|
|
|
widget.setAutoFillBackground(True)
|
|
|
|
|
self.draw(widget=widget,time=time)
|
|
|
|
|
|
|
|
|
|
def Change_animation_4(self,widget,time,ny,ny2):
|
|
|
|
|
x = widget.pos().x()
|
|
|
|
@@ -819,7 +809,7 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
self.opacity.setOpacity(self.opacity.i/100)
|
|
|
|
|
widget.setGraphicsEffect(self.opacity)
|
|
|
|
|
self.opacity.i += 1
|
|
|
|
|
if self.opacity.i >= 100:
|
|
|
|
|
if self.opacity.i > 100:
|
|
|
|
|
self.timer.stop()
|
|
|
|
|
self.timer.deleteLater()
|
|
|
|
|
self.timer = QTimer()
|
|
|
|
@@ -962,7 +952,7 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
QApplication.processEvents()
|
|
|
|
|
try:
|
|
|
|
|
os.remove(str(line))
|
|
|
|
|
except Exception as e:
|
|
|
|
|
except:
|
|
|
|
|
continue
|
|
|
|
|
self.ui.Virus_Scan_text.setText(self.text_Translate('✔成功: 已執行成功。'))
|
|
|
|
|
self.ui.Virus_Scan_Solve_Button.hide()
|
|
|
|
@@ -970,9 +960,9 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
self.ui.State_title.setText(self.text_Translate("這部裝置已受到保護"))
|
|
|
|
|
self.Safe = True
|
|
|
|
|
except Exception as e:
|
|
|
|
|
self.ui.Virus_Scan_text.setText(self.text_Translate("✖錯誤: 執行失敗。"))
|
|
|
|
|
pyas_bug_log(e)
|
|
|
|
|
self.Safe = False
|
|
|
|
|
self.ui.Virus_Scan_text.setText(self.text_Translate("✖錯誤: 執行失敗。"))
|
|
|
|
|
|
|
|
|
|
def list_allfile(self,path,all_files):
|
|
|
|
|
try:
|
|
|
|
@@ -997,6 +987,7 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
f.close()
|
|
|
|
|
return True#回傳是病毒
|
|
|
|
|
else:
|
|
|
|
|
f.close()
|
|
|
|
|
return False#回傳不是病毒
|
|
|
|
|
except:
|
|
|
|
|
return False#回傳不是病毒
|
|
|
|
@@ -1024,7 +1015,6 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
self.ui.Virus_Scan_output.setModel(self.Virus_List_output)
|
|
|
|
|
except Exception as e:
|
|
|
|
|
pyas_bug_log(e)
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
#定義讀取紀錄
|
|
|
|
|
def pyas_scan_read_en(self):
|
|
|
|
@@ -1054,8 +1044,8 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
return self.text_Translate('✔當前未發現惡意軟體。')
|
|
|
|
|
|
|
|
|
|
def pyas_scan_answer_en(self):
|
|
|
|
|
self.ui.Virus_Scan_text.setText(self.pyas_scan_read_en())
|
|
|
|
|
try:
|
|
|
|
|
self.ui.Virus_Scan_text.setText(self.pyas_scan_read_en())
|
|
|
|
|
ft = open('Library/PYAS/Temp/PYASV.tmp','r',encoding='utf-8')
|
|
|
|
|
self.lines = ft.readlines()
|
|
|
|
|
ft.close()
|
|
|
|
@@ -1135,11 +1125,6 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
self.ui.Virus_Scan_choose_widget.hide()
|
|
|
|
|
self.ui.Virus_Scan_Solve_Button.hide()
|
|
|
|
|
self.ui.Virus_Scan_ProgressBar.hide()
|
|
|
|
|
self.ini_config = RawConfigParser()
|
|
|
|
|
try:
|
|
|
|
|
self.ini_config.read(r"Library/PYAS/Setup/PYAS.ini")
|
|
|
|
|
except:
|
|
|
|
|
pass
|
|
|
|
|
self.Virus_List = []
|
|
|
|
|
self.Virus_List_output=QStringListModel()
|
|
|
|
|
self.Virus_List_output.setStringList(self.Virus_List)
|
|
|
|
@@ -1170,7 +1155,7 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
pyas_bug_log(e)
|
|
|
|
|
QMessageBox.critical(self,self.text_Translate('錯誤'),self.text_Translate('錯誤: ')+str(e),QMessageBox.Ok)
|
|
|
|
|
|
|
|
|
|
def pyas_scan_path_en(self,path,rfp,rfn,fts):
|
|
|
|
|
def pyas_scan_path_en(self, path, rfp, rfn, fts):
|
|
|
|
|
try:
|
|
|
|
|
for fd in os.listdir(path):#遍歷檔案
|
|
|
|
|
try:
|
|
|
|
@@ -1318,7 +1303,6 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
win32api.RegDeleteValue(key,i)#刪除值
|
|
|
|
|
except Exception as e:
|
|
|
|
|
pyas_bug_log(e)
|
|
|
|
|
pass
|
|
|
|
|
win32api.RegCloseKey(key)#關閉已打開的鍵
|
|
|
|
|
try:
|
|
|
|
|
key = win32api.RegOpenKey(win32con.HKEY_LOCAL_MACHINE,'SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer',0,win32con.KEY_ALL_ACCESS)
|
|
|
|
@@ -1333,7 +1317,6 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
win32api.RegDeleteValue(key,i)
|
|
|
|
|
except Exception as e:
|
|
|
|
|
pyas_bug_log(e)
|
|
|
|
|
pass
|
|
|
|
|
win32api.RegCloseKey(key)
|
|
|
|
|
Permission = ['DisableTaskMgr', 'DisableRegistryTools', 'DisableChangePassword', 'Wallpaper']
|
|
|
|
|
try:
|
|
|
|
@@ -1348,7 +1331,6 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
win32api.RegDeleteValue(key,i)
|
|
|
|
|
except Exception as e:
|
|
|
|
|
pyas_bug_log(e)
|
|
|
|
|
pass
|
|
|
|
|
win32api.RegCloseKey(key)
|
|
|
|
|
try:
|
|
|
|
|
key = win32api.RegOpenKey(win32con.HKEY_LOCAL_MACHINE,'SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System',0,win32con.KEY_ALL_ACCESS)
|
|
|
|
@@ -1362,7 +1344,6 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
win32api.RegDeleteValue(key,i)
|
|
|
|
|
except Exception as e:
|
|
|
|
|
pyas_bug_log(e)
|
|
|
|
|
pass
|
|
|
|
|
win32api.RegCloseKey(key)
|
|
|
|
|
Permission = ['NoComponents', 'NoAddingComponents']
|
|
|
|
|
try:
|
|
|
|
@@ -1377,7 +1358,6 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
win32api.RegDeleteValue(key,i)
|
|
|
|
|
except Exception as e:
|
|
|
|
|
pyas_bug_log(e)
|
|
|
|
|
pass
|
|
|
|
|
win32api.RegCloseKey(key)
|
|
|
|
|
try:
|
|
|
|
|
key = win32api.RegOpenKey(win32con.HKEY_CURRENT_USER,'SOFTWARE\Policies\Microsoft\Windows\System',0,win32con.KEY_ALL_ACCESS)
|
|
|
|
@@ -1390,7 +1370,6 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
win32api.RegDeleteValue(key, 'DisableCMD')
|
|
|
|
|
except Exception as e:
|
|
|
|
|
pyas_bug_log(e)
|
|
|
|
|
pass
|
|
|
|
|
win32api.RegCloseKey(key)
|
|
|
|
|
try:
|
|
|
|
|
key = win32api.RegOpenKey(win32con.HKEY_LOCAL_MACHINE,'SOFTWARE\Policies\Microsoft\Windows\System',0,win32con.KEY_ALL_ACCESS)
|
|
|
|
@@ -1403,7 +1382,6 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
win32api.RegDeleteValue(key, 'DisableCMD')
|
|
|
|
|
except Exception as e:
|
|
|
|
|
pyas_bug_log(e)
|
|
|
|
|
pass
|
|
|
|
|
win32api.RegCloseKey(key)
|
|
|
|
|
try:
|
|
|
|
|
key = win32api.RegOpenKey(win32con.HKEY_CURRENT_USER,'Software\Policies\Microsoft\MMC\{8FC0B734-A0E1-11D1-A7D3-0000F87571E3}',0,win32con.KEY_ALL_ACCESS)
|
|
|
|
@@ -1422,31 +1400,30 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
win32api.RegDeleteValue(key, 'Restrict_Run')
|
|
|
|
|
except Exception as e:
|
|
|
|
|
pyas_bug_log(e)
|
|
|
|
|
pass
|
|
|
|
|
win32api.RegCloseKey(key)
|
|
|
|
|
QMessageBox.information(self,self.text_Translate('完成'),self.text_Translate("修復完成!"),QMessageBox.Ok,QMessageBox.Ok)
|
|
|
|
|
except Exception as e:
|
|
|
|
|
QMessageBox.critical(self,self.text_Translate('錯誤'),self.text_Translate('錯誤: ')+str(e),QMessageBox.Ok)
|
|
|
|
|
|
|
|
|
|
def Repair_System_Files(self):
|
|
|
|
|
question = QMessageBox.warning(self,self.text_Translate("修復系統檔案"),self.text_Translate("您確定要修復系統檔案嗎?"),QMessageBox.Yes|QMessageBox.No,QMessageBox.Yes)
|
|
|
|
|
if question == 16384:
|
|
|
|
|
runc = os.system('start sfc /scannow')
|
|
|
|
|
try:
|
|
|
|
|
try:
|
|
|
|
|
question = QMessageBox.warning(self,self.text_Translate("修復系統檔案"),self.text_Translate("您確定要修復系統檔案嗎?"),QMessageBox.Yes|QMessageBox.No,QMessageBox.Yes)
|
|
|
|
|
if question == 16384:
|
|
|
|
|
runc = os.system('start sfc /scannow')
|
|
|
|
|
if runc != 0:
|
|
|
|
|
QMessageBox.critical(self,self.text_Translate('錯誤'),self.text_Translate('錯誤: ')+self.text_Translate("修復失敗"),QMessageBox.Ok)
|
|
|
|
|
except Exception as e:
|
|
|
|
|
pyas_bug_log(e)
|
|
|
|
|
except Exception as e:
|
|
|
|
|
pyas_bug_log(e)
|
|
|
|
|
|
|
|
|
|
def Clean_System_Files(self):
|
|
|
|
|
question = QMessageBox.warning(self,self.text_Translate('清理系統檔案'),self.text_Translate("您確定要清理系統檔案嗎?"),QMessageBox.Yes|QMessageBox.No,QMessageBox.Yes)
|
|
|
|
|
if question == 16384:
|
|
|
|
|
runc = os.system('start cleanmgr')
|
|
|
|
|
try:
|
|
|
|
|
try:
|
|
|
|
|
question = QMessageBox.warning(self,self.text_Translate('清理系統檔案'),self.text_Translate("您確定要清理系統檔案嗎?"),QMessageBox.Yes|QMessageBox.No,QMessageBox.Yes)
|
|
|
|
|
if question == 16384:
|
|
|
|
|
runc = os.system('start cleanmgr')
|
|
|
|
|
if runc != 0:
|
|
|
|
|
QMessageBox.critical(self,self.text_Translate('錯誤'),self.text_Translate('錯誤: ')+self.text_Translate("清理失敗"),QMessageBox.Ok)
|
|
|
|
|
except Exception as e:
|
|
|
|
|
pyas_bug_log(e)
|
|
|
|
|
except Exception as e:
|
|
|
|
|
pyas_bug_log(e)
|
|
|
|
|
|
|
|
|
|
def Enable_Safe_Mode(self):
|
|
|
|
|
question = QMessageBox.warning(self,self.text_Translate('啟用安全模式'),self.text_Translate("您確定啟用安全模式嗎?"),QMessageBox.Yes|QMessageBox.No,QMessageBox.Yes)
|
|
|
|
@@ -1524,8 +1501,7 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
out = p.stdout.read()
|
|
|
|
|
try:
|
|
|
|
|
self.ui.Customize_CMD_Command_output.setText(str(out.decode('utf-8')))
|
|
|
|
|
except Exception as e:
|
|
|
|
|
pyas_bug_log(e)
|
|
|
|
|
except:
|
|
|
|
|
self.ui.Customize_CMD_Command_output.setText(str(out))
|
|
|
|
|
QMessageBox.information(self,self.text_Translate("完成"),self.text_Translate("運行成功"),QMessageBox.Ok,QMessageBox.Ok)
|
|
|
|
|
except Exception as e:
|
|
|
|
@@ -1635,12 +1611,18 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
QApplication.processEvents()
|
|
|
|
|
|
|
|
|
|
def Look_for_File(self):
|
|
|
|
|
File_Name = self.ui.Look_for_File_input.text()
|
|
|
|
|
if File_Name != "":
|
|
|
|
|
self.find_files_info_zh(File_Name)
|
|
|
|
|
else:
|
|
|
|
|
QMessageBox.information(self,self.text_Translate("提示"),'['+self.text_Translate("提示")+'] '+self.text_Translate("請輸入需要尋找的檔案"),QMessageBox.Ok)
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
os.remove('Library/PYAS/Temp/PYASF.tmp')
|
|
|
|
|
except:
|
|
|
|
|
pass
|
|
|
|
|
try:
|
|
|
|
|
File_Name = self.ui.Look_for_File_input.text()
|
|
|
|
|
if File_Name != "":
|
|
|
|
|
self.find_files_info_zh(File_Name)
|
|
|
|
|
else:
|
|
|
|
|
QMessageBox.information(self,self.text_Translate("提示"),'['+self.text_Translate("提示")+'] '+self.text_Translate("請輸入需要尋找的檔案"),QMessageBox.Ok)
|
|
|
|
|
except Exception as e:
|
|
|
|
|
pyas_bug_log(e)
|
|
|
|
|
|
|
|
|
|
def find_files_info_zh(self,ffile):
|
|
|
|
|
try:
|
|
|
|
@@ -1661,19 +1643,13 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
QMessageBox.critical(self,self.text_Translate('錯誤'),self.text_Translate('錯誤: ')+self.text_Translate('未找到檔案'),QMessageBox.Ok)
|
|
|
|
|
except Exception as e:
|
|
|
|
|
pyas_bug_log(e)
|
|
|
|
|
pass
|
|
|
|
|
try:
|
|
|
|
|
os.remove('Library/PYAS/Temp/PYASF.tmp')
|
|
|
|
|
except Exception as e:
|
|
|
|
|
pyas_bug_log(e)
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
def findfile_zh(self,path,ffile):
|
|
|
|
|
try:
|
|
|
|
|
self.ui.Look_for_File_output.setText(self.text_Translate('正在尋找: ')+str(path))
|
|
|
|
|
QApplication.processEvents()
|
|
|
|
|
for fd in os.listdir(path):
|
|
|
|
|
try:
|
|
|
|
|
QApplication.processEvents()
|
|
|
|
|
fullpath = str(os.path.join(path,fd)).replace("\\", "/")
|
|
|
|
|
if ':/Windows' in fullpath or ':/$Recycle.Bin' in fullpath or ':/ProgramData' in fullpath or 'AppData' in fullpath or 'PerfLogs' in fullpath:
|
|
|
|
|
pass
|
|
|
|
@@ -1767,7 +1743,6 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
s.close()
|
|
|
|
|
except Exception as e:
|
|
|
|
|
pyas_bug_log(e)
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
def reset_network(self):
|
|
|
|
|
if QMessageBox.warning(self,self.text_Translate("警告"),self.text_Translate("您確定要重置網路配置嗎?"),QMessageBox.Yes|QMessageBox.No) == 16384:
|
|
|
|
@@ -1799,19 +1774,18 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
p.kill()
|
|
|
|
|
except Exception as e:
|
|
|
|
|
pyas_bug_log(e)
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
##################################### 實時防護 #####################################
|
|
|
|
|
|
|
|
|
|
def protect_threading_init_zh(self):
|
|
|
|
|
pyasp_remove()
|
|
|
|
|
self.Virus_Scan = 0
|
|
|
|
|
self.ui.State_output.clear()
|
|
|
|
|
if self.ui.Protection_switch_Button.text() == self.text_Translate("已開啟"):
|
|
|
|
|
self.ui.Protection_switch_Button.setText(self.text_Translate("已關閉"))
|
|
|
|
|
self.ui.Protection_switch_Button.setStyleSheet("""
|
|
|
|
|
QPushButton{border:none;background-color:rgba(20,20,20,30);border-radius: 15px;}
|
|
|
|
|
QPushButton:hover{background-color:rgba(20,20,20,50);}""")
|
|
|
|
|
self.Virus_Scan = 0
|
|
|
|
|
self.ui.State_output.clear()
|
|
|
|
|
self.ui.State_output.append(str(time.strftime('%Y/%m/%d %H:%M:%S')) + self.text_Translate(' > [提示] 尚未啟用實時防護'))
|
|
|
|
|
QApplication.processEvents()
|
|
|
|
|
elif self.ui.Protection_switch_Button.text() == self.text_Translate("已开启"):
|
|
|
|
@@ -1819,13 +1793,10 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
self.ui.Protection_switch_Button.setStyleSheet("""
|
|
|
|
|
QPushButton{border:none;background-color:rgba(20,20,20,30);border-radius: 15px;}
|
|
|
|
|
QPushButton:hover{background-color:rgba(20,20,20,50);}""")
|
|
|
|
|
self.Virus_Scan = 0
|
|
|
|
|
self.ui.State_output.clear()
|
|
|
|
|
self.ui.State_output.append(str(time.strftime('%Y/%m/%d %H:%M:%S')) + self.text_Translate(' > [提示] 尚未啟用實時防護'))
|
|
|
|
|
self.ui.State_output.append(str(time.strftime('%Y/%m/%d %H:%M:%S')) + self.text_Translate(' > [提示] 尚未启用实时防护'))
|
|
|
|
|
QApplication.processEvents()
|
|
|
|
|
else:
|
|
|
|
|
if pyas_key():
|
|
|
|
|
self.ui.State_output.clear()
|
|
|
|
|
self.ui.Protection_illustrate.setText(self.text_Translate("正在初始化中,請稍後..."))
|
|
|
|
|
QApplication.processEvents()
|
|
|
|
|
Thread(target = self.pyas_protect_init_zh).start()
|
|
|
|
@@ -1833,14 +1804,16 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
QMessageBox.critical(self,self.text_Translate('錯誤'),self.text_Translate('錯誤: ')+self.text_Translate('安全密鑰錯誤'),QMessageBox.Ok)
|
|
|
|
|
|
|
|
|
|
def pyas_protect_init_zh(self):
|
|
|
|
|
print('[INFO] Start Action (Real-time Protect)')
|
|
|
|
|
try:
|
|
|
|
|
ft = open('Library/PYAS/Temp/PYASP.tmp','w',encoding='utf-8')
|
|
|
|
|
ft.write('real-time protect ini file, dont remove it')
|
|
|
|
|
ft.write('Protect temp file, dont remove it')
|
|
|
|
|
ft.close()
|
|
|
|
|
except:
|
|
|
|
|
pass
|
|
|
|
|
self.Virus_Scan = 1
|
|
|
|
|
print('[INFO] Start Action (Real-time Protect)')
|
|
|
|
|
if not pyas_key():
|
|
|
|
|
return
|
|
|
|
|
if self.ui.Protection_switch_Button.text() == self.text_Translate("已關閉"):
|
|
|
|
|
self.ui.Protection_illustrate.setText(self.text_Translate("啟用該選項可以實時監控進程中的惡意軟體並清除。"))
|
|
|
|
|
self.ui.Protection_switch_Button.setText(self.text_Translate("已開啟"))
|
|
|
|
@@ -1859,21 +1832,18 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
time.sleep(0.0001)
|
|
|
|
|
QApplication.processEvents()
|
|
|
|
|
file = str(p.exe())
|
|
|
|
|
if '' == file or 'C:\Windows' in file or 'C:\Program' in file or 'AppData' in file or 'MemCompression' in file or 'Registry' in file:
|
|
|
|
|
if '' == file or 'C:\Windows' in file or 'C:\Program' in file or 'AppData' in file or 'MemCompression' in file or 'Registry' in file or 'PYAS' in file:
|
|
|
|
|
pass
|
|
|
|
|
else:
|
|
|
|
|
if self.pyas_sign_start(file) and 'PYAS' not in file:
|
|
|
|
|
try:
|
|
|
|
|
if subprocess.call('taskkill /f /im "'+str(p.name())+'" /t',shell=True) == 0:
|
|
|
|
|
print('[INFO] Malware blocking success: '+str(p.name()))
|
|
|
|
|
self.ui.State_output.append(self.text_Translate('{} > [實時防護] 成功攔截了一個惡意軟體:').format(str(time.strftime('%Y/%m/%d %H:%M:%S')))+str(p.name()))
|
|
|
|
|
ToastNotifier().show_toast("PYAS Security",self.text_Translate('{} > [實時防護] 成功攔截了一個惡意軟體:').format(str(time.strftime('%Y/%m/%d %H:%M:%S')))+str(p.name()),icon_path="Library/PYAS/Icon/ICON.ico",threaded=True)
|
|
|
|
|
else:
|
|
|
|
|
print('[INFO] Malware blocking failed: '+str(p.name()))
|
|
|
|
|
self.ui.State_output.append(self.text_Translate('{} > [實時防護] 惡意軟體攔截失敗:').format(time.strftime('%Y/%m/%d %H:%M:%S'))+str(p.name()))
|
|
|
|
|
ToastNotifier().show_toast("PYAS Security",self.text_Translate('{} > [實時防護] 惡意軟體攔截失敗:').format(str(time.strftime('%Y/%m/%d %H:%M:%S')))+str(p.name()),icon_path="Library/PYAS/Icon/ICON.ico",threaded=True)
|
|
|
|
|
except:
|
|
|
|
|
pass
|
|
|
|
|
if self.pyas_sign_start(file):
|
|
|
|
|
if subprocess.call('taskkill /f /im "'+str(p.name())+'" /t',shell=True) == 0:
|
|
|
|
|
print('[INFO] Malware blocking success: '+str(p.name()))
|
|
|
|
|
self.ui.State_output.append(self.text_Translate('{} > [實時防護] 成功攔截了一個惡意軟體:').format(str(time.strftime('%Y/%m/%d %H:%M:%S')))+str(p.name()))
|
|
|
|
|
ToastNotifier().show_toast("PYAS Security",self.text_Translate('{} > [實時防護] 成功攔截了一個惡意軟體:').format(str(time.strftime('%Y/%m/%d %H:%M:%S')))+str(p.name()),icon_path="Library/PYAS/Icon/ICON.ico",threaded=True)
|
|
|
|
|
else:
|
|
|
|
|
print('[INFO] Malware blocking failed: '+str(p.name()))
|
|
|
|
|
self.ui.State_output.append(self.text_Translate('{} > [實時防護] 惡意軟體攔截失敗:').format(time.strftime('%Y/%m/%d %H:%M:%S'))+str(p.name()))
|
|
|
|
|
ToastNotifier().show_toast("PYAS Security",self.text_Translate('{} > [實時防護] 惡意軟體攔截失敗:').format(str(time.strftime('%Y/%m/%d %H:%M:%S')))+str(p.name()),icon_path="Library/PYAS/Icon/ICON.ico",threaded=True)
|
|
|
|
|
except:
|
|
|
|
|
continue
|
|
|
|
|
|
|
|
|
@@ -1906,52 +1876,30 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
self.Change_animation5(self.ui.Setting_widget,10,50,831,481)
|
|
|
|
|
|
|
|
|
|
def Show_Virus_Scan_Progress_Bar_switch(self):
|
|
|
|
|
try:
|
|
|
|
|
self.ini_config = RawConfigParser()
|
|
|
|
|
self.ini_config.read(r"Library/PYAS/Setup/PYAS.ini")
|
|
|
|
|
except Exception as e:
|
|
|
|
|
pyas_bug_log(e)
|
|
|
|
|
try:
|
|
|
|
|
sw_state = self.ui.Show_Virus_Scan_Progress_Bar_switch_Button.text()
|
|
|
|
|
if sw_state == self.text_Translate("已關閉"):
|
|
|
|
|
self.ini_config.set("Setting", "high_sensitivity", 1)
|
|
|
|
|
self.ini_config.write(open(r"Library/PYAS/Setup/PYAS.ini", 'w'))
|
|
|
|
|
self.pyasConfig['high_sensitivity'] = 1
|
|
|
|
|
self.writeConfig(self.pyasConfig)
|
|
|
|
|
self.ui.Show_Virus_Scan_Progress_Bar_switch_Button.setText(self.text_Translate("已開啟"))
|
|
|
|
|
self.ui.Show_Virus_Scan_Progress_Bar_switch_Button.setStyleSheet("""
|
|
|
|
|
QPushButton{border:none;background-color:rgba(20,200,20,100);border-radius: 15px;}
|
|
|
|
|
QPushButton:hover{background-color:rgba(20,200,20,120);}""")
|
|
|
|
|
self.show_virus_scan_progress_bar = 1
|
|
|
|
|
elif sw_state == self.text_Translate("已開啟"):
|
|
|
|
|
self.ini_config.set("Setting", "high_sensitivity", 0)
|
|
|
|
|
self.ini_config.write(open(r"Library/PYAS/Setup/PYAS.ini", 'w'))
|
|
|
|
|
self.pyasConfig['high_sensitivity'] = 0
|
|
|
|
|
self.writeConfig(self.pyasConfig)
|
|
|
|
|
self.ui.Show_Virus_Scan_Progress_Bar_switch_Button.setText(self.text_Translate("已關閉"))
|
|
|
|
|
self.ui.Show_Virus_Scan_Progress_Bar_switch_Button.setStyleSheet("""
|
|
|
|
|
QPushButton{border:none;background-color:rgba(20,20,20,30);border-radius: 15px;}
|
|
|
|
|
QPushButton:hover{background-color:rgba(20,20,20,50);}""")
|
|
|
|
|
self.show_virus_scan_progress_bar = 0
|
|
|
|
|
if sw_state == self.text_Translate("已关闭"):
|
|
|
|
|
self.ini_config.set("Setting", "high_sensitivity", 1)
|
|
|
|
|
self.ini_config.write(open(r"Library/PYAS/Setup/PYAS.ini", 'w'))
|
|
|
|
|
self.ui.Show_Virus_Scan_Progress_Bar_switch_Button.setText(self.text_Translate("已开启"))
|
|
|
|
|
self.ui.Show_Virus_Scan_Progress_Bar_switch_Button.setStyleSheet("""
|
|
|
|
|
QPushButton{border:none;background-color:rgba(20,200,20,100);border-radius: 15px;}
|
|
|
|
|
QPushButton:hover{background-color:rgba(20,200,20,120);}""")
|
|
|
|
|
self.show_virus_scan_progress_bar = 1
|
|
|
|
|
elif sw_state == self.text_Translate("已开启"):
|
|
|
|
|
self.ini_config.set("Setting", "high_sensitivity", 0)
|
|
|
|
|
self.ini_config.write(open(r"Library/PYAS/Setup/PYAS.ini", 'w'))
|
|
|
|
|
self.ui.Show_Virus_Scan_Progress_Bar_switch_Button.setText(self.text_Translate("已关闭"))
|
|
|
|
|
self.ui.Show_Virus_Scan_Progress_Bar_switch_Button.setStyleSheet("""
|
|
|
|
|
QPushButton{border:none;background-color:rgba(20,20,20,30);border-radius: 15px;}
|
|
|
|
|
QPushButton:hover{background-color:rgba(20,20,20,50);}""")
|
|
|
|
|
self.show_virus_scan_progress_bar = 0
|
|
|
|
|
else:
|
|
|
|
|
pass
|
|
|
|
|
except:
|
|
|
|
|
try:
|
|
|
|
|
with open(r"Library/PYAS/Setup/PYAS.ini",mode="w",encoding="utf-8") as file:
|
|
|
|
|
file.write("[Setting]\nhigh_sensitivity = 0\nlanguage = english")
|
|
|
|
|
file.close()
|
|
|
|
|
config = {'high_sensitivity': 0,'language': 'english'}
|
|
|
|
|
self.writeConfig(config)
|
|
|
|
|
except Exception as e:
|
|
|
|
|
pyas_bug_log(e)
|
|
|
|
|
|
|
|
|
@@ -1959,27 +1907,20 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
|
|
|
|
|
def Change_language(self):
|
|
|
|
|
try:
|
|
|
|
|
self.ini_config = RawConfigParser()
|
|
|
|
|
self.ini_config.read(r"Library/PYAS/Setup/PYAS.ini")
|
|
|
|
|
if self.ui.Language_Traditional_Chinese.isChecked():
|
|
|
|
|
self.lang_init_zh_tw()
|
|
|
|
|
self.language = "zh_TW"
|
|
|
|
|
self.ini_config.set("Setting", "language", "zh_TW")
|
|
|
|
|
self.pyasConfig['language'] = "zh_TW"
|
|
|
|
|
self.writeConfig(self.pyasConfig)
|
|
|
|
|
elif self.ui.Language_Simplified_Chinese.isChecked():
|
|
|
|
|
self.lang_init_zh_cn()
|
|
|
|
|
self.language = "zh_CN"
|
|
|
|
|
self.ini_config.set("Setting", "language", "zh_CN")
|
|
|
|
|
self.pyasConfig['language'] = "zh_CN"
|
|
|
|
|
self.writeConfig(self.pyasConfig)
|
|
|
|
|
else:
|
|
|
|
|
self.lang_init_en()
|
|
|
|
|
self.language = "english"
|
|
|
|
|
self.ini_config.set("Setting", "language", "english")
|
|
|
|
|
self.pyasConfig['language'] = "english"
|
|
|
|
|
self.writeConfig(self.pyasConfig)
|
|
|
|
|
except Exception as e:
|
|
|
|
|
pyas_bug_log(e)
|
|
|
|
|
try:
|
|
|
|
|
self.ini_config.write(open(r"Library/PYAS/Setup/PYAS.ini", 'w'))
|
|
|
|
|
except Exception as e:
|
|
|
|
|
pyas_bug_log(e)
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
##################################### 主題顏色 #####################################
|
|
|
|
|
|
|
|
|
@@ -1988,29 +1929,24 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
self.ui.Window_widget.setStyleSheet("""QWidget#Window_widget {background-color:rgba(255,140,140,200);}""")
|
|
|
|
|
self.ui.Navigation_Bar.setStyleSheet("""QWidget#Navigation_Bar {background-color:rgba(255,130,130,200);}""")
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
elif self.ui.Theme_White.isChecked():
|
|
|
|
|
self.ui.Window_widget.setStyleSheet("""QWidget#Window_widget {background-color:rgb(240,240,240);}""")
|
|
|
|
|
self.ui.Navigation_Bar.setStyleSheet("""QWidget#Navigation_Bar {background-color:rgb(230,230,230);}""")
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
elif self.ui.Theme_Black.isChecked():
|
|
|
|
|
self.ui.Window_widget.setStyleSheet("""QWidget#Window_widget {background-color:rgba(90,90,90,130);}""")
|
|
|
|
|
self.ui.Navigation_Bar.setStyleSheet("""QWidget#Navigation_Bar {background-color:rgba(80,80,80,150);}""")
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
elif self.ui.Theme_Green.isChecked():
|
|
|
|
|
self.ui.Window_widget.setStyleSheet("""QWidget#Window_widget {background-color:rgba(120,240,130,180);}""")
|
|
|
|
|
self.ui.Navigation_Bar.setStyleSheet("""QWidget#Navigation_Bar {background-color:rgba(100,240,110,200);}""")
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
elif self.ui.Theme_Pink.isChecked():
|
|
|
|
|
from random import randrange
|
|
|
|
|
r,g,b = randrange(50, 250),randrange(50, 250),randrange(50, 250)
|
|
|
|
|
self.ui.Window_widget.setStyleSheet("""QWidget#Window_widget {background-color:rgba("""+str(r)+""","""+str(g)+""","""+str(b)+""",240);}""")
|
|
|
|
|
self.ui.Navigation_Bar.setStyleSheet("""QWidget#Navigation_Bar {background-color:rgba("""+str(r-20)+""","""+str(g-20)+""","""+str(b-20)+""",240);}""")
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
elif self.ui.Theme_Blue.isChecked():
|
|
|
|
|
self.ui.Window_widget.setStyleSheet("""QWidget#Window_widget {background-color:rgba(0,120,240,100);}""")
|
|
|
|
|
self.ui.Navigation_Bar.setStyleSheet("""QWidget#Navigation_Bar {background-color:rgba(0,120,240,120);}""")
|
|
|
|
@@ -2026,8 +1962,8 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
self.m_Position=event.globalPos()-self.pos() #獲取鼠標相對窗口的位置
|
|
|
|
|
event.accept()
|
|
|
|
|
while self.ui.pyas_opacity > 60 and self.m_flag == True:
|
|
|
|
|
time.sleep(0.01)
|
|
|
|
|
self.ui.pyas_opacity -= 2
|
|
|
|
|
time.sleep(0.003)
|
|
|
|
|
self.ui.pyas_opacity -= 1
|
|
|
|
|
window.setWindowOpacity(self.ui.pyas_opacity/100)
|
|
|
|
|
QApplication.processEvents()
|
|
|
|
|
|
|
|
|
@@ -2044,8 +1980,8 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
self.m_flag=False
|
|
|
|
|
self.setCursor(QCursor(Qt.ArrowCursor))
|
|
|
|
|
while self.ui.pyas_opacity < 100 and self.m_flag == False:
|
|
|
|
|
time.sleep(0.01)
|
|
|
|
|
self.ui.pyas_opacity += 2
|
|
|
|
|
time.sleep(0.003)
|
|
|
|
|
self.ui.pyas_opacity += 1
|
|
|
|
|
window.setWindowOpacity(self.ui.pyas_opacity/100)
|
|
|
|
|
QApplication.processEvents()
|
|
|
|
|
|
|
|
|
@@ -2061,21 +1997,33 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
|
|
|
|
|
rect.setHeight(rect.height()-10)
|
|
|
|
|
pat2.drawRoundedRect(rect, 1, 1)
|
|
|
|
|
|
|
|
|
|
def closeEvent(self, event):
|
|
|
|
|
while self.ui.pyas_opacity > 0:
|
|
|
|
|
time.sleep(0.001)
|
|
|
|
|
self.ui.pyas_opacity -= 1
|
|
|
|
|
window.setWindowOpacity(self.ui.pyas_opacity/100)
|
|
|
|
|
QApplication.processEvents()
|
|
|
|
|
|
|
|
|
|
##################################### 主初始化 #####################################
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
|
try:
|
|
|
|
|
pyas_library()
|
|
|
|
|
pyasp_remove()
|
|
|
|
|
pyasb_remove()
|
|
|
|
|
pyas_version = "2.5.4"
|
|
|
|
|
pyas_version = "2.5.7"
|
|
|
|
|
pyae_version = "2.2.1"
|
|
|
|
|
QtCore.QCoreApplication.setAttribute(Qt.AA_EnableHighDpiScaling)# 自適應窗口縮放
|
|
|
|
|
QtGui.QGuiApplication.setAttribute(Qt.HighDpiScaleFactorRoundingPolicy.PassThrough)# 自適應窗口縮放
|
|
|
|
|
app = QtWidgets.QApplication(sys.argv)
|
|
|
|
|
window = MainWindow_Controller()
|
|
|
|
|
window.show()
|
|
|
|
|
print('[INFO] PYAS V'+pyas_version+' , PYAE V'+pyae_version)
|
|
|
|
|
print('[LOAD] Process Time: '+str(time.process_time()-start_m)+' sec')
|
|
|
|
|
for i in range(100):
|
|
|
|
|
time.sleep(0.001)
|
|
|
|
|
window.setWindowOpacity(i/100)
|
|
|
|
|
QApplication.processEvents()
|
|
|
|
|
print(f'[INFO] PYAS V{pyas_version} , PYAE V{pyae_version}')
|
|
|
|
|
print(f'[LOAD] Process Time: {time.process_time()-start_m} sec')
|
|
|
|
|
sys.exit(app.exec_())
|
|
|
|
|
except Exception as e:
|
|
|
|
|
pyas_bug_log(e)
|
|
|
|
|