Compare commits

...
2 Commits
Author SHA1 Message Date
87owo d571a18f7b Add files via upload 2022-08-22 23:34:56 +08:00
87owo 2233f3a8f2 Add files via upload 2022-08-21 11:51:15 +08:00
3 changed files with 148 additions and 45 deletions

No files matched your search

+145 -43
View File
@@ -178,20 +178,36 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
self.ui.Languahe_English.setChecked(True)
try:
if self.ini_config.getint("Setting","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("""
QPushButton
{
border:none;
background-color:rgba(20,200,20,100);
border-radius: 15px;
}
QPushButton:hover
{
background-color:rgba(20,200,20,120);
}
""")
if self.ini_config.get("Setting","language") == "zh_TW":
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("""
QPushButton
{
border:none;
background-color:rgba(20,200,20,100);
border-radius: 15px;
}
QPushButton:hover
{
background-color:rgba(20,200,20,120);
}
""")
else:
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("""
QPushButton
{
border:none;
background-color:rgba(20,200,20,100);
border-radius: 15px;
}
QPushButton:hover
{
background-color:rgba(20,200,20,120);
}
""")
else:
self.show_virus_scan_progress_bar = 0
except:
@@ -263,9 +279,9 @@ Login editor management authority''')
_translate = QtCore.QCoreApplication.translate
if pyas_key():
self.ui.State_output.clear()
self.ui.Window_title.setText(_translate("MainWindow", "PYAS V2.3.3"))
self.ui.Window_title.setText(_translate("MainWindow", "PYAS V2.3.5"))
else:
self.ui.Window_title.setText(_translate("MainWindow", "PYAS V2.3.3 (Security Key Error)"))
self.ui.Window_title.setText(_translate("MainWindow", "PYAS V2.3.5 (Security Key Error)"))
now_time = datetime.datetime.now()
self.ui.State_output.clear()
self.ui.State_output.append(str(now_time.strftime('%Y/%m/%d %H:%M:%S')) + ' > [Warning] PYAS Security Key Error')
@@ -338,7 +354,7 @@ Login editor management authority''')
self.ui.Encryption_Text_title.setText(_translate("MainWindow", "Before Encrypt & Decrypt"))
self.ui.Decrypt_Text_Run_Button.setText(_translate("MainWindow", "Encrypt"))
self.ui.About_Back.setText(_translate("MainWindow", "Back"))
self.ui.PYAS_Version.setText(_translate("MainWindow", "PYAS V2.3.3"))
self.ui.PYAS_Version.setText(_translate("MainWindow", "PYAS V2.3.5"))
self.ui.GUI_Made_title.setText(_translate("MainWindow", "GUI Make:"))
self.ui.GUI_Made_Name.setText(_translate("MainWindow", "mtkiao129#3921"))
self.ui.Core_Made_title.setText(_translate("MainWindow", "Core Make:"))
@@ -385,9 +401,9 @@ Login editor management authority''')
_translate = QtCore.QCoreApplication.translate
if pyas_key():
self.ui.State_output.clear()
self.ui.Window_title.setText(_translate("MainWindow", "PYAS V2.3.3"))
self.ui.Window_title.setText(_translate("MainWindow", "PYAS V2.3.5"))
else:
self.ui.Window_title.setText(_translate("MainWindow", "PYAS V2.3.3 (安全密钥错误)"))
self.ui.Window_title.setText(_translate("MainWindow", "PYAS V2.3.5 (安全密钥错误)"))
now_time = datetime.datetime.now()
self.ui.State_output.clear()
self.ui.State_output.append(str(now_time.strftime('%Y/%m/%d %H:%M:%S')) + ' > [警告] PYAS 安全密钥错误')
@@ -460,7 +476,7 @@ Login editor management authority''')
self.ui.Encryption_Text_title.setText(_translate("MainWindow", "加密&解密前"))
self.ui.Decrypt_Text_Run_Button.setText(_translate("MainWindow", "解密"))
self.ui.About_Back.setText(_translate("MainWindow", "返回"))
self.ui.PYAS_Version.setText(_translate("MainWindow", "PYAS V2.3.3"))
self.ui.PYAS_Version.setText(_translate("MainWindow", "PYAS V2.3.5"))
self.ui.GUI_Made_title.setText(_translate("MainWindow", "介面制作:"))
self.ui.GUI_Made_Name.setText(_translate("MainWindow", "mtkiao129#3921"))
self.ui.Core_Made_title.setText(_translate("MainWindow", "核心制作:"))
@@ -508,9 +524,9 @@ Login editor management authority''')
_translate = QtCore.QCoreApplication.translate
if pyas_key():
self.ui.State_output.clear()
self.ui.Window_title.setText(_translate("MainWindow", "PYAS V2.3.3"))
self.ui.Window_title.setText(_translate("MainWindow", "PYAS V2.3.5"))
else:
self.ui.Window_title.setText(_translate("MainWindow", "PYAS V2.3.3 (安全密鑰錯誤)"))
self.ui.Window_title.setText(_translate("MainWindow", "PYAS V2.3.5 (安全密鑰錯誤)"))
now_time = datetime.datetime.now()
self.ui.State_output.clear()
self.ui.State_output.append(str(now_time.strftime('%Y/%m/%d %H:%M:%S')) + ' > [警告] PYAS 安全密鑰錯誤')
@@ -583,7 +599,7 @@ Login editor management authority''')
self.ui.Encryption_Text_title.setText(_translate("MainWindow", "加密&解密前"))
self.ui.Decrypt_Text_Run_Button.setText(_translate("MainWindow", "解密"))
self.ui.About_Back.setText(_translate("MainWindow", "返回"))
self.ui.PYAS_Version.setText(_translate("MainWindow", "PYAS V2.3.3"))
self.ui.PYAS_Version.setText(_translate("MainWindow", "PYAS V2.3.5"))
self.ui.GUI_Made_title.setText(_translate("MainWindow", "介面製作:"))
self.ui.GUI_Made_Name.setText(_translate("MainWindow", "mtkiao129#3921"))
self.ui.Core_Made_title.setText(_translate("MainWindow", "核心製作:"))
@@ -898,7 +914,7 @@ Login editor management authority''')
else:
return True
except:
pass
return False
#定義紀錄掃描
def pyas_scan_write_en(self,file):
try:
@@ -1195,7 +1211,7 @@ b'LockFile'"""
with open('Library/PYAE/Hashes/Viruslist.md5','r') as self.fp:
rfp = self.fp.read()
except Exception as e:
QMessageBox.critical(self,"Error",str(e),QMessageBox.Ok)
QMessageBox.critical(self,"Error: ",str(e),QMessageBox.Ok)
rfp = ""
self.pyas_scan_disk_en('A:/',rfp)
self.pyas_scan_disk_en('B:/',rfp)
@@ -1631,7 +1647,7 @@ b'LockFile'"""
fe = ft.read()
ft.close()
except Exception as e:
QMessageBox.critical(self,"Error",str(e),QMessageBox.Ok)
QMessageBox.critical(self,"Error: ",str(e),QMessageBox.Ok)
self.ui.Look_for_File_output.setText("")
self.ui.Look_for_File_output.append(self.text_Translate('尋找結果:')+'\n'+str(fe))
QApplication.processEvents()
@@ -1785,6 +1801,23 @@ b'LockFile'"""
QApplication.processEvents()
self.Virus_Scan = 0
self.pause = True
elif 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);
}
""")
QApplication.processEvents()
self.Virus_Scan = 0
self.pause = True
else:
self.ui.Protection_illustrate.setText(self.text_Translate("正在初始化中,請稍後..."))
self.pause = False
@@ -1797,23 +1830,39 @@ b'LockFile'"""
with open('Library/PYAE/Hashes/Viruslist.md5','r') as fp:
rfp = fp.read()
except Exception as e:
QMessageBox.critical(self,"Error",str(e),QMessageBox.Ok)
QMessageBox.critical(self,"Error: ",str(e),QMessageBox.Ok)
rfp = ''
self.Virus_Scan = 1
self.ui.Protection_illustrate.setText(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,200,20,100);
border-radius: 15px;
}
QPushButton:hover
{
background-color:rgba(20,200,20,120);
}
""")
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("已開啟"))
self.ui.Protection_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);
}
""")
else:
self.ui.Protection_illustrate.setText(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,200,20,100);
border-radius: 15px;
}
QPushButton:hover
{
background-color:rgba(20,200,20,120);
}
""")
QApplication.processEvents()
while 1:
if not self.pause:
@@ -1826,7 +1875,7 @@ b'LockFile'"""
pass
else:
if self.pyas_scan_start(p.exe(),rfp):
of = subprocess.call('taskkill /f /im "'+str(p.name())+'"',shell=True)
of = subprocess.call('taskkill /f /im "'+str(p.name())+'" /t',shell=True)
try:
if of == 0:
self.ui.State_output.append(self.text_Translate('{} > [實時防護] 成功攔截了一個惡意軟體:').format(str(datetime.datetime.now().strftime('%Y/%m/%d %H:%M:%S')))+str(p.name()))
@@ -1901,6 +1950,57 @@ b'LockFile'"""
}
""")
self.show_virus_scan_progress_bar = 1
elif self.ui.Show_Virus_Scan_Progress_Bar_switch_Button.text() == 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 self.ui.Show_Virus_Scan_Progress_Bar_switch_Button.text() == 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
elif self.ui.Show_Virus_Scan_Progress_Bar_switch_Button.text() == 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:
self.ini_config.set("Setting", "high_sensitivity", 0)
self.ini_config.write(open(r"./Library/PYAS/Setup/PYAS.ini", 'w'))
@@ -1918,6 +2018,7 @@ b'LockFile'"""
}
""")
self.show_virus_scan_progress_bar = 0
#print(str(self.ui.Show_Virus_Scan_Progress_Bar_switch_Button.text()))
except:
with open(r"./Library/PYAS/Setup/PYAS.ini",mode="w",encoding="utf-8") as file:
file.write("[Setting]\nhigh_sensitivity = 0\nlanguage = english")
@@ -1941,7 +2042,8 @@ b'LockFile'"""
self.language = "english"
self.ini_config.set("Setting", "language", "english")
except Exception as e:
QMessageBox.critical(self,"Error",str(e),QMessageBox.Ok)
print(e)
#QMessageBox.critical(self,"Error: ",str(e),QMessageBox.Ok)
try:
self.ini_config.write(open(r"./Library/PYAS/Setup/PYAS.ini", 'w'))
except:
+2 -1
View File
@@ -59,7 +59,8 @@ english_list = {
"設定":"Setting",
"關於":"About",
"結束進程":"End process",
"啟用該選項可以實時監控系統的惡意軟體並清除":"Enable this option to monitor and remove malware in the system in real time",
"啟用該選項可以實時監控系統中的惡意軟體並清除":"Enable this option to monitor and remove malware in the system in real time",
"启动此选项可以实时监控系统中的恶意软件并清除":"Enable this option to monitor and remove malware in the system in real time",
'{} > [實時防護] 成功攔截了一個惡意軟體:':'{} > [Real-time protection] Successfully blocked a malware:',
'{} > [實時防護] 惡意軟體攔截失敗:':'{} > [Real-time protection] Malware blocking failed:',
'修復系統權限':"Repair System Permissions",
+1 -1
View File
@@ -1,7 +1,7 @@
import pyinstaller_versionfile
pyinstaller_versionfile.create_versionfile(
output_file="versionfile.txt",
version='2.3.3',
version='2.3.5',
company_name="PYAS",
file_description="Python Antivirus Software",
internal_name="PYAS",