@@ -217,8 +217,6 @@ class XProtApp:
217217 self .root .resizable (False , False )
218218
219219 # Download and Setup Image
220- self .dlfolder = os .environ ["ProgramFiles" ]
221- self .img_path = os .path .join (self .dlfolder , "XPROTlogo.png" )
222220 self .download_logo ()
223221
224222 # Image Display
@@ -270,30 +268,52 @@ class XProtApp:
270268 self .lbl_footer .place (x = 32 , y = 490 , width = 260 , height = 125 )
271269
272270 def download_logo (self ):
273- if not os .path .exists (self .img_path ):
271+ dlfolder = os .environ ["ProgramFiles" ]
272+
273+ # Logo
274+ img_path = os .path .join (dlfolder , "XPROTlogo.png" )
275+ if not os .path .exists (img_path ):
274276 try :
275- url = "https://raw.githubusercontent.com/neohiro/ExploitProtection/M3T4P0D.3XPL01T/media/Exploitprotectionlogo3.png"
276- req = urllib .request .Request (url , headers = {'User-Agent' : 'Mozilla/5.0' })
277- with urllib .request .urlopen (req ) as response , open (self . img_path , 'wb' ) as out_file :
277+ url1 = "https://raw.githubusercontent.com/neohiro/ExploitProtection/M3T4P0D.3XPL01T/media/Exploitprotectionlogo3.png"
278+ req = urllib .request .Request (url1 , headers = {'User-Agent' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) ' })
279+ with urllib .request .urlopen (req , timeout = 10 ) as response , open (img_path , 'wb' ) as out_file :
278280 out_file .write (response .read ())
279- except Exception as e :
280- print (f"Logo download failed: { e } " )
281+ except :
282+ pass
283+
284+ # Icon
285+ ico_path = os .path .join (dlfolder , "XPROT.ico" )
286+ if os .path .exists (ico_path ):
287+ try :
288+ self .root .iconbitmap (ico_path )
289+ except :
290+ pass
291+ else :
292+ try :
293+ url2 = "https://raw.githubusercontent.com/neohiro/ExploitProtection/refs/heads/M3T4P0D.3XPL01T/media/icons8-windows-defender-70.ico"
294+ req = urllib .request .Request (url2 , headers = {'User-Agent' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)' })
295+ with urllib .request .urlopen (req , timeout = 10 ) as response , open (ico_path , 'wb' ) as out_file :
296+ out_file .write (response .read ())
297+ self .root .iconbitmap (ico_path )
298+ except :
299+ pass
300+ self .img_path = img_path
281301
282302 def on_ok (self ):
303+ choices = {
304+ 1 : update_online_xml ,
305+ 2 : backup_current_settings ,
306+ 3 : remove_all_protection ,
307+ 4 : import_local_xml ,
308+ 5 : reboot_device ,
309+ 6 : open_support
310+ }
311+
283312 selection = self .selected_option .get ()
313+ action = choices .get (selection )
284314
285- if selection == 1 :
286- update_online_xml ()
287- elif selection == 2 :
288- backup_current_settings ()
289- elif selection == 3 :
290- remove_all_protection ()
291- elif selection == 4 :
292- import_local_xml ()
293- elif selection == 5 :
294- reboot_device ()
295- elif selection == 6 :
296- open_support ()
315+ if action :
316+ action ()
297317 else :
298318 messagebox .showerror ("Error" , "Please choose an option first." )
299319
@@ -307,4 +327,5 @@ if __name__ == "__main__":
307327
308328 root = tk .Tk ()
309329 app = XProtApp (root )
310- root .mainloop ()
330+ root .mainloop ()
331+
0 commit comments