diff --git a/System/Drive/Assets/.misc/command_line_button.png b/System/Drive/Assets/.misc/command_line_button.png deleted file mode 100644 index e479639..0000000 Binary files a/System/Drive/Assets/.misc/command_line_button.png and /dev/null differ diff --git a/System/Drive/Assets/.misc/information_button.png b/System/Drive/Assets/.misc/information_button.png deleted file mode 100644 index 7d2441e..0000000 Binary files a/System/Drive/Assets/.misc/information_button.png and /dev/null differ diff --git a/System/Drive/Assets/.misc/local_update_button.png b/System/Drive/Assets/.misc/local_update_button.png deleted file mode 100644 index 14cfe66..0000000 Binary files a/System/Drive/Assets/.misc/local_update_button.png and /dev/null differ diff --git a/System/Drive/Assets/.misc/recommended_button.png b/System/Drive/Assets/.misc/recommended_button.png deleted file mode 100644 index e52c129..0000000 Binary files a/System/Drive/Assets/.misc/recommended_button.png and /dev/null differ diff --git a/System/Drive/Assets/.server_icons/kill_server.png b/System/Drive/Assets/.server_icons/kill_server.png deleted file mode 100644 index cc35d94..0000000 Binary files a/System/Drive/Assets/.server_icons/kill_server.png and /dev/null differ diff --git a/System/Drive/Assets/.server_icons/start_server.png b/System/Drive/Assets/.server_icons/start_server.png deleted file mode 100644 index 974c44b..0000000 Binary files a/System/Drive/Assets/.server_icons/start_server.png and /dev/null differ diff --git a/System/Drive/Assets/.server_icons/update_server.png b/System/Drive/Assets/.server_icons/update_server.png deleted file mode 100644 index 03b0a52..0000000 Binary files a/System/Drive/Assets/.server_icons/update_server.png and /dev/null differ diff --git a/System/Drive/Assets/.side_panel/activate_button.png b/System/Drive/Assets/.side_panel/activate_button.png deleted file mode 100644 index 3b36495..0000000 Binary files a/System/Drive/Assets/.side_panel/activate_button.png and /dev/null differ diff --git a/System/Drive/Assets/.side_panel/install_button.png b/System/Drive/Assets/.side_panel/install_button.png deleted file mode 100644 index a6e9482..0000000 Binary files a/System/Drive/Assets/.side_panel/install_button.png and /dev/null differ diff --git a/System/Drive/Assets/.side_panel/settings_button.png b/System/Drive/Assets/.side_panel/settings_button.png deleted file mode 100644 index 52cf42b..0000000 Binary files a/System/Drive/Assets/.side_panel/settings_button.png and /dev/null differ diff --git a/System/Drive/Assets/.side_panel/uninstall_button.png b/System/Drive/Assets/.side_panel/uninstall_button.png deleted file mode 100644 index 76697e7..0000000 Binary files a/System/Drive/Assets/.side_panel/uninstall_button.png and /dev/null differ diff --git a/System/Drive/Assets/^misc/command_line_button.png b/System/Drive/Assets/^misc/command_line_button.png deleted file mode 100644 index e479639..0000000 Binary files a/System/Drive/Assets/^misc/command_line_button.png and /dev/null differ diff --git a/System/Drive/Assets/^misc/information_button.png b/System/Drive/Assets/^misc/information_button.png deleted file mode 100644 index 7d2441e..0000000 Binary files a/System/Drive/Assets/^misc/information_button.png and /dev/null differ diff --git a/System/Drive/Assets/^misc/local_update_button.png b/System/Drive/Assets/^misc/local_update_button.png deleted file mode 100644 index 14cfe66..0000000 Binary files a/System/Drive/Assets/^misc/local_update_button.png and /dev/null differ diff --git a/System/Drive/Assets/^misc/recommended_button.png b/System/Drive/Assets/^misc/recommended_button.png deleted file mode 100644 index e52c129..0000000 Binary files a/System/Drive/Assets/^misc/recommended_button.png and /dev/null differ diff --git a/System/Drive/Assets/^server_icons/kill_server.png b/System/Drive/Assets/^server_icons/kill_server.png deleted file mode 100644 index cc35d94..0000000 Binary files a/System/Drive/Assets/^server_icons/kill_server.png and /dev/null differ diff --git a/System/Drive/Assets/^server_icons/start_server.png b/System/Drive/Assets/^server_icons/start_server.png deleted file mode 100644 index 974c44b..0000000 Binary files a/System/Drive/Assets/^server_icons/start_server.png and /dev/null differ diff --git a/System/Drive/Assets/^server_icons/update_server.png b/System/Drive/Assets/^server_icons/update_server.png deleted file mode 100644 index 03b0a52..0000000 Binary files a/System/Drive/Assets/^server_icons/update_server.png and /dev/null differ diff --git a/System/Drive/Assets/^side_panel/activate_button.png b/System/Drive/Assets/^side_panel/activate_button.png deleted file mode 100644 index 3b36495..0000000 Binary files a/System/Drive/Assets/^side_panel/activate_button.png and /dev/null differ diff --git a/System/Drive/Assets/^side_panel/install_button.png b/System/Drive/Assets/^side_panel/install_button.png deleted file mode 100644 index a6e9482..0000000 Binary files a/System/Drive/Assets/^side_panel/install_button.png and /dev/null differ diff --git a/System/Drive/Assets/^side_panel/settings_button.png b/System/Drive/Assets/^side_panel/settings_button.png deleted file mode 100644 index 52cf42b..0000000 Binary files a/System/Drive/Assets/^side_panel/settings_button.png and /dev/null differ diff --git a/System/Drive/Assets/^side_panel/uninstall_button.png b/System/Drive/Assets/^side_panel/uninstall_button.png deleted file mode 100644 index 76697e7..0000000 Binary files a/System/Drive/Assets/^side_panel/uninstall_button.png and /dev/null differ diff --git a/System/Drive/Assets/logo.png b/System/Drive/Assets/logo.png deleted file mode 100644 index bea15f4..0000000 Binary files a/System/Drive/Assets/logo.png and /dev/null differ diff --git a/System/Drive/CS/CheckSum b/System/Drive/CS/CheckSum deleted file mode 100644 index 1f5acfa..0000000 --- a/System/Drive/CS/CheckSum +++ /dev/null @@ -1,28 +0,0 @@ -'/System/Drive/FunctionRequest.py': 'b2bd9e3a3f8412d5222b1ee4166d7e9f955caf1545fc6bc512fe022ed13e08dc' -'/System/Drive/Icon.png': 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855' -'/System/Drive/FirstUse.py': '3997c1894f1ad523539bbdef2c7a4dcae0617b617f430e3735c24d229704222b' -'/System/Drive/ModuleVerifier.py': 'a241736dca1b218bc44f078ba42240f11cc5d05297b76c0c6185cfac2a831284' -'/System/Drive/Login.py': 'e77e937e8b1b289a51fe1a009815c135329b229abd57dc253813af5a5471f55d' -'/System/Drive/Password.py': '174d0a54f98c05a891dc53f3f5c05ced6c360ebf6324b98df663d3a73f7e5995' -'/System/Drive/VersionUpdate.py': 'cd4c0010357f9cc133d685c76203c744cc3ea0ad99a8176650cdb92163d71b79' -'/System/Drive/webkit/l002.py': '47b905ba6c1419f2e68c75066572e8f659051a1e3616f4df50a01784b227c323' -'/System/Drive/webkit/l003.py': 'a1c1b0bb450d0d1a775796d4d3a5290077b641e6f964b93f94084b30fa334af9' -'/System/Drive/webkit/l.py': '053c047875515b81f388fd68b1e50e9d3ca2df54e504c627f73f6100d7af55dd' -'/System/Drive/UI_Functions/Information.py': 'e1511083793cf4c99a052526e6cf4c054c1a47a111aabf7b634da24edb950ece' -'/System/Drive/UI_Functions/ConnectServer.py': '19f4c36533638da68f4c7b2fbb29297122013c5c55e9d7364f0434049afa9557' -'/System/Drive/UI_Functions/KillServer.py': '442d8a192e17ccf819930b03e57a1c0b1a3096269934c56bc2924baf4553fbad' -'/System/Drive/UI_Functions/Uninstall.py': '9462dd45f4ca0b5d3b724cfb41bca29cc360fadd075a37dd2aa79f4db62d2896' -'/System/Drive/UI_Functions/Settings.py': 'ad82ae46c91e496900ef1ead0803c8e48996bc93f5cf3fe5791e054e31cadebb' -'/System/Drive/UI_Functions/Install.py': 'ae9991e3fc1a9fe27e6939dee74388ab0ff97c55ad595872d52092e9f9fbfc3a' -'/System/Drive/UI_Functions/Activate.py': '50de49c9a88369439771a65d2a70967642d68dcd7e17143ad2210ae908786017' -'/System/Drive/Functions/Cache.py': '67a452067516f61237905a67a55f8c9543802780cb9f6e3d18545ee4dd8fafaf' -'/System/Drive/Functions/Uninstall.py': '84898a2435eaf3d976e8750afaf422189f41dd24b6df6d917c1b13534743712f' -'/System/Drive/templates/index.html': '1d58ee5ade4c72ccb258309100efacaabaaaed775286e0818a7ea7cdbc084c14' -'/System/Drive/templates/styles.css': '38f92bb652dc8974892fe20c19e29ecc8e419bc951ad3e12c23d9dee348552d3' -'/System/Drive/templates/index.js': '022732113395edcec60c2ee7337024cfd551b3ad9f67a93765abafe3407cdf4c' -'/System/Drive/templates/launchwebpage.py': '16daf3eb731fdd37f6482be9d222d7c9890513650e4374273c6639f53a22f1a6' -'/System/Drive/templates/main.py': '634e38ee064859bf3f5510a8bac515d3313c12208e2d3b3d6aaa1371bece0bf4' -'/System/Drive/Errors_Events/EventMan.py': '8d238d97a72450f23250144b98094e7374947a35155d7b12fafd9bfae57e3132' -'/System/Drive/Errors_Events/ErrorMan.py': '64233452c8ea7841238e143e51e41f4d935fa998545478661583bb4b7212eb5d' -'/System/Drive/Errors_Events/Push/Pileup': 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855' -'/System/Drive/Errors_Events/Push/Log': 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855' diff --git a/System/Drive/Errors_Events/ErrorMan.py b/System/Drive/Errors_Events/ErrorMan.py deleted file mode 100644 index bcb0058..0000000 --- a/System/Drive/Errors_Events/ErrorMan.py +++ /dev/null @@ -1,6 +0,0 @@ -def IssueID(Line): - pass - - -def NewIssue(Line, ErNo, SCR, KeFu, UserInp): - pass diff --git a/System/Drive/Errors_Events/EventMan.py b/System/Drive/Errors_Events/EventMan.py deleted file mode 100644 index ef70686..0000000 --- a/System/Drive/Errors_Events/EventMan.py +++ /dev/null @@ -1,351 +0,0 @@ -import datetime -import inspect -import time -import requests -import socket -import User.UserProfile -import os - -tryagain = True -def display_notification(title, message): - applescript = f'display notification "{message}" with title "{title}"' - os.system(f"osascript -e '{applescript}'") - - -try: - response = requests.get("https://www.google.com", timeout=1) - if response.status_code == 200: - pass -except: - display_notification("Hold Up!", "To continue using ghpm. Please connect to the internet") - - - def check_internet_connection(): - try: - response = requests.get("https://www.google.com", timeout=5) - return response.status_code == 200 - except requests.ConnectionError: - return False - - - while True: - if check_internet_connection(): - # Internet connection is available, display thank you message - display_notification("Thank you!", " Please continue enjoying ghpm!!") - - break # Exit the loop - else: - # Internet connection is not available, wait for a while and check again - time.sleep(0.5) # Wait for 5 seconds before checking again - -pileup_push = 0 -avg_t = [] -numr = 0 - -try: - import User.UserProfile - - cwd = User.UserProfile.SourceDirectory -except: - cwd = os.getcwd() - - -def IssueID(Line): - Line = int(Line) - IssueID = hex(Line) - global IsID - IsID = IssueID - - -def NewEvent(event, Pol): - import sqlite3 as sl - - try: - con = sl.connect( - f'{os.getcwd()}/System/.Cache/System/ErrorLog/Event.db' - ) - with con: - con.execute( - """ - CREATE TABLE Event ( - Event TEXT, - Time TEXT, - Type TEXT - ); - """ - ) - except: - pass - # - try: - EventReport = open(f'{cwd}/System/.Cache/System/ErrorLog/Events', 'a') - except: - EventReport = open(f'{cwd}System/.Cache/System/ErrorLog/Events', 'a') - - import datetime - - if Pol == 10: - print(event) - elif Pol == 20: - print(event) - else: - pass - try: - if User.UserProfile.DisplayEvents is True: - if Pol == 1: - print(event) - else: - pass - else: - pass - except: - pass - - EventTime = datetime.datetime.now() - ErNo = int(Pol) - CRIS = False - if ErNo == 1: - CRIS = 'User' - elif ErNo == 0: - CRIS = 'System' - else: - CRIS = None - - def Update(data): - sql = 'INSERT INTO Event (Event, Time, Type) values(?, ?, ?)' - - with con: - con.executemany(sql, data) - - Et = str(EventTime)[:-7] - - try: - Update(data=[(f'{event}', f'{Et}', f'{CRIS}')]) - except: - pass - if CRIS is None: - try: - exec(event) - except: - pass - else: - EventTime = str(EventTime)[:-7] - Report = f"""Event at {EventTime}:{CRIS} --> {event}""" - EventReport.write(f'\n{Report}') - EventReport.close() - push_analytics_subprocess(0, User.UserProfile.Username, event) - - -def guiEvent(typeerror, event, line, address, terminate=False, record=True, severity=0): - date = datetime.datetime.now() - - def checktype(): - global typeer - if typeerror == 1: - typeer = 'User' - elif typeerror == 2: - typeer = 'SYSTEM ERROR' - elif typeerror == 0: - typeer = 'System' - elif typeerror == 3: - typeer = 'Notice' - elif typeerror == 4: - typeer = 'CheckPoint' - - Record(typeer) - - def Record(typeer): - try: - display_format = f'{typeer} --> {event} @ line:{line} severity:{severity}' - if typeer == 'CheckPoint': - display_format = f'{typeer} line:{line} function:{address}' - - if User.UserProfile.DisplayEvents is True: - print(display_format) - else: - pass - - if User.UserProfile.PushLogs: - st = time.time() - push_analytics_subprocess(0, User.UserProfile.Username, display_format) - avg_t.append(time.time() - st) - total = sum(avg_t) - average = total / len(avg_t) - try: - if User.UserProfile.AdvancedL: - try: - average = str(average) - except: - print(f'average time -> {average[:-3]}') - - except: - return EOFError - - except: - print('Network Connection Error') - logfile = f'{User.UserProfile.SourceDirectory}System/.Cache/System/ErrorLog/GUIevents' - with open(logfile, 'a') as log: - log.write(f'\n{display_format}') - try: - if User.UserProfile.LV: - logfile = f'{User.UserProfile.SourceDirectory}UIevents' - with open(logfile, 'a') as log: - log.write(f'\n{display_format}') - else: - pass - except: - pass - - if record: - checktype() - else: - pass - - -def get_current_function(): - stack = inspect.stack() - frame = stack[1] - code = frame[0] - return code.f_code.co_name - - -def push_analytics_subprocess(a1, a2, a3): - tryagain = True - try: - if tryagain: - try: - if User.UserProfile.PushLogs: - AnalyticsRecord(9) - global analytics_push_id - analytics_push_id = 0 - ip = socket.gethostbyname(socket.gethostname()) - - import requests - - # Define the base URL - base_url = f"https://hello2022isthe3nd.000webhostapp.com/eventlogger.php?data1={analytics_push_id}&data2={User.UserProfile.Username}&data3={ip}&data4={a2}&data5={a3}" - - - - # Send a GET request with the parameters - requests.get(base_url) - except: - try: - lm = User.UserProfile.OFFLINE - except: - lm = False - - if lm is False: - def display_notification(title, message): - applescript = f'display notification "{message}" with title "{title}"' - os.system(f"osascript -e '{applescript}'") - - try: - response = requests.get("https://www.google.com", timeout=1) - if response.status_code == 200: - pass - except: - display_notification("Hold Up!", "To continue using ghpm. Please connect to the internet") - - def check_internet_connection(): - try: - response = requests.get("https://www.google.com", timeout=5) - return response.status_code == 200 - except requests.ConnectionError: - return False - - while True: - if check_internet_connection(): - # Internet connection is available, display thank you message - display_notification("Thank you!", " Please continue enjoying ghpm!!") - - break # Exit the loop - else: - # Internet connection is not available, wait for a while and check again - time.sleep(0.5) # Wait for 5 seconds before checking again - - except: - guiEvent(2, 'Network Issue With Log Push', inspect.currentframe().f_lineno, get_current_function(), False, True, 1) - return None - - -def PushAnalytics(a1, a2, a3): - st = time.time() - push_analytics_subprocess(a1, a2, a3) - avg_t.append(time.time() - st) - total = sum(avg_t) - average = total / len(avg_t) - average = str(average) - try: - if User.UserProfile.AdvancedL: - - print(f'average time -> {average[:3]}') - - except: - pass - -def AnalyticsRecord(a1): - - push_types = ['install-github0', 'install-local1', 'install-github-complex2', 'activate-local3', 'activate-github4', - 'activate-github-complex5', 'activator-update6', 'activator-reinstall7', 'settings8', 'send_logs9', - 'auto_update10', 'advertisement11'] - - bref = f'[{a1}]' - - - try: - int(a1) - except: - if User.UserProfile.DisplayEvents: - NewEvent(f'NOTICE: {a1}', 1) - - - if os.path.exists(f'{User.UserProfile.SourceDirectory}System/.Cache/User/analytics'): - with open(f'{User.UserProfile.SourceDirectory}System/.Cache/User/analytics', 'a') as file: - # Write content to the file - file.write(f"{bref}") - from datetime import datetime - - def is_same_date_as_today(file_path): - # Get today's date in '%Y-%m-%d' format - today_date = datetime.today().strftime('%Y-%m-%d') - - # Read the first line of the file - with open(file_path, 'r') as file: - first_line = file.readline().strip() - - # Compare the first line of the file with today's date - return first_line == today_date - - with open(f'{User.UserProfile.SourceDirectory}System/.Cache/User/analytics', 'r') as file: - data = file.read() - if is_same_date_as_today(f'{User.UserProfile.SourceDirectory}System/.Cache/User/analytics'): - import requests - - # Define the base URL - base_url = f"https://hello2022isthe3nd.000webhostapp.com/eventlogger.php?data1={data}&data2={User.UserProfile.Username}&data3=none&data4=mone&data5=None" - - - # Send a GET request - requests.get(base_url) - - - - - - else: - with open(f'{User.UserProfile.SourceDirectory}System/.Cache/User/analytics', 'w') as file: - # Write content to the file - from datetime import datetime, timedelta - - # Get the current date - today = datetime.today() - - # Calculate the date one month from today - one_month_later = today + timedelta(days=10) # Approximation for one month - - # Format the date as '%Y-%m-%d' - formatted_date = one_month_later.strftime('%Y-%m-%d') - - file.write(f"{formatted_date}\n") - file.write(f"{bref}") diff --git a/System/Drive/Errors_Events/Push/Log b/System/Drive/Errors_Events/Push/Log deleted file mode 100644 index e69de29..0000000 diff --git a/System/Drive/Errors_Events/Push/Pileup b/System/Drive/Errors_Events/Push/Pileup deleted file mode 100644 index e69de29..0000000 diff --git a/System/Drive/FirstUse.py b/System/Drive/FirstUse.py deleted file mode 100644 index f9a7ce3..0000000 --- a/System/Drive/FirstUse.py +++ /dev/null @@ -1,180 +0,0 @@ -''' -This script appears to be responsible for creating a user profile -during the first use of a program and then initiating a relaunch of the program. -Here's a brief description of its logic: - -The script defines several functions to check the operating system, -create a user profile, and generate a hashed password. - -is_mac_os() function checks if the current operating system is macOS by comparing -the result of platform.system() with "Darwin." - -create_user_profile() function creates a user profile with various user-related -information like username, hashed password, user privileges, source directory, and others. -It writes this information to a file named "UserProfile.py" in the "User" directory. - -generate_hashed_password() function generates a hashed password by combining the provided -password with a salt and other values, then using MD5 hashing. - -create_profile() function is called when a "Create Profile" button is clicked. -It creates the user profile, deletes a "FirstUseToken.txt" file, and writes some information to a "/.GHPM" file -(you should replace this with your desired file path). After this, -it prints messages indicating the actions performed and closes the GUI window. - -The script checks if it's the first use by looking for the existence of a "FirstUseToken.txt" file. - -If it's the first use, the script opens a GUI window using tkinter to prompt the user to enter a username and password. -After filling out this information and clicking "Create Profile," the user profile is created, and the GUI window closes. - -After creating the user profile (or if it's not the first use), the script initiates a relaunch of the program. -It executes the "Start.py" file in a new terminal window by using os.system and AppleScript to run a command in Terminal. - -In summary, this script is used to set up a user profile during the first use of a program, and then it relaunches the program -''' - -import os -import sys -import time -import platform -import hashlib -import uuid -import tkinter as tk -from tkinter import ttk - - -# Function to check if the OS is macOS -def is_mac_os(): - return platform.system() == "Darwin" - - -# Function to create a user profile -def create_user_profile(): - cwd = os.getcwd() - user_profile_path = f"{cwd}/User/UserProfile.py" - with open(user_profile_path, "w") as user_profile: - username = username_entry.get() - password = password_entry.get() - hashed_password = generate_hashed_password(password) - user_privileges = "root" if not is_mac_os() else os.getlogin() - source_directory = os.getcwd() - uuid1 = uuid.uuid1().hex - uuid4 = uuid.uuid4().hex - - user_profile_content = ( - f"Username = '{username}'\n" - f"Password = '{hashed_password}'\n" - f"UserPrivileges = '{user_privileges}'\n" - f"SourceDirectory = '{source_directory}/'\n" - f"Force_Import_Request = {force_import.get()}\n" - f"Forced_Login = {forced_login.get()}\n" - f"uuid1 = '{uuid1}'\n" - f"uuid4 = '{uuid4}'\n" - f"DisplayEvents = {display_events.get()}\n" - f"PushLogs = {push_logs.get()}\n" - f"AdvancedL = {advanced_l.get()}\n" - f"AutoUpdate = {auto_update.get()}\n" - ) - user_profile.write(user_profile_content) - - -# Function to generate hashed password -def generate_hashed_password(password): - UUID = uuid.uuid1() - if not is_mac_os(): - UserID = "root" - else: - UserID = os.getlogin() - salt = "9lk" - UUID = str(f"{UUID}") - uuidToken = UUID[30:] - Password = f"{password}{uuidToken}{UserID}" - password = Password + salt - hashed = hashlib.md5(password.encode()) - return hashed.hexdigest() - - -# Function to handle the "Create Profile" button click -def create_profile(): - create_user_profile() - os.remove(f"{cwd}/System/.Cache/User/FirstUseToken.txt") - # Open a file for writing in the root directory - file_path = "/.GHPM" # Replace with your desired file path - - try: - with open(file_path, "w") as file: - source_directory = f'{cwd}/User/UserProfile.py' - file.write(source_directory) # Write your content here - print(f"GHPM System has been successfully created and written.") - except IOError: - print(f"An error occurred while writing GHPM System.") - - print("User Profile Has Been Created.") - root.destroy() - - -cwd = os.getcwd() -FirstUse = os.path.exists(f"{cwd}/System/.Cache/User/FirstUseToken.txt") - -if FirstUse: # Is first use - root = tk.Tk() - root.title("First Use Configuration") - root.configure(bg="#333333") - - # Styling - style = ttk.Style() - style.configure("TLabel", foreground="white", background="#333333", font=("Helvetica", 12)) - style.configure("TEntry", foreground="white", background="black", font=("Helvetica", 12)) - style.configure("TButton", foreground="white", background="#007b00", font=("Helvetica", 12)) - - frame = ttk.Frame(root, padding=20) - frame.pack() - - username_label = ttk.Label(frame, text="Enter Username:") - username_label.grid(row=0, column=0, padx=10, pady=10, sticky="w") - - username_entry = ttk.Entry(frame) - username_entry.grid(row=0, column=1, padx=10, pady=10) - - password_label = ttk.Label(frame, text="Create Password:") - password_label.grid(row=1, column=0, padx=10, pady=10, sticky="w") - - password_entry = ttk.Entry(frame, show="*") - password_entry.grid(row=1, column=1, padx=10, pady=10) - - # Checkboxes for settings - force_import = tk.BooleanVar() - force_import_check = ttk.Checkbutton(frame, text="Force Import Request", variable=force_import) - force_import_check.grid(row=2, columnspan=2, padx=10, pady=10, sticky="w") - - forced_login = tk.BooleanVar() - forced_login_check = ttk.Checkbutton(frame, text="Forced Login", variable=forced_login) - forced_login_check.grid(row=3, columnspan=2, padx=10, pady=10, sticky="w") - - display_events = tk.BooleanVar() - display_events_check = ttk.Checkbutton(frame, text="Display Events", variable=display_events) - display_events_check.grid(row=4, columnspan=2, padx=10, pady=10, sticky="w") - - push_logs = tk.BooleanVar() - push_logs_check = ttk.Checkbutton(frame, text="Push Logs", variable=push_logs) - push_logs_check.grid(row=5, columnspan=2, padx=10, pady=10, sticky="w") - - advanced_l = tk.BooleanVar() - advanced_l_check = ttk.Checkbutton(frame, text="AdvancedL", variable=advanced_l) - advanced_l_check.grid(row=6, columnspan=2, padx=10, pady=10, sticky="w") - - auto_update = tk.BooleanVar() - auto_update_check = ttk.Checkbutton(frame, text="Auto Update", variable=auto_update) - auto_update_check.grid(row=7, columnspan=2, padx=10, pady=10, sticky="w") - - create_button = ttk.Button(frame, text="Create Profile", command=create_profile) - create_button.grid(row=8, columnspan=2, pady=20) - - root.mainloop() - -else: - pass - -relaunch = 'python3 Start.py' -os.system( - f'osascript -e \'tell application "Terminal" to do script "cd {os.getcwd()}&&{relaunch}"\'' -) diff --git a/System/Drive/FunctionRequest.py b/System/Drive/FunctionRequest.py deleted file mode 100644 index 531aaab..0000000 --- a/System/Drive/FunctionRequest.py +++ /dev/null @@ -1,154 +0,0 @@ -''' - is script creates a graphical user interface for an application - with buttons for various functionalities and repositories. It - also handles analytics and checks for updates or forced login - based on user preferences. - ''' - - - -import inspect -import uuid - -import User.UserProfile -import System.Drive.Errors_Events.EventMan as AR -import System.Drive.Errors_Events.EventMan as EV -import System.Drive.UI_Functions.Install - -cwd = User.UserProfile.SourceDirectory - - -def get_current_function(): - stack = inspect.stack() - frame = stack[1] - code = frame[0] - return code.f_code.co_name - - -def Activate(): - import System.Drive.UI_Functions.Activate as AC - AC.Activate() - - -def GUI(): - import User.UserProfile as UP - if UP.Forced_Login: - import System.Drive.Login - else: - pass - - EV.guiEvent(4, '', inspect.currentframe().f_lineno, get_current_function(), False, True, 1) - - - global directories - directories = [] - import os - - import User.UserProfile - - cwd = User.UserProfile.SourceDirectory - - os.system("""osascript -e 'tell application "Terminal" to set visible of window 1 to false' """) - - import tkinter as tk - - def show_information(): - import System.Drive.UI_Functions.Information as IF - IF.show_information() - - def settings_window(): - import System.Drive.UI_Functions.Settings as SW - SW.settings_window() - - def crypt(): - EV.guiEvent(4, '', inspect.currentframe().f_lineno, get_current_function(), False, True, 1) - try: - os.system( - f'''osascript -e 'tell application "Terminal" to do script "cd {User.UserProfile.SourceDirectory[:-1]}&&python3 CLI.py"' -''') - except: - EV.guiEvent(0, f'{get_current_function()} Error: CLI.py may not exist', - inspect.currentframe().f_lineno, os.path.abspath(__file__), False, True, 3) - - def kill_server(): - import System.Drive.UI_Functions.KillServer as KS - KS.kill_server() - - def update_server(): - import System.Drive.VersionUpdate - try: - exec('System.Drive.VersionUpdate') - except: - pass - - def show_install(): - import System.Drive.UI_Functions.Install as IN - IN.show_install() - - def show_list_window(): - import System.Drive.UI_Functions.Uninstall as UN - UN.show_list_window() - - def open_update_local(): - EV.guiEvent(4, '', inspect.currentframe().f_lineno, get_current_function(), False, True, 1) - os.system(f'python3 {User.UserProfile.SourceDirectory}serv.py') - - def start_server(): - import System.Drive.UI_Functions.ConnectServer as CS - CS.start_server() - - global root - - import tkinter as tk - from UI_Functions.UI_Builder import ghpmmaingui as gmg - from UI_Functions.UI_Builder import iconfilepaths as ifp - from UI_Functions.UI_Builder import formbuilder as fb - - iconDict = ifp.generateFilePathDict("Assets") - - root = gmg.GHPMMainGui(1000, 650) - - main = fb.CustomFrame(bgImage=iconDict["logo"]) - - main.setupIconButton(20, 20, iconDict["misc"]["local_update_button"], iconScale=0.30, command=open_update_local) - - main.setupIconButton(20, 160, iconDict["side_panel"]["settings_button"], iconScale=0.25, command=settings_window) - main.setupIconButton(20, 230, iconDict["side_panel"]["install_button"], iconScale=0.25, command=show_install) - main.setupIconButton(20, 300, iconDict["side_panel"]["activate_button"], iconScale=0.25, command=Activate) - main.setupIconButton(20, 370, iconDict["side_panel"]["uninstall_button"], iconScale=0.25, command=show_list_window) - main.setupIconButton(20, 484, iconDict["misc"]["recommended_button"], iconScale=0.40, command=System.Drive.templates.main.main) - - main.setupIconButton(550, 540, iconDict["misc"]["command_line_button"], iconScale=0.25, command=crypt) - main.setupIconButton(772, 540, iconDict["misc"]["information_button"], iconScale=0.25, command=show_information) - - main.setupIconButton(822, 10, iconDict["server_icons"]["start_server"], iconScale=0.10, command=start_server) - main.setupIconButton(878, 10, iconDict["server_icons"]["update_server"], iconScale=0.10, command=update_server) - main.setupIconButton(934, 10, iconDict["server_icons"]["kill_server"], iconScale=0.10, command=kill_server) - - main.constructFrame() - - root.addTab(main, "Main") - - import User.UserProfile - try: - with open(f'{User.UserProfile.SourceDirectory}System/.Cache/User/analytics', 'r') as file: - data = file.read() - import requests - url = f'''https://gpm-web.vercel.app/analytics={data}''' - requests.get(url) - except: - pass - EV.PushAnalytics(a1=uuid.uuid1().hex, a2='Login', a3='None') - if User.UserProfile.AutoUpdate: - try: - import System.Drive.VersionUpdate - System.Drive.VersionUpdate() - - except: - - root.run() - else: - root.run() - - - diff --git a/System/Drive/Functions/Cache.py b/System/Drive/Functions/Cache.py deleted file mode 100644 index acce8d8..0000000 --- a/System/Drive/Functions/Cache.py +++ /dev/null @@ -1,253 +0,0 @@ -print( - """\n| | |============Cache===========| -| | |1 | Remove All Git Downloads| -| | |2 | Reset Events / Log | -| | |X | RXsXt XlX TX DXfXuXtX | -| | |4 | Display Logs / Events | -| | |5 | Display All CLV Events | -| | |6 | Display All UI Events | -| | |============================|""" -) -inp = input('| | Enter a value: ') -import sys -if inp == '1': - import User - - import User.UserProfile - - # require USER_PASS - import os, time - - cwd = os.getcwd() - - Input = input('Enter Password: ') - try: - import System.Drive.Password as PS - - PS.Password(Event='Cache', Input=Input) - - open(f'{cwd}/System/.Cache/System/GitHub/Int.txt', 'w').close() - open(f'{cwd}/System/.Cache/System/GitHub/Complex', 'w').close() - open(f'{cwd}/System/.Cache/System/GitHub/Complex_install', 'w').close() - import shutil - - try: - shutil.rmtree(f'{cwd}/System/.Cache/System/GitHub/Downloads') - print('| | Update Recorded') - except: - raise exit(0) - - import System.Drive.Errors_Events.EventMan as EV - - EV.NewEvent(event=f'GitCache cleared', Pol=1) - - time.sleep(2) - print(f'\n' * 60) - - except: - Input = input('Enter Password: ') - try: - import System.Drive.Password as PS - - PS.Password(Event='Cache', Input=Input) - - open(f'{cwd}/System/.Cache/System/GitHub/Int.txt', 'w').close() - open(f'{cwd}/System/.Cache/System/GitHub/Complex', 'w').close() - open( - f'{cwd}/System/.Cache/System/GitHub/Complex_install', 'w' - ).close() - import shutil - - try: - shutil.rmtree(f'{cwd}/System/.Cache/System/GitHub/Downloads') - print('| | Update Recorded') - except: - raise exit(0) - - import System.Drive.Errors_Events.EventMan as EV - - EV.NewEvent(event=f'GitCache cleared', Pol=1) - - time.sleep(2) - print(f'\n' * 60) - - except: - print('Final Attempt') - Input = input('Enter Password: ') - try: - import System.Drive.Password as PS - - PS.Password(Event='Cache', Input=Input) - - open(f'{cwd}/System/.Cache/System/GitHub/Int.txt', 'w').close() - open(f'{cwd}/System/.Cache/System/GitHub/Complex', 'w').close() - open( - f'{cwd}/System/.Cache/System/GitHub/Complex_install', 'w' - ).close() - import shutil - - try: - shutil.rmtree( - f'{cwd}/System/.Cache/System/GitHub/Downloads' - ) - print('| | Update Recorded') - except: - raise exit(0) - - import System.Drive.Errors_Events.EventMan as EV - - EV.NewEvent(event=f'GitCache cleared', Pol=1) - - time.sleep(2) - print(f'\n' * 60) - - except: - import System.Drive.Errors_Events.EventMan as EV - - EV.NewEvent( - event=f'GitCache clear attempt failed due to user pass', - Pol=1, - ) - - -elif inp == '2': - import User - import User.UserProfile - - # require USER_PASS - import os, time - - cwd = os.getcwd() - - Input = input('Enter Password: ') - try: - import System.Drive.Password as PS - - PS.Password(Event='Cache', Input=Input) - - try: - open(f'{cwd}/System/.Cache/System/ErrorLog/Events', 'w').close() - open(f'{cwd}/System/.Cache/System/ErrorLog/Errors', 'w').close() - open( - f'{User.UserProfile.SourceDirectory}System/.Cache/System/ErrorLog/Event.db', - 'w', - ) - - print('| | Update Recorded') - import System.Drive.Errors_Events.EventMan as EV - - EV.NewEvent(event=f'Errors & Events cleared', Pol=1) - - time.sleep(2) - print(f'\n' * 60) - except: - pass - - except: - Input = input('Enter Password: ') - try: - import System.Drive.Password as PS - - PS.Password(Event='Cache', Input=Input) - - try: - open(f'{cwd}/System/.Cache/System/ErrorLog/Events', 'w').close() - open(f'{cwd}/System/.Cache/System/ErrorLog/Errors', 'w').close() - open( - f'{User.UserProfile.SourceDirectory}System/.Cache/System/ErrorLog/Event.db', - 'w', - ) - print('| | Update Recorded') - import System.Drive.Errors_Events.EventMan as EV - - EV.NewEvent(event=f'Errors & Events cleared', Pol=1) - - time.sleep(2) - print(f'\n' * 60) - except: - pass - - except: - print('Final Attempt') - Input = input('Enter Password: ') - try: - import System.Drive.Password as PS - - PS.Password(Event='Cache', Input=Input) - - try: - open( - f'{cwd}/System/.Cache/System/ErrorLog/Events', 'w' - ).close() - open( - f'{cwd}/System/.Cache/System/ErrorLog/Errors', 'w' - ).close() - open( - f'{User.UserProfile.SourceDirectory}System/.Cache/System/ErrorLog/Event.db', - 'w', - ) - print('| | Update Recorded') - import System.Drive.Errors_Events.EventMan as EV - - EV.NewEvent(event=f'Errors & Events cleared', Pol=1) - - time.sleep(2) - print(f'\n' * 60) - except: - pass - - except: - import System.Drive.Errors_Events.EventMan as EV - - EV.NewEvent(event=f'Failed to reset events and logs', Pol=1) - -if inp == '4': - import sys - import sqlite3 as sl - - import User.UserProfile - - con = sl.connect( - f'{User.UserProfile.SourceDirectory}System/.Cache/System/ErrorLog/Event.db' - ) - - with con: - dataSs = con.execute("SELECT * FROM Event WHERE Type == 'System'") - print('\nsystem Events\n') - - for row in dataSs: - print(row) - - dataUs = con.execute("SELECT * FROM Event WHERE Type == 'User'") - print('\nUser Events\n') - - for row in dataUs: - print(row) - - print('Disconcerting- Re-launch') - import time - - time.sleep(2) - - - sys.exit(0) - -elif inp == '5': - print('_Loading_') - import User.UserProfile - with open(f'{User.UserProfile.SourceDirectory}System/.Cache/System/ErrorLog/Events','r') as ev: - print(ev.read()) - input('hit enter to continue: ') - sys.exit(0) - -elif inp == '6': - print('_Loading_') - import User.UserProfile - with open(f'{User.UserProfile.SourceDirectory}System/.Cache/System/ErrorLog/GUIevents','r') as ev: - lines = ev.readlines() - print('\033[1;37;40m=====================') - for line in lines: - print(line,end='') - input('\nhit enter to continue: ') - sys.exit(0) - diff --git a/System/Drive/Functions/Uninstall.py b/System/Drive/Functions/Uninstall.py deleted file mode 100644 index 698de10..0000000 --- a/System/Drive/Functions/Uninstall.py +++ /dev/null @@ -1,258 +0,0 @@ -# - -import os - - -def All(): - import User.UserProfile - - os.chdir(User.UserProfile.SourceDirectory) - cwd = os.getcwd() - - spacer = '====================================================' - - print('=================Available_Packages=================') - print('Local : 1') - print('GitHub : 2') - inp = None - inp = int(input('Enter value to continue: ')) - - if inp == 2: - import System.Drive.Errors_Events.EventMan as EV - - EV.NewEvent(event=f'Inp = GitHub', Pol=1) - - with open(f'{cwd}/System/.Cache/System/GitHub/int.txt', 'r') as r, open( - f'{cwd}/System/.Cache/System/GitHub/int2.txt', 'w' - ) as o: - for line in r: - if line.strip(): - o.write(line) - - f = open(f'{cwd}/System/.Cache/System/GitHub/int2.txt', 'r') - e = open(f'{cwd}/System/.Cache/System/GitHub/Complex2', 'r') - lines = f.readlines() - count = 0 - for line in lines: - count += 1 - - count1 = 0 - for line in lines: - value4 = line.strip() - Val = value4.split('&', 1) - if len(Val) > 0: - value4 = Val[1] - count1 += 1 - - print('{} | {}'.format(count1, value4)) - print(spacer) - - lines2 = e.readlines() - for line2 in lines2: - count1 += 1 - print('{} | {}'.format(count1, line2)) - - valuee = input('Enter a value to continue: ') - # remove a line containing a string - - try: - valuee = int(valuee) - except: - EV.NewEvent(event='Input Error', Pol=1) - - if valuee > count: - dr = int(valuee) - count - command = lines2[dr - 1] - print(command) - co = command.split('$', 1)[0] - print(co) - try: - import System.Drive.Errors_Events.EventMan as EV - import shutil - - shutil.rmtree(co) - - import System.Drive.Errors_Events.EventMan as EV - - print(f'Project Removed {co}') - EV.NewEvent(event=f'DirRemoval = Success! {co}', Pol=0) - - except: - print('Project Failed To Removed') - import System.Drive.Errors_Events.EventMan as EV - - EV.NewEvent(event=f'DirRemoval = Failed ', Pol=0) - - else: - with open( - f'{cwd}/System/.Cache/System/GitHub/int.txt', 'r' - ) as file: - lines5 = file.readlines() - - with open( - f'{cwd}/System/.Cache/System/GitHub/int.txt', 'w' - ) as file: - for linef in lines5: - # find() returns -1 if no match is found - if linef.find(value4) != -1: - pass - else: - file.write(linef) - - value = lines[int(valuee) - 1] - cc = value - listOfWords = value.split('&', 1) - if len(listOfWords) > 0: - value = listOfWords[1] - - value = value.split('-', 1)[0] - - cc = cc.split('@', 1)[0] - - listOfWords = cc.split('/Downloads', 1) - - if len(listOfWords) > 0: - co = listOfWords[1] - - import System.Drive.Errors_Events.EventMan as EV - - EV.NewEvent(event=f'Removing Directory: {cc}', Pol=0) - try: - import System.Drive.Errors_Events.EventMan as EV - import shutil - - shutil.rmtree( - f'{os.getcwd()}/System/.Cache/System/GitHub/Downloads{co}' - ) - - import System.Drive.Errors_Events.EventMan as EV - - print('Project Removed') - EV.NewEvent(event=f'DirRemoval = Success! ', Pol=0) - - except: - print('Project Failed To Removed') - import System.Drive.Errors_Events.EventMan as EV - - EV.NewEvent(event=f'DirRemoval = Failed ', Pol=0) - - elif inp == 1: - import System.Drive.Errors_Events.EventMan as EV - - EV.NewEvent(event=f'Inp = Local', Pol=1) - - f = open(f'{cwd}/System/.Cache/System/Local/Int2.txt', 'r') - - with open(f'{cwd}/System/.Cache/System/Local/Int.txt', 'r') as r, open( - f'{cwd}/System/.Cache/System/Local/Int2.txt', 'w' - ) as o: - for line in r: - if line.strip(): - o.write(line) - f = open(f'{cwd}/System/.Cache/System/Local/Int2.txt', 'r') - - lines = f.readlines() - count = 0 - for line in lines: - count += 1 - - count1 = 0 - for line in lines: - count1 += 1 - print('{} | {}'.format(count1, line.strip())) - print(spacer) - if count1 == count: - import System.Drive.Errors_Events.EventMan as EV - - valuee = input('Enter a value to continue: ') - EV.NewEvent(event=f'valuee ={valuee}', Pol=1) - try: - valuee = int(valuee) - except: - EV.NewEvent(event=f'Input error', Pol=1) - - value = lines[valuee - 1] - listOfWords = value.split('-', 1) - - if len(listOfWords) > 0: - valueg = listOfWords[1] - - with open( - f'{cwd}/System/.Cache/System/Local/Int.txt', 'r' - ) as file: - lines55 = file.readlines() - try: - with open( - f'{cwd}/System/.Cache/System/Local/Int.txt', 'w' - ) as file: - for lineff in lines55: - if lineff.find(value) != -1: - pass - else: - file.write(lineff) - import System.Drive.Errors_Events.EventMan as EV - - EV.NewEvent(event=f'Launch Command Removed', Pol=0) - - except: - import System.Drive.Errors_Events.EventMan as EV - - EV.NewEvent( - event=f'Launch Command Failed To Remove', Pol=0 - ) - - try: - value1 = value.split(f'-', 1)[0] - Str = value1[: len(value1) - 1] - import System.Drive.Errors_Events.EventMan as EV - - EV.NewEvent(event=f'Success: {Str}', Pol=0) - except: - value1 = value.split(f'@', 1)[0] - import System.Drive.Errors_Events.EventMan as EV - - EV.NewEvent(event=f'Failure: {value1}', Pol=1) - - try: - try: - import System.Drive.Errors_Events.EventMan as EV - - # Remove all characters before the character '-' from string - listOfWords = value1.split('"', 1) - if len(listOfWords) > 0: - v = listOfWords[1] - EV.NewEvent( - event=f'Attempting [!]{v[1:-1]}[!]', Pol=0 - ) - import shutil - - shutil.rmtree(v[1:-1]) - EV.NewEvent( - event=f'Directory Removed [!]{v[1:-1]}[!]', - Pol=0, - ) - print('Project Removed') - except: - import System.Drive.Errors_Events.EventMan as EV - - # Remove all characters before the character '-' from string - listOfWords = value1.split('+', 1) - if len(listOfWords) > 0: - v = listOfWords[1] - EV.NewEvent( - event=f'Attempting [!]{v[:-4]}[!]', Pol=0 - ) - import shutil - - shutil.rmtree(v[:-1]) - shutil.rmtree(v[:-4]) - EV.NewEvent( - event=f'Directory Removed [!]{v[:-4]}[!]', - Pol=0, - ) - print('Project Removed') - except: - print('Project Failed To Remove') - import System.Drive.Errors_Events.EventMan as EV - - EV.NewEvent(event=f'Dir Removal Canceled', Pol=0) diff --git a/System/Drive/Icon.png b/System/Drive/Icon.png deleted file mode 100644 index e69de29..0000000 diff --git a/System/Drive/Login.py b/System/Drive/Login.py deleted file mode 100644 index 9206eaf..0000000 --- a/System/Drive/Login.py +++ /dev/null @@ -1,65 +0,0 @@ -''' -this script handles user authentication by validating -the entered password, with multiple retries if necessary, -and checks for device restrictions based on the device's UUID. -If the device is not restricted, the user is allowed to log in. - - - -''' -import sys -import User.UserProfile - - -def Login(): - import time - print(''' - ====================================== - [[[[[[[[[[[LOG IN TO CONTINUE]]]]]]]]] - ======================================''') - Input = input('Enter Password: ') - try: - import System.Drive.Password as PS - - PS.Password(Event='Login', Input=Input) - print('Logged In Successfully!') - time.sleep(1.54) - print('\n' * 100) - except: - Input = input('Enter Password: ') - try: - import System.Drive.Password as PS - - PS.Password(Event='Login', Input=Input) - print('Logged In Successfully!') - time.sleep(1.54) - print('\n' * 100) - except: - print('Final Try') - Input = input('Enter Password: ') - try: - import System.Drive.Password as PS - - PS.Password(Event='Login', Input=Input) - print('Logged In Successfully!') - time.sleep(1.54) - print('\n' * 100) - except: - sys.exit(0) - - -Blocked = open(f'{User.UserProfile.SourceDirectory}User/Blocked', 'r') -Blocked = Blocked.read() -import uuid - -UUID = uuid.uuid1() -UUID = str(f'{UUID}') -uuidToken = UUID[30:] -if uuidToken in Blocked: - import System.Drive.Errors_Events.EventMan as EV - - EV.NewEvent(event='Device Restricted Due To NonOriginDevice', Pol=0) - print('This Device Has Been Restricted') - sys.exit(0) -else: - Login() diff --git a/System/Drive/ModuleVerifier.py b/System/Drive/ModuleVerifier.py deleted file mode 100644 index 7708f6c..0000000 --- a/System/Drive/ModuleVerifier.py +++ /dev/null @@ -1,51 +0,0 @@ -''' -this script is responsible for managing module imports and installations -and provides information about the success or failure of these operations, -potentially as part of an initialization or setup process for the application. -''' - - - - -import os -import sys - -try: - import System.Requirements.Information - import User.UserProfile -except: - pass - -try: - if User.UserProfile.Force_Import_Request is False: - import System.Drive.Errors_Events.EventMan as EV - - EV.NewEvent(event=f'Import Test Aborted Due To User Settings', Pol=0) - else: - pass - -except: - Modules = System.Requirements.Information.Modules - for Module in Modules: - try: - __import__(Module) - print('Successfully imported ', Module, '.') - import System.Drive.Errors_Events.EventMan as EV - - EV.NewEvent(event=f'Import_Success = {Module}', Pol=0) - except ImportError: - print('Error importing ', Module, '.') - import System.Drive.Errors_Events.EventMan as EV - - EV.NewEvent(event=f'Import_Failed = {Module}', Pol=0) - try: - os.system(f'python3 -m pip install {Module}') - os.system(f'pip3 install {Module}') - except: - print('Module failed to install') - sys.exit(0) - - import time - - time.sleep(1) - print('\n' * 100) diff --git a/System/Drive/Password.py b/System/Drive/Password.py deleted file mode 100644 index bcc26ec..0000000 --- a/System/Drive/Password.py +++ /dev/null @@ -1,166 +0,0 @@ -''' - -this script is primarily concerned with password authentication, -device and user identity validation, and decryption of files when -logging in. It ensures security and user authentication for the GitHub -Package Manager application. - --Revised Monday, September 25, 2023 - -''' -import os -import time - -from cryptography.fernet import Fernet -import hashlib - -import User.UserProfile - - - -import System.Drive.Errors_Events.EventMan as EV -import uuid -EV.PushAnalytics(a1=uuid.uuid1().hex, a2='Password_Authentication', a3='None') - -def Password(Event, Input): - print('\033[0;31m') - import User.UserProfile - import hashlib - import uuid - import sys - import os - import System.Drive.Errors_Events.EventMan as EV - import uuid - EV.PushAnalytics(a1=uuid.uuid1().hex, a2='Password_Authentication', a3='None') - UUID = uuid.uuid1() - - UserID = os.getlogin() - - salt = '9lk' - - UUID = str(f'{UUID}') - - uuidToken = UUID[30:] - DefaultTkn = User.UserProfile.uuid1 - - if uuidToken in DefaultTkn: - EV.NewEvent(event='Same Device As Created On = True', Pol=0) - elif uuidToken == DefaultTkn: - EV.NewEvent(event='Same Device As Created On = True', Pol=0) - else: - EV.NewEvent( - event='Same Device As Created On = False! ->> WARNING Separate Device', - Pol=0, - ) - Usr = open(f'{User.UserProfile.SourceDirectory}User/Blocked', 'a') - Usr.write(f'\n{uuidToken}') - Usr.close() - - if UserID == User.UserProfile.UserPrivileges: - EV.NewEvent(event='Same User As Configured = True', Pol=0) - else: - print(UserID) - EV.NewEvent( - event='Same User As Configured = False! ->> WARNING Not Original User', - Pol=0, - ) - - Password = f'{Input}{uuidToken}{UserID}' - - password = Password + salt - hashed = hashlib.md5(password.encode()) - Password = hashed.hexdigest() - - if Password == User.UserProfile.Password: - import System.Drive.Errors_Events.EventMan as EV - - EV.NewEvent(event=f'Password Correct {Event}\033[0;35m', Pol=1) - - else: - print('Password incorrect. Try again\033[0;35m') - sys.exit(0) - - if Event == 'Login': - try: - print('initiate') - import User.UserProfile as up - import os - import glob - import struct - from Crypto.Cipher import AES - - # Set the directory to decrypt and the password to use - directory = f'{User.UserProfile.SourceDirectory}System/.Cache' - - password = hashed.hexdigest()[:16] - - # Pad the password to a multiple of 16 bytes - password = password + ' ' * (16 - (len(password) % 16)) - - # Iterate over all files in the directory and its subdirectories and decrypt them - for filename in glob.glob( - os.path.join(directory, '**'), recursive=True - ): - if os.path.isfile(filename) and filename.endswith('.enc'): - with open(filename, 'rb') as f_in: - # Read the nonce, tag, and encrypted data from the file - nonce = f_in.read(16) - tag = f_in.read(16) - encrypted_data = f_in.read() - # Create a new AES cipher with the password and mode - cipher = AES.new( - password.encode('utf-8'), AES.MODE_EAX, nonce=nonce - ) - try: - # Decrypt the data with the cipher - data = cipher.decrypt_and_verify( - encrypted_data, tag - ) - except ValueError: - print(f'Failed to decrypt file: {filename}') - continue - with open(filename[:-4], 'wb') as f_out: - # Write the decrypted data to a new file with the same name but without the .enc extension - f_out.write(data) - # Remove the encrypted file - os.remove(filename) - - # Print a message indicating the decryption is complete - print('Decryption complete') - - except: - pass - - -def Create(): - import User.UserProfile - import hashlib - import uuid - - Input = input('Enter Your New Password: ') - UUID = uuid.uuid1() - - UserID = os.getlogin() - - salt = '9lk' - - UUID = str(f'{UUID}') - - uuidToken = UUID[30:] - DefaultTkn = User.UserProfile.uuid1 - - Password = f'{Input}{uuidToken}{UserID}' - - password = Password + salt - hashed = hashlib.md5(password.encode()) - Password = hashed.hexdigest - up = open(f'{os.getcwd()}/User/UserProfile.py', 'a') - up.write(f"\nPassword = '{Password}'") - with open( - f'{User.UserProfile.SourceDirectory}System/.Cache/User/local', 'w' - ) as bl: - bl.write(hashed.hexdigest()[:16]) - print(Password) - - - diff --git a/System/Drive/UI_Functions/Activate.py b/System/Drive/UI_Functions/Activate.py deleted file mode 100644 index 3613b4a..0000000 --- a/System/Drive/UI_Functions/Activate.py +++ /dev/null @@ -1,463 +0,0 @@ -import datetime -import inspect -import platform -import re -import socket -import subprocess -from tkinter import ttk -import System.Drive.Errors_Events.EventMan as AR - -global os -import os -import sys -import time -import User.UserProfile -import System.Drive.Errors_Events.EventMan as EV -global cwd -cwd = User.UserProfile.SourceDirectory - -import uuid -EV.PushAnalytics(a1=uuid.uuid1().hex, a2='Activation', a3='None') - - -def remove_line_by_content(file_path, content_to_remove): - try: - with open(file_path, 'r') as file: - lines = file.readlines() - - with open(file_path, 'w') as file: - for line in lines: - if content_to_remove not in line: - file.write(line) - - print(f"Lines containing '{content_to_remove}' removed from {file_path}") - except FileNotFoundError: - print(f"File '{file_path}' not found.") - except Exception as e: - print(f"An error occurred: {e}") - -def is_safe_input(input_str): - EV.guiEvent(4, '', inspect.currentframe().f_lineno, get_current_function(), False, True, 1) - # Regular expression pattern for command injection detection - command_injection_pattern = r"[;&|`'\"\$()<>]" - - # Check if the input string matches the command injection pattern - if re.search(command_injection_pattern, input_str): - return False # The string contains potential command injection - - - return True # The string is considered safe - - -def get_current_function(): - stack = inspect.stack() - frame = stack[1] - code = frame[0] - return code.f_code.co_name - - -def GH(): - import tkinter - EV.guiEvent(4, '', inspect.currentframe().f_lineno, get_current_function(), False, True, 1) - import User - - cwd = User.UserProfile.SourceDirectory - - import os - - with open(f'{cwd}System/.Cache/System/GitHub/int.txt', 'r') as r, open( - f'{cwd}System/.Cache/System/GitHub/int2.txt', 'w' - ) as o: - for line in r: - if line.strip(): - o.write(line) - - f = open(f'{cwd}System/.Cache/System/GitHub/int2.txt', 'r') - - lines = f.readlines() - count = len(lines) - - options = [] - lines_r = [] - for line in lines: - value4 = line.strip() - lines_r.append(value4) - Val = value4.split('&', 1) - if len(Val) > 0: - value4 = Val[1] - - options.append(value4.split("%", 1)[0]) - - window = tkinter.Tk() - window.title('Activate one of the following') - screen_width = window.winfo_screenwidth() - screen_height = window.winfo_screenheight() - window_width = 440 - window_height = 460 - x_coordinate = (screen_width // 2) - (window_width // 2) - y_coordinate = (screen_height // 2) - (window_height // 2) - window.geometry(f"{window_width}x{window_height}+{x_coordinate}+{y_coordinate}") - window.config(bg='#C5E0DC') - - def select_option(selected_option): - window.destroy() - - EV.guiEvent(4, '', inspect.currentframe().f_lineno, get_current_function(), False, True, 1) - print('Selected Option:', selected_option) - - value = lines[int(options.index(selected_option))] - print(value) - cc = value - listOfWords = value.split('&', 1) - if len(listOfWords) > 0: - value = listOfWords[1] - - value = value.split('≈', 1)[0] - - cc = cc.split('@', 1)[0] - cc = cc.split("%", 1)[0] - EV.NewEvent(event=f'Change Directory: {cc} ', Pol=0) - EV.NewEvent(event=f'os command [!]{value}[!] ', Pol=0) - try: - AR.AnalyticsRecord(4) - os.system( - f'osascript -e \'tell application "Terminal" to do script "cd {cc}&&{selected_option}"\'' - ) - - except: - EV.guiEvent(0, f'Directory change failed', inspect.currentframe().f_lineno, os.path.abspath(__file__), - False, True, - 1) - def reinstall(opt, source): - AR.AnalyticsRecord(7) - import System.Drive.UI_Functions.Install - value = lines[int(options.index(opt))] - print(value) - cc = value - listOfWords = value.split('&', 1) - if len(listOfWords) > 0: - value = listOfWords[1] - - value = value.split('-', 1)[0] - - cc = cc.split('@', 1)[0] - cc = cc.split("%", 1)[0] - - - import tkinter as tk - from tkinter import messagebox - import shutil - shutil.rmtree(cc) - remove_line_by_content(file_path=f'{User.UserProfile.SourceDirectory}System/.Cache/System/GitHub/int2.txt', - content_to_remove=opt) - remove_line_by_content(file_path=f'{User.UserProfile.SourceDirectory}System/.Cache/System/GitHub/Int.txt', content_to_remove=opt) - System.Drive.UI_Functions.Install.Installer(value= source) - - - - def updated(selected_option, source): - AR.AnalyticsRecord(6) - EV.guiEvent(4, '', inspect.currentframe().f_lineno, get_current_function(), False, True, 1) - value = lines[int(options.index(selected_option))] - print(value) - cc = value - listOfWords = value.split('&', 1) - if len(listOfWords) > 0: - value = listOfWords[1] - - value = value.split('-', 1)[0] - - cc = cc.split('@', 1)[0] - cc = cc.split("%", 1)[0] - - try: - import tkinter as tk - from tkinter import messagebox - print(f"Updating {source}") - import shutil - shutil.rmtree(cc) - os.chdir(f'{User.UserProfile.SourceDirectory}System/.Cache/System/Github/Downloads') - print('trying update') - try: - import tkinter as tk - from tkinter import messagebox - if not is_safe_input(source): - print("Unsafe input! Potential command injection detected.") - return - - command = f'git clone {source}' - subprocess.call(command, shell=True) - messagebox.showinfo("Update Successful", "has been successfully updated.") - except: - EV.guiEvent(0, f'{get_current_function()} git clone update failed', inspect.currentframe().f_lineno, os.path.abspath(__file__), - True, True, - 1) - - except: - import tkinter as tk - from tkinter import messagebox - print(f'') - messagebox.showinfo("Update Failed", f"Update Failed {source}") - EV.guiEvent(0, f'{get_current_function()} Update Failed {source}', inspect.currentframe().f_lineno, os.path.abspath(__file__), - False, True, - 1) - - def open_option_window(event, option): - EV.guiEvent(4, '', inspect.currentframe().f_lineno, get_current_function(), False, True, 1) - option_window = tkinter.Toplevel() - option_window.title(option) - option_window.geometry("300x200") - screen_width = option_window.winfo_screenwidth() - screen_height = option_window.winfo_screenheight() - window_width = 440 - window_height = 460 - x_coordinate = (screen_width // 2) - (window_width // 2) - y_coordinate = (screen_height // 2) - (window_height // 2) - option_window.config(bg='#C5E0DC') - option_window.geometry(f"{window_width}x{window_height}+{x_coordinate}+{y_coordinate}") - - for line in lines_r: - if option in line: - try: - Val = line.split('#', 1) - if len(Val) > 0: - global date - date = Val[1] - except: - print('package install date not available') - date = 'unavailable' - - try: - Val = line.split('%', 1) - if len(Val) > 0: - sourcex = Val[1] - global source - source = sourcex.split("#", 1)[0] - except: - print('Source unavailable') - source = 'unavailable' - - information = f''' - Date downloaded: {date} - Downloaded from: {source} - ''' - - info_label = ttk.Label(option_window, text=information) - info_label.pack(pady=10) - - launch_button = ttk.Button(option_window, text="Launch", command=lambda opt=option: ((select_option(opt)),(option_window.destroy()))) - launch_button.pack(pady=5) - - re_button = ttk.Button(option_window, text="Reinstall",command=lambda opt=option, source=source.split("#", 1)[0]: reinstall(opt, source)) - re_button.pack(pady=5) - - update_button = ttk.Button(option_window, text="Update", - command=lambda opt=option, source=source.split("#", 1)[0]: updated(opt, source)) - update_button.pack(pady=5) - - option_window.transient(window) - option_window.grab_set() - option_window.focus_set() - - for option in options: - b = ttk.Button(window, text=option, command=lambda opt=option: select_option(opt)) - b.pack(pady=5) - b.bind("", lambda event, opt=option: open_option_window(event, opt)) - - window.mainloop() - - -def Activate(): - EV.guiEvent(4, '', inspect.currentframe().f_lineno, get_current_function(), False, True, 1) - print(cwd) - import tkinter as tk - from tkinter import messagebox - - result1 = messagebox.askyesno('User GitHub Check', 'Use GitHub applications?') - - if result1: - GH() - else: - result2 = messagebox.askyesno('User GitHub Check', 'Use Local applications?') - - if result2: - options = [] - - with open(f'{cwd}System/.Cache/System/Local/Int.txt', 'r') as r, open( - f'{cwd}System/.Cache/System/Local/Int2.txt', 'w' - ) as o: - for line in r: - if line.strip(): - o.write(line) - f = open(f'{cwd}System/.Cache/System/Local/Int2.txt', 'r') - - lines = f.readlines() - count = len(lines) - - count1 = 0 - for line in lines: - count1 += 1 - options.append(line.strip()) - - window = tk.Tk() - window.title('Activate one of the following') - screen_width = window.winfo_screenwidth() - screen_height = window.winfo_screenheight() - window_width = 440 - window_height = 460 - x_coordinate = (screen_width // 2) - (window_width // 2) - y_coordinate = (screen_height // 2) - (window_height // 2) - window.geometry(f"{window_width}x{window_height}+{x_coordinate}+{y_coordinate}") - window.config(bg='#C5E0DC') - - def select_option(selected_option): - EV.guiEvent(4, '', inspect.currentframe().f_lineno, get_current_function(), False, True, 1) - print('Selected Option:', selected_option) - - pass # event=f'{count1}={count} --COMMAND LINE', Pol=0) - value = lines[int(options.index(selected_option))] - listOfWords = value.split('≈', 1) - if len(listOfWords) > 0: - valueg = listOfWords[1] - print(valueg) - - value1 = value.split(f'@', 1)[0] - - listOfWords = value.split('+', 1) - if len(listOfWords) > 0: - value = listOfWords[1] - - value = value.split('≈', 1)[0] - - try: - print(valueg[:-2]) - print(value) - AR.AnalyticsRecord(3) - os.system( - f'osascript -e \'tell application "Terminal" to do script "cd {value} && {valueg[:-2]}"\'' - ) - except: - EV.guiEvent(0, f'{get_current_function()} either Dir change failed or {valueg[:-2]}', inspect.currentframe().f_lineno, - os.path.abspath(__file__), False, True, - 1) - - for option in options: - b = tk.Button( - window, - text=option, - command=lambda opt=option: select_option(opt), - ) - b.pack() - - window.mainloop() - - else: - result3 = messagebox.askyesno('User Advanced Check', 'Use Advanced GitHub applications?') - - if result3: - options = [] - with open(f'{cwd}System/.Cache/System/GitHub/Complex', 'r') as r, open( - f'{cwd}System/.Cache/System/GitHub/Complex2', 'w' - ) as o: - for line in r: - if line.strip(): - o.write(line) - - f = open(f'{cwd}System/.Cache/System/GitHub/Complex2', 'r') - - linesd = f.readlines() - count = len(linesd) - - count1 = 0 - options = [line.strip() for line in linesd] - - window = tk.Tk() - window.title('Activate one of the following') - screen_width = window.winfo_screenwidth() - screen_height = window.winfo_screenheight() - window_width = 440 - window_height = 460 - x_coordinate = (screen_width // 2) - (window_width // 2) - y_coordinate = (screen_height // 2) - (window_height // 2) - window.geometry(f"{window_width}x{window_height}+{x_coordinate}+{y_coordinate}") - window.config(bg='#C5E0DC') - - def select_option(selected_option): - EV.guiEvent(4, '', inspect.currentframe().f_lineno, get_current_function(), False, True, 1) - print('Selected Option:', selected_option) - - def submit(): - EV.guiEvent(4, '', inspect.currentframe().f_lineno, get_current_function(), False, True, 1) - name = entry_name.get() - window2.destroy() - window.destroy() - Arges = name - - B = value.split('$', 1)[0] - - lis = value.split('$', 1) - if len(lis) > 0: - lis = lis[1] - - A = f'{lis} {Arges}' - - r = open(f'{cwd}System/.Cache/System/GitHub/Complex_install', 'r') - lines = r.readlines() - - for line in lines: - try: - os.system(line) - except: - EV.guiEvent(0, f'{get_current_function()} failed {line}', - inspect.currentframe().f_lineno, os.path.abspath(__file__), True, True, 1) - - open(f'{cwd}System/.Cache/System/GitHub/Complex_install', 'w') - - try: - AR.AnalyticsRecord(5) - os.system( - f'osascript -e \'tell application "Terminal" to do script "cd {B}&&{A}"\'' - ) - except: - EV.guiEvent(0, f'{get_current_function()} either Dir change failed or {A}', - inspect.currentframe().f_lineno, os.path.abspath(__file__), False, True, 1) - - value = selected_option - window2 = tk.Tk() - window2.title('Package Inform') - screen_width = window2.winfo_screenwidth() - screen_height = window2.winfo_screenheight() - window_width = 440 - window_height = 460 - x_coordinate = (screen_width // 2) - (window_width // 2) - y_coordinate = (screen_height // 2) - (window_height // 2) - window2.geometry(f"{window_width}x{window_height}+{x_coordinate}+{y_coordinate}") - window2.config(bg='#C5E0DC') - - label_name = tk.Label( - window2, text='Any Launch Arguments: ' - ) - entry_name = tk.Entry(window2) - - label_name.pack() - entry_name.pack() - - button = tk.Button( - window2, text='Submit', command=submit - ) - button.pack() - - window2.mainloop() - - for option in options: - b = tk.Button( - window, - text=option, - command=lambda opt=option: select_option(opt), - ) - b.pack() - - window.mainloop() - else: - pass - diff --git a/System/Drive/UI_Functions/ConnectServer.py b/System/Drive/UI_Functions/ConnectServer.py deleted file mode 100644 index 1fbb6f1..0000000 --- a/System/Drive/UI_Functions/ConnectServer.py +++ /dev/null @@ -1,38 +0,0 @@ - -import datetime -import inspect -import platform -import re -import socket -import subprocess -from tkinter import ttk, messagebox - -global os -import os -import sys -import time -import User.UserProfile -import System.Drive.Errors_Events.EventMan as EV -global cwd - -cwd = User.UserProfile.SourceDirectory - -import System.Drive.Errors_Events.EventMan as EV -import uuid -EV.PushAnalytics(a1=uuid.uuid1().hex, a2='Starting_Server', a3='None') -def get_current_function(): - stack = inspect.stack() - frame = stack[1] - code = frame[0] - return code.f_code.co_name - -def start_server(): - EV.guiEvent(4, '', inspect.currentframe().f_lineno, get_current_function(), False, True, 1) - server_file_path = f"{User.UserProfile.SourceDirectory}System/.Cache/System/Local/download/server.js" - try: - os.chdir(f'{User.UserProfile.SourceDirectory}System/.Cache/System/Local/download') - subprocess.Popen(['node', server_file_path]) - messagebox.showinfo("Success", "Server started successfully!") - EV.guiEvent(0, 'server started', inspect.currentframe().f_lineno, get_current_function(), False, True, 1) - except Exception as e: - messagebox.showerror("Error", f"Failed to start server:\n{str(e)}") \ No newline at end of file diff --git a/System/Drive/UI_Functions/Information.py b/System/Drive/UI_Functions/Information.py deleted file mode 100644 index f82ca70..0000000 --- a/System/Drive/UI_Functions/Information.py +++ /dev/null @@ -1,78 +0,0 @@ -import datetime -import inspect -import platform -import re -import socket -import subprocess -from tkinter import ttk -import User.UserProfile -import System.Drive.Errors_Events.EventMan as EV -import tkinter as tk -from tkinter.font import Font -cwd = User.UserProfile.SourceDirectory - - -import System.Drive.Errors_Events.EventMan as EV -import uuid -EV.PushAnalytics(a1=uuid.uuid1().hex, a2='Information', a3='None') -def get_current_function(): - stack = inspect.stack() - frame = stack[1] - code = frame[0] - return code.f_code.co_name - - -def show_information(): - EV.guiEvent(4, '', inspect.currentframe().f_lineno, get_current_function(), False, True, 1) - - info_window = tk.Tk() - info_window.title('Information') - - # Set window size and position - screen_width = info_window.winfo_screenwidth() - screen_height = info_window.winfo_screenheight() - window_width = 440 - window_height = 460 - - alpha_value = 0.93 # Adjust the alpha value as needed - - info_window.attributes("-alpha", alpha_value) - - # Create a canvas to act as the window's background with a colored rectangle - canvas = tk.Canvas(info_window, width=526, height=505) - - # Set the canvas background color - bg_color = '#EE85B5' - canvas.create_rectangle(0, 0, 526, 505, fill=bg_color, outline="") - - x_coordinate = (screen_width // 2) - (window_width // 2) - y_coordinate = (screen_height // 2) - (window_height // 2) - info_window.geometry(f"{window_width}x{window_height}+{x_coordinate}+{y_coordinate}") - - info_text = """ - GHPM (GitHub Package Manager) is a lightweight package manager designed to efficiently manage coding projects and applications. - - Key Features: - - Simplified Logic: GHPM focuses on basic and straightforward logic, making it easy to use and understand. - - Code Management: It effectively manages coding projects, allowing you to organize and maintain your codebase. - - Package Installation: GHPM streamlines the installation of project requirements and dependencies. - - GHPM is a powerful yet lightweight solution for managing your code projects. Give it a try and experience the simplicity and efficiency it offers! - """ - - container = tk.Frame(info_window, bg='#F2E8C4', bd=2, relief=tk.SOLID) - container.pack(fill=tk.BOTH, expand=True, padx=20, pady=20) - - text_widget = tk.Label(container, text=info_text, bg='#F2E8C4', fg='#7E4A35', justify=tk.LEFT, wraplength=400) - text_widget.pack(fill=tk.BOTH, expand=True) - - # Apply text styling - font = Font(family="TkDefaultFont", size=15, weight="bold") - text_widget.config(font=font) - - okay_button = ttk.Button(info_window, text='Okay', command=info_window.destroy, style='Custom.TButton') - okay_button.pack(pady=10) - - info_window.mainloop() - - diff --git a/System/Drive/UI_Functions/Install.py b/System/Drive/UI_Functions/Install.py deleted file mode 100644 index cb229a7..0000000 --- a/System/Drive/UI_Functions/Install.py +++ /dev/null @@ -1,632 +0,0 @@ -import datetime -import inspect -import subprocess -from tkinter import ttk -import System.Drive.Errors_Events.EventMan as AR -global os -import User.UserProfile - -import System.Drive.Errors_Events.EventMan as EV -global cwd -cwd = User.UserProfile.SourceDirectory -import tkinter as tk -import os - -def do_something_with_value(value): - EV.guiEvent(4, '', inspect.currentframe().f_lineno, get_current_function(), False, True, 1) - from urllib.parse import urlparse - - def is_url(string): - EV.guiEvent(4, '', inspect.currentframe().f_lineno, get_current_function(), False, True, 1) - parsed_url = urlparse(string) - return bool(parsed_url.scheme) - - if is_url(string=value): - install_window.destroy() - try: - Installer(value) - except: - EV.guiEvent(0, - f'{get_current_function()} Error: Package Installer Failed {value}', - inspect.currentframe().f_lineno, - os.path.abspath(__file__), False, True, - 4) - else: - Files0 = [] - ImportDirectory = value - for path in os.listdir(ImportDirectory): - if os.path.isfile(os.path.join(ImportDirectory, path)): - Files0.append(path) - - counter = 0 - for file in Files0: - counter += 1 - print(f'{counter} | {file}') - - def button_click(item): - EV.guiEvent(4, '', inspect.currentframe().f_lineno, get_current_function(), False, True, 1) - root.destroy() - fi = Files0.index(item) - fi = Files0[int(fi)] - - fe = fi.split('.', 1) - if len(fe) > 0: - ffi = fe[1] - - if 'py' in ffi: - p1 = f'+{ImportDirectory} ≈python3 {ImportDirectory}/{fi}*' - elif ffi == '.c': - p1 = f'+{ImportDirectory} ≈gcc {ImportDirectory}/{fi}*' - elif 'cpp' in ffi: - p1 = f'+{ImportDirectory} ≈gpp {ImportDirectory}/{fi}*' - elif 'sh' in ffi: - p1 = f'+{ImportDirectory} ≈bash {ImportDirectory}/{fi}*' - - Form = f'{fi[:-3]} = "{p1}"' - - f = open(f'{cwd}System/.Cache/System/Local/Int.txt', 'a') - f.write(f'\n{Form}') - f.close() - AR.AnalyticsRecord(1) - import User - - print('Installation Complete!') - os.chdir(User.UserProfile.SourceDirectory) - - root = tk.Tk() - root.title('Local Installer') - - screen_width = root.winfo_screenwidth() - screen_height = root.winfo_screenheight() - window_width = 440 - window_height = 460 - root.config(bg='#C5E0DC') - x_coordinate = (screen_width // 2) - (window_width // 2) - y_coordinate = (screen_height // 2) - (window_height // 2) - root.geometry(f"{window_width}x{window_height}+{x_coordinate}+{y_coordinate}") - - item_list = Files0 - - style = ttk.Style() - style.configure('Custom.TButton', font=('Helvetica', 12), padding=10, background='#DF5D22', foreground='white') - - - - for item in item_list: - ttk.Button( - root, - text=item, - command=lambda i=item: button_click(i), - style='Custom.TButton' - ).pack(pady=5) - - root.mainloop() - - -def get_current_function(): - stack = inspect.stack() - frame = stack[1] - code = frame[0] - return code.f_code.co_name - -def show_install(): - EV.guiEvent(4, '', inspect.currentframe().f_lineno, get_current_function(), False, True, 1) - try: - os.mkdir(f'{cwd}System/.Cache/System/GitHub/Downloads') - except: - EV.guiEvent(0, - f'{get_current_function()} Downloads Dir Already Exists', - inspect.currentframe().f_lineno, - os.path.abspath(__file__), False, True, - 3) - - global install_window - - from tkinter import filedialog - from tkinter import ttk - - def choose_folder(): - EV.guiEvent(4, '', inspect.currentframe().f_lineno, get_current_function(), False, True, 1) - folder_path = filedialog.askdirectory() - install_entry.insert(0, folder_path) - - # Create a Toplevel window for the installation - install_window = tk.Tk() - install_window.title('Install') - install_window.grab_set() - # Set window size and position - screen_width = install_window.winfo_screenwidth() - screen_height = install_window.winfo_screenheight() - window_width = 440 - window_height = 460 - - alpha_value = 0.93 # Adjust the alpha value as needed - - install_window.attributes("-alpha", alpha_value) - - # Create a canvas to act as the window's background with a colored rectangle - canvas = tk.Canvas(install_window, width=526, height=505) - - # Set the canvas background color - bg_color = '#EE85B5' - canvas.create_rectangle(0, 0, 526, 505, fill=bg_color, outline="") - - x_coordinate = (screen_width // 2) - (window_width // 2) - y_coordinate = (screen_height // 2) - (window_height // 2) - install_window.geometry(f"{window_width}x{window_height}+{x_coordinate}+{y_coordinate}") - - # Define the container frame within the installation window - install_frame = tk.Frame(install_window, bg='#EE85B5', bd=2, relief=tk.SOLID) - install_frame.pack(padx=20, pady=20) - - # Create the installation label with custom font and padding - install_label = tk.Label( - install_frame, - text='Enter a path to a local directory or a GitHub repository URL:', - bg="#A6D8CD", - font=('Helvetica', 12, 'bold'), - padx=10, - pady=10 - ) - install_label.pack() - - # Create the installation entry field with custom font and padding - install_entry = tk.Entry( - install_frame, - font=('Helvetica', 12), - bd=2, - relief=tk.SOLID - ) - install_entry.pack(pady=10) - - # Create the "Choose folder" button with custom styling - choose_folder_button = ttk.Button( - install_frame, - text='Choose Folder', - command=choose_folder, - style='Custom.TButton' - ) - choose_folder_button.pack(pady=10) - - # Create the "Submit" button with custom styling - install_submit = ttk.Button( - install_frame, - text='Submit', - command=lambda: do_something_with_value(install_entry.get()), - style='Custom.TButton' - ) - install_submit.pack(pady=20) - - # Create the installation label with custom font and padding - installer_label = tk.Label( - install_frame, - text='''--Requirements Auto Install ---Packages can be updated later ---Local dirs cannot be deleted through GHPM ---Read .cache files if you want edit commands -fp: System/.Cache/System/Local/Int.txt''', - bg="#A6D8CD", - font=('Helvetica', 12, 'bold'), - padx=10, - pady=10 - ) - installer_label.pack() - - # Define custom styles for the buttons - install_window.tk.call('source', 'azure.tcl') # Load custom styling file - install_window.tk.call('set_theme', 'light') # Set the theme to light - install_window.tk.call( - 'ttk::style', 'configure', 'Custom.TButton', - '-padding', '10 5', - '-background', '#DF5D22', - '-foreground', 'white', - '-font', 'Helvetica 12', - '-relief', 'raised' - ) - - install_window.mainloop() - - - -def Installer(value): - import System.Drive.Errors_Events.EventMan as EV - EV.guiEvent(4, '', inspect.currentframe().f_lineno, get_current_function(), False, True, 1) - import os - - cwd = User.UserProfile.SourceDirectory - print('checkpoint') - dir = f'{cwd}System/.Cache/System/GitHub/Downloads' - try: - os.mkdir(dir) - EV.guiEvent(0, 'Download dir made', inspect.currentframe().f_lineno, os.path.abspath(__file__), False, True, 1) - except: - EV.guiEvent(0, f'{get_current_function()} download dir already exists', - inspect.currentframe().f_lineno, - os.path.abspath(__file__), False, True, - 1) - print(dir) - os.chdir(dir) - print('checkpoint') - Download_Source = value - SourceURI = value - print('[!] CheckPoint 1|4 [!]') - EV.guiEvent(0, f'downloading from {Download_Source}', inspect.currentframe().f_lineno, os.path.abspath(__file__), - False, True, 2) - Files = [] - for path in os.listdir(cwd): - # check if current path is a file - if os.path.isfile(os.path.join(cwd, path)): - Files.append(path) - - SDir = list(filter(os.path.isdir, os.listdir(os.curdir))) - - try: # downloading from GitHub - import System.Drive.Errors_Events.EventMan as EV - import uuid - - EV.PushAnalytics(a1=uuid.uuid1().hex, a2='Installation', a3=f'downloadined_from={Download_Source}') - os.system(f"git clone '{Download_Source}'") - EV.guiEvent(0, f'{get_current_function()} download complete', inspect.currentframe().f_lineno, - os.path.abspath(__file__), False, True, - 1) - print('[!] CheckPoint 2|4 [!]') - - Files1 = [] - for path in os.listdir(cwd): - # check if current path is a file - if os.path.isfile(os.path.join(cwd, path)): - Files1.append(path) - - SDir1 = list(filter(os.path.isdir, os.listdir(os.curdir))) - - for x in Files1: - if x in Files: - pass - else: - # - pass # event=f'Package Downloaded: {x}', Pol=0) - - for y in SDir1: - if y in SDir: - pass - else: - print('[!] CheckPoint 3|4 [!]') - dir1 = f'{cwd}System/.Cache/System/GitHub/Downloads/{y}' - - ChangeDir = dir1 - - Files0 = ['Complex Installation'] - for path in os.listdir(dir1): - # check if current path is a file - if os.path.isfile(os.path.join(dir1, path)): - Files0.append(path) - - import tkinter as tk - - def button_click(item): - EV.guiEvent(4, '', inspect.currentframe().f_lineno, get_current_function(), False, True, 1) - root.destroy() - fi = Files0.index(item) - print(fi) - - if fi == 0: - AR.AnalyticsRecord(2) - import tkinter as tk - import os - from tkinter import messagebox - - import tkinter.messagebox as messagebox - - def complexgather(): - EV.guiEvent(4, '', inspect.currentframe().f_lineno, get_current_function(), False, True, - 1) - - def set_values(): - EV.guiEvent(4, '', inspect.currentframe().f_lineno, get_current_function(), False, - True, 1) - field1_value = field1.get() - field2_value = field2.get() - field3_value = field3.get() - field4_value = field4.get() - field5_value = field5.get() - field6_value = field6.get() - - values = [ - field1_value, - field2_value, - field3_value, - field4_value, - field5_value, - field6_value, - ] - - import tkinter as tk - - - - for value in values: - print(f'{values.index(value)} : {value}') - # Call the function to show the notification - - try: - # Change the current working directory - - messagebox.showinfo(f"Hold Tight! We're installing {os.path.basename(dir1)}") - command = (f'cd {dir1} && {field2_value}', f'cd {dir1} && {field3_value}', f'cd {dir1} && {field4_value}', f'cd {dir1} && {field5_value}', f'cd {dir1} && {field6_value}') - for i in command: - print(f'running command : {i}') - subprocess.call(i, shell=True) - - - - except: - EV.guiEvent(0, - f'{get_current_function()} Error: Project Was Downloaded But Requirements or Permissions Not Installed', - inspect.currentframe().f_lineno, - os.path.abspath(__file__), False, True, - 3) - - ComplexLcaunch = open( - f'{cwd}System/.Cache/System/GitHub/Complex', - 'a', - ) - ComplexLcaunch.write( - f'\n{dir1}${field1_value}' - ) - Complexinstall = open( - f'{cwd}System/.Cache/System/GitHub/Complex_install', - 'a', - ) - Complexinstall.write( - f'{field3_value}\n{dir1}\n{field4_value}\n{field5_value}\n{field6_value}') - ComplexLcaunch.close() - Complexinstall.close() - root.destroy() - print('Successful Install') - - root = tk.Tk() - root.title('Complex Installation') - screen_width = root.winfo_screenwidth() - screen_height = root.winfo_screenheight() - window_width = 440 - window_height = 460 - x_coordinate = (screen_width // 2) - (window_width // 2) - y_coordinate = (screen_height // 2) - (window_height // 2) - root.geometry(f"{window_width}x{window_height}+{x_coordinate}+{y_coordinate}") - root.config(bg='#4e073a') - - field1_value = tk.StringVar() - field1_label = tk.Label( - root, - text='*required Launch Command (ie. bash ./exe.sh', - ) - field1 = tk.Entry( - root, textvariable=field1_value - ) - field1_label.pack() - field1.pack() - - field2_value = tk.StringVar() - field2_label = tk.Label( - root, - text='Requirements Command (ie. pip install /)', - ) - field2 = tk.Entry( - root, textvariable=field2_value - ) - field2_label.pack() - field2.pack() - - field3_value = tk.StringVar() - field3_label = tk.Label( - root, - text='Privileges Command (ie. chmod -x)', - ) - field3 = tk.Entry( - root, textvariable=field3_value - ) - field3_label.pack() - field3.pack() - - field4_value = tk.StringVar() - field4_label = tk.Label( - root, text='Install Command 1' - ) - field4 = tk.Entry( - root, textvariable=field4_value - ) - field4_label.pack() - field4.pack() - - field5_value = tk.StringVar() - field5_label = tk.Label( - root, text='Install Command 2' - ) - field5 = tk.Entry( - root, textvariable=field5_value - ) - field5_label.pack() - field5.pack() - - field6_value = tk.StringVar() - field6_label = tk.Label( - root, text='Install Command 3' - ) - field6 = tk.Entry( - root, textvariable=field6_value - ) - field6_label.pack() - field6.pack() - - submit_button = tk.Button( - root, text='Set', command=set_values - ) - submit_button.pack() - - root.mainloop() - - complexgather() - - else: - AR.AnalyticsRecord(0) - fi = Files0[int(fi)] - - dashID = [ - 'Requests.txt', - 'Requirements.txt', - 'requests.txt', - 'Requirements.txt', - ] - try: - for dash in dashID: - if dash in Files0: - dash = f'{dir1}/{dash}' - dash1 = ( - f'python3 -m pip install -r {dash}' - ) - import os - try: - os.system(dash1) - - print('Requirements Installed') - except: - EV.guiEvent(0, - f'{get_current_function()} Error: Requirements or Permissions Not Installed', - inspect.currentframe().f_lineno, - os.path.abspath(__file__), False, True, - 3) - except: - EV.guiEvent(0, - f'{get_current_function()} No requirements found', - inspect.currentframe().f_lineno, - os.path.abspath(__file__), False, True, - 2) - - ch = '.' - # Remove all characters before the character '-' from string - listOfWords = fi.split(ch, 1) - if len(listOfWords) > 0: - ffi = listOfWords[1] - - if ffi == 'py': - launch = f'&python3 {fi}' - - tier = f'&python3 {dir1}/{fi}' - print('[!] CheckPoint 4|4 [!]') - print(launch) - import time - Form = f'{ChangeDir}@{fi[:-3]} = {launch}%{SourceURI}#{datetime.datetime.today()}' - # - - pass # event=f'Launch Command Created: {Form}', Pol=0) - cwdd = User.UserProfile.SourceDirectory - f = open( - f'{cwdd}System/.Cache/System/GitHub/Int.txt', - 'a', - ) - f.write(f'\n{Form}') - f.close() - print('Installation Complete!') - - elif ffi == 'c': - launch = f'&gcc {fi}' - - print('[!] CheckPoint 4|4 [!]') - print(launch) - import time - Form = f'{ChangeDir}@{fi[:-3]} = {launch}%{SourceURI}#{datetime.datetime.today()}' - # - - pass # event=f'Launch Command Created: {Form}', Pol=0) - cwdd = User.UserProfile.SourceDirectory - f = open( - f'{cwdd}System/.Cache/System/GitHub/Int.txt', - 'a', - ) - f.write(f'\n{Form}') - f.close() - print('Installation Complete!') - - elif ffi == 'cpp': - launch = f'&g++ {fi}' - - print('[!] CheckPoint 4|4 [!]') - print(launch) - import time - Form = f'{ChangeDir}@{fi[:-3]} = {launch}%{SourceURI}#{datetime.datetime.today()}' - # - - pass # event=f'Launch Command Created: {Form}', Pol=0) - import User.UserProfile as UP - - cwdd = UP.SourceDirectory - f = open( - f'{cwdd}System/.Cache/System/GitHub/Int.txt', - 'a', - ) - f.write(f'\n{Form}') - f.close() - print('Installation Complete!') - - elif ffi == 'sh': - launch = f'&bash {fi}' - - print('[!] CheckPoint 4|4 [!]') - print(launch) - import time - Form = f'{ChangeDir}@{fi[:-3]} = {launch}%{SourceURI}#{datetime.datetime.today()}' - # - - pass # event=f'Launch Command Created: {Form}', Pol=0) - cwdd = User.UserProfile.SourceDirectory - f = open( - f'{cwdd}System/.Cache/System/GitHub/Int.txt', - 'a', - ) - f.write(f'\n{Form}') - f.close() - print('Installation Complete!') - import sys - - import tkinter as tk - from tkinter import ttk - - root = tk.Tk() - root.title('Installed Files') - - screen_width = root.winfo_screenwidth() - screen_height = root.winfo_screenheight() - window_width = 440 - window_height = 460 - x_coordinate = (screen_width // 2) - (window_width // 2) - y_coordinate = (screen_height // 2) - (window_height // 2) - root.geometry(f"{window_width}x{window_height}+{x_coordinate}+{y_coordinate}") - - root.config(bg='#C5E0DC') - - item_list = Files0 - - # Define custom button style - style = ttk.Style() - style.configure('Custom.TButton', font=('Helvetica', 12), padding=10, background='#DF5D22', - foreground='white') - - - for item in item_list: - ttk.Button( - root, - text=item, - command=lambda i=item: button_click(i), - style='Custom.TButton' - ).pack(pady=5) - - root.mainloop() - root.destroy() - - - except: - EV.guiEvent(0, - f'{get_current_function()} Error: Project Was Not Installed', - inspect.currentframe().f_lineno, - os.path.abspath(__file__), False, True, - 3) diff --git a/System/Drive/UI_Functions/KillServer.py b/System/Drive/UI_Functions/KillServer.py deleted file mode 100644 index 1f24954..0000000 --- a/System/Drive/UI_Functions/KillServer.py +++ /dev/null @@ -1,63 +0,0 @@ -''' -this script provides a way to kill a server process -running on a specific port (in this case, port 3000). -It leverages subprocess commands and logs events for -analytics tracking. - -''' - - -import datetime -import inspect -import platform -import re -import socket -import subprocess -from tkinter import ttk - -global os -import os -import sys -import time -import User.UserProfile -import System.Drive.Errors_Events.EventMan as EV -global cwd - -cwd = User.UserProfile.SourceDirectory - - -import uuid -EV.PushAnalytics(a1=uuid.uuid1().hex, a2='Kill_server', a3='None') -def get_current_function(): - stack = inspect.stack() - frame = stack[1] - code = frame[0] - return code.f_code.co_name - -def terminate_process_on_port(port): - EV.guiEvent(4, '', inspect.currentframe().f_lineno, get_current_function(), False, True, 1) - try: - # Execute the command to find the process ID (PID) using the specified port - command = f'lsof -ti :{port}' - pid = subprocess.check_output(command, shell=True).decode('utf-8').strip() - - # Terminate the process using the obtained PID - subprocess.call(['kill', pid]) - EV.guiEvent(0, f'killed {pid}', inspect.currentframe().f_lineno, get_current_function(), False, True, 1) - print(f"Process running on port {port} terminated successfully.") - except subprocess.CalledProcessError: - os.system('''osascript -e 'display notification "Server Not Connected" with title "gpm"' - ''') - sys.exit(0) - - -def kill_server(): - EV.guiEvent(4, '', inspect.currentframe().f_lineno, get_current_function(), False, True, 1) - import subprocess - try: - terminate_process_on_port(3000) - os.system('''osascript -e 'display notification "Server Killed" with title "gpm"' - ''') - EV.guiEvent(4, 'server down', inspect.currentframe().f_lineno, get_current_function(), False, True, 1) - except: - pass diff --git a/System/Drive/UI_Functions/Settings.py b/System/Drive/UI_Functions/Settings.py deleted file mode 100644 index 9e694f6..0000000 --- a/System/Drive/UI_Functions/Settings.py +++ /dev/null @@ -1,1581 +0,0 @@ -import datetime -import inspect -import platform -import re -import socket -import subprocess -from tkinter import ttk, simpledialog - -import requests -import System.Drive.Errors_Events.EventMan as AR -global os -import os -import sys -import time -import User.UserProfile -sd = User.UserProfile.SourceDirectory -import System.Drive.Errors_Events.EventMan as EV -from tkinter import messagebox -import tkinter as tk -cwd = User.UserProfile.SourceDirectory - -AR.AnalyticsRecord(8) - - -import uuid -EV.PushAnalytics(a1=uuid.uuid1().hex, a2='Settings', a3='None') - -def get_current_function(): - stack = inspect.stack() - frame = stack[1] - code = frame[0] - return code.f_code.co_name - - - -def reset_all(): - EV.guiEvent(4, '', inspect.currentframe().f_lineno, get_current_function(), False, True, 1) - import tkinter as tk - from tkinter import simpledialog - - root = tk.Tk() - root.title('Reset All') - root.withdraw() - screen_width = root.winfo_screenwidth() - screen_height = root.winfo_screenheight() - window_width = 440 - window_height = 460 - root.config(bg='#4e073a') - x_coordinate = (screen_width // 2) - (window_width // 2) - y_coordinate = (screen_height // 2) - (window_height // 2) - root.geometry(f"{window_width}x{window_height}+{x_coordinate}+{y_coordinate}") - - import User.UserProfile - - # require USER_PASS - import os, time - - pass - - Input = simpledialog.askstring( - 'Password', 'Enter your password:', show='*' - ) - if Input is None: - pass - else: - sd = User.UserProfile.SourceDirectory[:-1] - try: - import System.Drive.Password as PS - - PS.Password(Event='Cache', Input=Input) - messagebox.showinfo('Password', 'Correct Password') - time.sleep(0.23) - try: - open(f'{cwd}System/.Cache/System/GitHub/Int.txt', 'w').close() - print('| | Int.txt Cleared') - open(f'{cwd}System/.Cache/System/Local/Int.txt', 'w').close() - open(f'{cwd}System/.Cache/System/Local/Int2.txt', 'w').close() - import shutil - directory = f'{cwd}System/.Cache/System/Local' - - for entry in os.scandir(directory): - if entry.is_dir() and entry.name != 'download': - shutil.rmtree(entry.path) - - try: - shutil.rmtree(f'{cwd}System/.Cache/System/GitHub') - os.mkdir(f'{cwd}System/.Cache/System/GitHub') - except: - pass - print('| | dirs made & Cleared') - open(f'{cwd}System/.Cache/System/ErrorLog/GUIevents', 'w').close() - open(f'{cwd}System/.Cache/System/ErrorLog/Events', 'w').close() - open(f'{cwd}System/.Cache/System/ErrorLog/Event.db', 'w').close() - - open(f'{cwd}System/.Cache/System/ErrorLog/GUIevents', 'w') - open(f'{cwd}System/.Cache/User/FirstUseToken.txt', 'w').close() - open(f'{cwd}User/UserProfile.py', 'w').close() - print('| | Int.txt Cleared') - open(f'{cwd}System/.Cache/System/Local/Int.txt', 'w').close() - open(f'{cwd}System/.Cache/System/Local/Int2.txt', 'w').close() - open(f'{cwd}System/.Cache/User/local', 'w').close() - - print(f'| | Update Recorded') - except: - EV.guiEvent(1, - f'{get_current_function()} Error: Incorrect password', - inspect.currentframe().f_lineno, - os.path.abspath(__file__), False, True, - 3) - messagebox.showerror('Password', 'Incorrect Password') - pass # event=f'Everything Failed To Reset Due To Password Error', Pol=0) - raise exit(0) - - time.sleep(2) - print(f'\n' * 60) - - except: - EV.guiEvent(1, - f'{get_current_function()} Error: Incorrect password', - inspect.currentframe().f_lineno, - os.path.abspath(__file__), False, True, - 3) - messagebox.showerror('Password', 'Incorrect Password') - Input = simpledialog.askstring( - 'Password', 'Enter your password:', show='*' - ) - if Input is None: - pass - else: - try: - import System.Drive.Password as PS - - PS.Password(Event='Cache', Input=Input) - messagebox.showinfo('Password', 'Correct Password') - try: - open(f'{cwd}System/.Cache/System/GitHub/Int.txt', 'w').close() - print('| | Int.txt Cleared') - open(f'{cwd}System/.Cache/System/Local/Int.txt', 'w').close() - open(f'{cwd}System/.Cache/System/Local/Int2.txt', 'w').close() - import shutil - directory = f'{cwd}System/.Cache/System/Local' - - for entry in os.scandir(directory): - if entry.is_dir() and entry.name != 'download': - shutil.rmtree(entry.path) - try: - shutil.rmtree(f'{cwd}System/.Cache/System/GitHub') - os.mkdir(f'{cwd}System/.Cache/System/GitHub') - except: - pass - print('| | dirs made & Cleared') - open(f'{cwd}System/.Cache/System/ErrorLog/GUIevents', 'w').close() - open(f'{cwd}System/.Cache/System/ErrorLog/Events', 'w').close() - open(f'{cwd}System/.Cache/System/ErrorLog/Event.db', 'w').close() - - open(f'{cwd}System/.Cache/System/ErrorLog/GUIevents', 'w') - open(f'{cwd}System/.Cache/User/FirstUseToken.txt', 'w').close() - open(f'{cwd}User/UserProfile.py', 'w').close() - print('| | Int.txt Cleared') - open(f'{cwd}System/.Cache/System/Local/Int.txt', 'w').close() - open(f'{cwd}System/.Cache/System/Local/Int2.txt', 'w').close() - open(f'{cwd}System/.Cache/User/local', 'w').close() - - print(f'| | Update Recorded') - except: - EV.guiEvent(1, - f'{get_current_function()} Error: Incorrect password', - inspect.currentframe().f_lineno, - os.path.abspath(__file__), False, True, - 3) - messagebox.showerror('Password', 'Incorrect Password') - pass # event=f'Everything Failed To Reset Due To Password Error', Pol=0) - raise exit(0) - - time.sleep(2) - print(f'\n' * 60) - - except: - EV.guiEvent(1, - f'{get_current_function()} Error: Incorrect password', - inspect.currentframe().f_lineno, - os.path.abspath(__file__), False, True, - 3) - - messagebox.showinfo('Password', 'Final Attempt') - Input = simpledialog.askstring( - 'Password', 'Enter your password:', show='*' - ) - if Input is None: - pass - else: - try: - import System.Drive.Password as PS - - PS.Password(Event='Cache', Input=Input) - messagebox.showinfo('Password', 'Correct Password') - try: - open(f'{cwd}System/.Cache/System/GitHub/Int.txt', 'w').close() - print('| | Int.txt Cleared') - open(f'{cwd}System/.Cache/System/Local/Int.txt', 'w').close() - open(f'{cwd}System/.Cache/System/Local/Int2.txt', 'w').close() - import shutil - directory = f'{cwd}System/.Cache/System/Local' - - for entry in os.scandir(directory): - if entry.is_dir() and entry.name != 'download': - shutil.rmtree(entry.path) - try: - shutil.rmtree(f'{cwd}System/.Cache/System/GitHub') - os.mkdir(f'{cwd}System/.Cache/System/GitHub') - except: - pass - - print('| | dirs made & Cleared') - open(f'{cwd}System/.Cache/System/ErrorLog/GUIevents', 'w').close() - open(f'{cwd}System/.Cache/System/ErrorLog/Events', 'w').close() - open(f'{cwd}System/.Cache/System/ErrorLog/Event.db', 'w').close() - - open(f'{cwd}System/.Cache/System/ErrorLog/GUIevents', 'w') - open(f'{cwd}System/.Cache/User/FirstUseToken.txt', 'w').close() - open(f'{cwd}User/UserProfile.py', 'w').close() - print('| | Int.txt Cleared') - open(f'{cwd}System/.Cache/System/Local/Int.txt', 'w').close() - open(f'{cwd}System/.Cache/System/Local/Int2.txt', 'w').close() - open(f'{cwd}System/.Cache/User/local', 'w').close() - - print(f'| | Update Recorded') - except: - EV.guiEvent(1, - f'{get_current_function()} Error: Cache refused to clear', - inspect.currentframe().f_lineno, - os.path.abspath(__file__), False, True, - 3) - - time.sleep(2) - print(f'\n' * 60) - except: - EV.guiEvent(1, - f'{get_current_function()} Error: Incorrect password', - inspect.currentframe().f_lineno, - os.path.abspath(__file__), False, True, - 3) - -def Create(): - EV.guiEvent(4, '', inspect.currentframe().f_lineno, get_current_function(), False, True, 1) - import User.UserProfile - import hashlib - import uuid - - Input = simpledialog.askstring( - 'Change Password', 'ENTER NEW PASSWORD:', show='*' - ) - UUID = uuid.uuid1() - - UserID = os.getlogin() - - salt = '9lk' - - UUID = str(f'{UUID}') - - uuidToken = UUID[30:] - DefaultTkn = User.UserProfile.uuid1 - - Password = f'{Input}{uuidToken}{UserID}' - - password = Password + salt - hashed = hashlib.md5(password.encode()) - Password = hashed.hexdigest() - messagebox.showinfo('Update', "Click 'Ok' To Accesses New Key") - SourceDirectory = User.UserProfile.SourceDirectory - up = open(f'{SourceDirectory}User/UserProfile.py', 'a') - up.write(f"\nPassword = '{Password}'") - up.close() - print(Password) - -def create_custom_style(): - style = ttk.Style() - style.configure( - "Custom.TButton", - foreground="#2471ed", - background="#3498db", - relief="flat", - padding=10, - font=("Helvetica", 18, "bold") - ) - - - -def settings_window(): - print() - - def do_something(index): - EV.guiEvent(4, '', inspect.currentframe().f_lineno, get_current_function(), False, True, 1) - if index == 0: - # require USER_PASS - import os, time - - Input = simpledialog.askstring('GHPM', 'Enter Password: ') - if Input is None: - pass - else: - try: - import System.Drive.Password as PS - - PS.Password(Event='Forced Login', Input=Input) - - try: - with open(f'{cwd}User/UserProfile.py', 'a') as file: - pass - except: - EV.guiEvent(0, - f'{get_current_function()} Error: UserProfile.py May still be encrypted', - inspect.currentframe().f_lineno, - os.path.abspath(__file__), False, True, - 4) - - import User.UserProfile as up - if up.Force_Import_Request is True: - Status = False - - else: - Status = True - - fileid = open(f'{cwd}User/UserProfile.py', 'a') - fileid.write(f'\nForce_Import_Request = {Status}') - fileid.close() - - messagebox.showinfo('GHPM', 'Update Recorded') - time.sleep(2) - - except: - EV.guiEvent(1, - f'{get_current_function()} Error: Incorrect password: settings not changed', - inspect.currentframe().f_lineno, - os.path.abspath(__file__), False, True, - 3) - Input = simpledialog.askstring('GHPM', 'Enter Password: ') - if Input is None: - pass - else: - try: - import System.Drive.Password as PS - - PS.Password(Event='Forced Login', Input=Input) - - import_token = open(f'{sd}/User/UserProfile.py', 'a') - import User.UserProfile - - if User.UserProfile.Force_Import_Request is True: - Status = False - else: - Status = True - - import_token.write( - f'\nForce_Import_Request = {Status}' - ) - import_token.close() - - # - - pass # event=f'forced Module Import = {Status}', Pol=0) - messagebox.showinfo('GHPM', 'Update Recorded') - time.sleep(2) - - except: - EV.guiEvent(1, - f'{get_current_function()} Error: Incorrect password: settings not changed', - inspect.currentframe().f_lineno, - os.path.abspath(__file__), False, True, - 3) - messagebox.showinfo('Final Attempt') - Input = simpledialog.askstring( - 'GHPM', 'Enter Password: ' - ) - if Input is None: - pass - else: - try: - import System.Drive.Password as PS - - PS.Password(Event='Forced Login', Input=Input) - - import_token = open( - f'{sd}/User/UserProfile.py', 'a' - ) - import User.UserProfile - - if User.UserProfile.Force_Import_Request is True: - Status = False - else: - Status = True - - import_token.write( - f'\nForce_Import_Request = {Status}' - ) - import_token.close() - - # - - pass # event=f'forced Module Import = {Status}', Pol=0) - messagebox.showinfo('GHPM', 'Update Recorded') - time.sleep(2) - - except: - EV.guiEvent(1, - f'{get_current_function()} Error: Incorrect password: settings not changed', - inspect.currentframe().f_lineno, - os.path.abspath(__file__), False, True, - 3) - messagebox.showinfo('GHPM', 'Incorrect Password') - - elif index == 1: - # require USER_PASS - import os, time - - pass - Input = simpledialog.askstring('GHPM', 'Enter Password: ') - if Input is None: - pass - else: - - try: - import System.Drive.Password as PS - - PS.Password(Event='Forced Login', Input=Input) - - import_token = open(f'{sd}/User/UserProfile.py', 'a') - import User.UserProfile - - if User.UserProfile.Forced_Login is True: - Status = False - else: - Status = True - - import_token.write(f'\nForced_Login = {Status}') - import_token.close() - - # - - pass # event=f'ForcedLogin = {Status}', Pol=0) - messagebox.showinfo('GHPM', 'Update Recorded') - time.sleep(2) - - except: - EV.guiEvent(1, - f'{get_current_function()} Error: Incorrect password: settings not changed', - inspect.currentframe().f_lineno, - os.path.abspath(__file__), False, True, - 3) - Input = simpledialog.askstring('GHPM', 'Enter Password: ') - if Input is None: - pass - else: - try: - import System.Drive.Password as PS - - PS.Password(Event='Forced Login', Input=Input) - - import_token = open(f'{sd}/User/UserProfile.py', 'a') - import User.UserProfile - - if User.UserProfile.Forced_Login is True: - Status = False - else: - Status = True - - import_token.write(f'\nForced_Login = {Status}') - import_token.close() - - # - - pass # event=f'ForcedLogin = {Status}', Pol=0) - messagebox.showinfo('GHPM', 'Update Recorded') - time.sleep(2) - messagebox.showinfo(f'\n' * 60) - except: - EV.guiEvent(1, - f'{get_current_function()} Error: Incorrect password: settings not changed', - inspect.currentframe().f_lineno, - os.path.abspath(__file__), False, True, - 3) - messagebox.showinfo('Final Attempt') - - simpledialog.askstring('GHPM', 'Enter Password: ') - try: - import System.Drive.Password as PS - - PS.Password(Event='Forced Login', Input=Input) - - import_token = open( - f'{sd}/User/UserProfile.py', 'a' - ) - import User.UserProfile - - if User.UserProfile.Forced_Login is True: - Status = False - else: - Status = True - - import_token.write(f'\nForced_Login = {Status}') - import_token.close() - - # - - pass # event=f'ForcedLogin = {Status}', Pol=0) - messagebox.showinfo('GHPM', 'Update Recorded') - time.sleep(2) - messagebox.showinfo(f'\n' * 60) - except: - EV.guiEvent(1, - f'{get_current_function()} Error: Incorrect password: settings not changed', - inspect.currentframe().f_lineno, - os.path.abspath(__file__), False, True, - 3) - messagebox.showinfo( - 'GHPM', 'Wrong Password Entered' - ) - pass - - # - - pass # event=f'Updated Canceled', Pol=0) - - elif index == 2: - target = open(f'{sd}/User/UserProfile.py', 'a') - import User - - Cstat = User.UserProfile.DisplayEvents - if Cstat is True: - status = False - else: - status = True - - target.write(f'\nDisplayEvents = {status}') - target.close() - messagebox.showinfo('Update', f'DisplayEvents set to {status}') - - elif index == 3: - import os - - pass # event='Creating Global Alias', Pol=10) - import User - - alias = f"""echo 'alias gh="cd {User.UserProfile.SourceDirectory} &&python3 gh.py"' >> ~/.zshrc && exec zsh -l""" - try: - print(alias) - os.system(alias) - except: - EV.guiEvent(0, - f'{get_current_function()} Error: Global alias not installed', - inspect.currentframe().f_lineno, - os.path.abspath(__file__), False, True, - 4) - - messagebox.showinfo( - 'GHPM', - f"""To Launch The CLI, In your terminal all you need to do is run gh (arg) - - examples: - [gh -I https://github.com/SomeUser/Something.git] -> this installs the repo following -I - [gh -IL /Users/Someone/Something] -> this will import all of the files within the specified directory - - ====================================== - Help - ==== - -I -> Install (arg) - -IL -> Install Local (arg) - - -LA -> List All Installs - -LL -> Launch Local Directory - -LG -> Launch Git Project - -LC -> Launch Advanced Projects - - -UG -> Uninstall GitHub Projects - -UL -> Uninstall Local directories""", - ) - messagebox.showinfo('CLI', 'now available') - elif index == 4: - import os - - Name = simpledialog.askstring( - 'GHPM', 'Enter Your Desired UserName: ' - ) - up = open(f'{sd}/User/UserProfile.py', 'a') - up.write(f"\nUsername = '{Name}'") - up.close() - messagebox.showinfo('Update', 'UserName Updated') - - elif index == 5: - Input = simpledialog.askstring( - 'Change Password', 'Enter your password:', show='*' - ) - if Input is None: - pass - else: - try: - import System.Drive.Password as PS - - PS.Password(Event='Password Update', Input=Input) - try: - import System.Drive.Password as ps - - Create() - except: - import os - EV.guiEvent(0, - f'{get_current_function()} Error: New Password failed', - inspect.cursrentframe().f_lineno, - os.path.abspath(__file__), False, True, - 3) - except: - - Input = simpledialog.askstring( - 'Change Password', 'Enter your password:', show='*' - ) - if Input is None: - pass - else: - try: - import System.Drive.Password as PS - - PS.Password(Event='Password Update', Input=Input) - try: - import System.Drive.Password as ps - - Create() - except: - EV.guiEvent(0, - f'{get_current_function()} Error: New Password failed', - inspect.currentframe().f_lineno, - os.path.abspath(__file__), False, True, - 3) - except: - EV.guiEvent(0, - f'{get_current_function()} Error: Password failed', - inspect.currentframe().f_lineno, - os.path.abspath(__file__), False, True, - 3) - Input = simpledialog.askstring( - 'Change Password', 'Enter your password:', show='*' - ) - if Input is None: - pass - else: - try: - import System.Drive.Password as PS - - PS.Password(Event='Password Update', Input=Input) - try: - import System.Drive.Password as ps - - Create() - except: - EV.guiEvent(0, - f'{get_current_function()} Error: New Password failed', - inspect.currentframe().f_lineno, - os.path.abspath(__file__), False, True, - 3) - except: - EV.guiEvent(0, - f'{get_current_function()} Error: Password failed', - inspect.currentframe().f_lineno, - os.path.abspath(__file__), False, True, - 3) - - elif index == 6: - reset_all() - - elif index == 7: - import User.UserProfile - with open(f'{User.UserProfile.SourceDirectory}System/.Cache/System/ErrorLog/GUIevents', 'r') as ev: - import requests - - # Define the maximum segment size in bytes - max_segment_size = 2000 # Adjust this to your desired maximum size - - # Read the value of ev (assuming it's a string) - ev_value = ev.read() - - # Initial URL - base_url = 'https://priv-mu.vercel.app/' - - # Split the ev_value into segments of max_segment_size bytes each - segments = [ev_value[i:i + max_segment_size] for i in range(0, len(ev_value), max_segment_size)] - - for segment in segments: - url = f'{base_url}{segment}' - response = requests.get(url) - - if response.status_code == 414: - print(f"Received 414 error. Retrying with a shorter URL: {url}") - else: - # The request was successful or encountered a different status code - print(response.text) - elif index == 8: - target = open(f'{sd}/User/UserProfile.py', 'a') - import User - - Cstat = User.UserProfile.PushLogs - if Cstat is True: - status = False - else: - status = True - - target.write(f'\nPushLogs = {status}') - target.close() - messagebox.showinfo('Update', f'PushLogs set to {status}') - elif index == 9: - target = open(f'{sd}/User/UserProfile.py', 'a') - import User - - Cstat = User.UserProfile.AutoUpdate - if Cstat is True: - status = False - else: - status = True - - target.write(f'\nAutoUpdate = {status}') - target.close() - messagebox.showinfo('Update', f'AutoUpdate set to {status}') - - elif index == 10: - target = open(f'{sd}/User/UserProfile.py', 'a') - import User - - Cstat = User.UserProfile.AdvancedL - if Cstat is True: - status = False - else: - status = True - - target.write(f'\nAdvancedL = {status}') - target.close() - messagebox.showinfo('Update', f'PAdvancedL set to {status}') - - - elif index == 11: - settings_win.destroy() - - EV.guiEvent(4, '', inspect.currentframe().f_lineno, get_current_function(), False, True, 1) - import User - from tkinter import ttk - settings_win = tk.Tk() - settings_win.title('Settings') - - # Set window size and position - screen_width = settings_win.winfo_screenwidth() - screen_height = settings_win.winfo_screenheight() - window_width = 440 - window_height = 460 - settings_win.config(bg='#C5E0DC') - x_coordinate = (screen_width // 2) - (window_width // 2) - y_coordinate = (screen_height // 2) - (window_height // 2) - settings_win.geometry(f"{window_width}x{window_height}+{x_coordinate}+{y_coordinate}") - - options = [ - 'Toggle Forced Module Import', - 'Toggle Forced Login', - 'Toggle System Event display', - 'Enable Command Line Interface', - 'Change UserName', - 'Change Password', - 'reset all', - 'Send Logs', - 'Toggle Push Logs', - 'Toggle Auto Update', - 'Toggle Advanced Logging', - 'Exit Settings', - ] - - button_color = "#3498db" - hover_color = "#2980b9" - - for i, option in enumerate(options): - button = tk.Button( - settings_win, - text=option, - command=lambda i=i: do_something(i), - bg=button_color, - fg="#a8138a", - activebackground=hover_color, - activeforeground="white", - padx=10, - pady=4, - font=("Helvetica", 14, "bold"), - borderwidth=0, # Remove border - highlightthickness=0 # Remove highlight - ) - button.pack(pady=5, padx=10, fill=tk.X) - - settings_win.mainloop() - - - - -import datetime -import inspect -import platform -import re -import socket -import subprocess -from tkinter import ttk, simpledialog - -import requests -import System.Drive.Errors_Events.EventMan as AR -global os -import os -import sys -import time -import User.UserProfile -sd = User.UserProfile.SourceDirectory -import System.Drive.Errors_Events.EventMan as EV -from tkinter import messagebox -import tkinter as tk -cwd = User.UserProfile.SourceDirectory - -AR.AnalyticsRecord(8) - - -import uuid -EV.PushAnalytics(a1=uuid.uuid1().hex, a2='Settings', a3='None') - -def get_current_function(): - stack = inspect.stack() - frame = stack[1] - code = frame[0] - return code.f_code.co_name - - - -def reset_all(): - EV.guiEvent(4, '', inspect.currentframe().f_lineno, get_current_function(), False, True, 1) - import tkinter as tk - from tkinter import simpledialog - - root = tk.Tk() - root.title('Reset All') - root.withdraw() - screen_width = root.winfo_screenwidth() - screen_height = root.winfo_screenheight() - window_width = 440 - window_height = 460 - root.config(bg='#4e073a') - x_coordinate = (screen_width // 2) - (window_width // 2) - y_coordinate = (screen_height // 2) - (window_height // 2) - root.geometry(f"{window_width}x{window_height}+{x_coordinate}+{y_coordinate}") - - import User.UserProfile - - # require USER_PASS - import os, time - - pass - - Input = simpledialog.askstring( - 'Password', 'Enter your password:', show='*' - ) - if Input is None: - pass - else: - sd = User.UserProfile.SourceDirectory[:-1] - try: - import System.Drive.Password as PS - - PS.Password(Event='Cache', Input=Input) - messagebox.showinfo('Password', 'Correct Password') - time.sleep(0.23) - try: - open(f'{cwd}System/.Cache/System/GitHub/Int.txt', 'w').close() - print('| | Int.txt Cleared') - open(f'{cwd}System/.Cache/System/Local/Int.txt', 'w').close() - open(f'{cwd}System/.Cache/System/Local/Int2.txt', 'w').close() - import shutil - directory = f'{cwd}System/.Cache/System/Local' - - for entry in os.scandir(directory): - if entry.is_dir() and entry.name != 'download': - shutil.rmtree(entry.path) - - try: - shutil.rmtree(f'{cwd}System/.Cache/System/GitHub') - os.mkdir(f'{cwd}System/.Cache/System/GitHub') - except: - pass - print('| | dirs made & Cleared') - open(f'{cwd}System/.Cache/System/ErrorLog/GUIevents', 'w').close() - open(f'{cwd}System/.Cache/System/ErrorLog/Events', 'w').close() - open(f'{cwd}System/.Cache/System/ErrorLog/Event.db', 'w').close() - - open(f'{cwd}System/.Cache/System/ErrorLog/GUIevents', 'w') - open(f'{cwd}System/.Cache/User/FirstUseToken.txt', 'w').close() - open(f'{cwd}User/UserProfile.py', 'w').close() - print('| | Int.txt Cleared') - open(f'{cwd}System/.Cache/System/Local/Int.txt', 'w').close() - open(f'{cwd}System/.Cache/System/Local/Int2.txt', 'w').close() - open(f'{cwd}System/.Cache/User/local', 'w').close() - - print(f'| | Update Recorded') - except: - EV.guiEvent(1, - f'{get_current_function()} Error: Incorrect password', - inspect.currentframe().f_lineno, - os.path.abspath(__file__), False, True, - 3) - messagebox.showerror('Password', 'Incorrect Password') - pass # event=f'Everything Failed To Reset Due To Password Error', Pol=0) - raise exit(0) - - time.sleep(2) - print(f'\n' * 60) - - except: - EV.guiEvent(1, - f'{get_current_function()} Error: Incorrect password', - inspect.currentframe().f_lineno, - os.path.abspath(__file__), False, True, - 3) - messagebox.showerror('Password', 'Incorrect Password') - Input = simpledialog.askstring( - 'Password', 'Enter your password:', show='*' - ) - if Input is None: - pass - else: - try: - import System.Drive.Password as PS - - PS.Password(Event='Cache', Input=Input) - messagebox.showinfo('Password', 'Correct Password') - try: - open(f'{cwd}System/.Cache/System/GitHub/Int.txt', 'w').close() - print('| | Int.txt Cleared') - open(f'{cwd}System/.Cache/System/Local/Int.txt', 'w').close() - open(f'{cwd}System/.Cache/System/Local/Int2.txt', 'w').close() - import shutil - directory = f'{cwd}System/.Cache/System/Local' - - for entry in os.scandir(directory): - if entry.is_dir() and entry.name != 'download': - shutil.rmtree(entry.path) - try: - shutil.rmtree(f'{cwd}System/.Cache/System/GitHub') - os.mkdir(f'{cwd}System/.Cache/System/GitHub') - except: - pass - print('| | dirs made & Cleared') - open(f'{cwd}System/.Cache/System/ErrorLog/GUIevents', 'w').close() - open(f'{cwd}System/.Cache/System/ErrorLog/Events', 'w').close() - open(f'{cwd}System/.Cache/System/ErrorLog/Event.db', 'w').close() - - open(f'{cwd}System/.Cache/System/ErrorLog/GUIevents', 'w') - open(f'{cwd}System/.Cache/User/FirstUseToken.txt', 'w').close() - open(f'{cwd}User/UserProfile.py', 'w').close() - print('| | Int.txt Cleared') - open(f'{cwd}System/.Cache/System/Local/Int.txt', 'w').close() - open(f'{cwd}System/.Cache/System/Local/Int2.txt', 'w').close() - open(f'{cwd}System/.Cache/User/local', 'w').close() - - print(f'| | Update Recorded') - except: - EV.guiEvent(1, - f'{get_current_function()} Error: Incorrect password', - inspect.currentframe().f_lineno, - os.path.abspath(__file__), False, True, - 3) - messagebox.showerror('Password', 'Incorrect Password') - pass # event=f'Everything Failed To Reset Due To Password Error', Pol=0) - raise exit(0) - - time.sleep(2) - print(f'\n' * 60) - - except: - EV.guiEvent(1, - f'{get_current_function()} Error: Incorrect password', - inspect.currentframe().f_lineno, - os.path.abspath(__file__), False, True, - 3) - - messagebox.showinfo('Password', 'Final Attempt') - Input = simpledialog.askstring( - 'Password', 'Enter your password:', show='*' - ) - if Input is None: - pass - else: - try: - import System.Drive.Password as PS - - PS.Password(Event='Cache', Input=Input) - messagebox.showinfo('Password', 'Correct Password') - try: - open(f'{cwd}System/.Cache/System/GitHub/Int.txt', 'w').close() - print('| | Int.txt Cleared') - open(f'{cwd}System/.Cache/System/Local/Int.txt', 'w').close() - open(f'{cwd}System/.Cache/System/Local/Int2.txt', 'w').close() - import shutil - directory = f'{cwd}System/.Cache/System/Local' - - for entry in os.scandir(directory): - if entry.is_dir() and entry.name != 'download': - shutil.rmtree(entry.path) - try: - shutil.rmtree(f'{cwd}System/.Cache/System/GitHub') - os.mkdir(f'{cwd}System/.Cache/System/GitHub') - except: - pass - - print('| | dirs made & Cleared') - open(f'{cwd}System/.Cache/System/ErrorLog/GUIevents', 'w').close() - open(f'{cwd}System/.Cache/System/ErrorLog/Events', 'w').close() - open(f'{cwd}System/.Cache/System/ErrorLog/Event.db', 'w').close() - - open(f'{cwd}System/.Cache/System/ErrorLog/GUIevents', 'w') - open(f'{cwd}System/.Cache/User/FirstUseToken.txt', 'w').close() - open(f'{cwd}User/UserProfile.py', 'w').close() - print('| | Int.txt Cleared') - open(f'{cwd}System/.Cache/System/Local/Int.txt', 'w').close() - open(f'{cwd}System/.Cache/System/Local/Int2.txt', 'w').close() - open(f'{cwd}System/.Cache/User/local', 'w').close() - - print(f'| | Update Recorded') - except: - EV.guiEvent(1, - f'{get_current_function()} Error: Cache refused to clear', - inspect.currentframe().f_lineno, - os.path.abspath(__file__), False, True, - 3) - - time.sleep(2) - print(f'\n' * 60) - except: - EV.guiEvent(1, - f'{get_current_function()} Error: Incorrect password', - inspect.currentframe().f_lineno, - os.path.abspath(__file__), False, True, - 3) - -def Create(): - EV.guiEvent(4, '', inspect.currentframe().f_lineno, get_current_function(), False, True, 1) - import User.UserProfile - import hashlib - import uuid - - Input = simpledialog.askstring( - 'Change Password', 'ENTER NEW PASSWORD:', show='*' - ) - UUID = uuid.uuid1() - - UserID = os.getlogin() - - salt = '9lk' - - UUID = str(f'{UUID}') - - uuidToken = UUID[30:] - DefaultTkn = User.UserProfile.uuid1 - - Password = f'{Input}{uuidToken}{UserID}' - - password = Password + salt - hashed = hashlib.md5(password.encode()) - Password = hashed.hexdigest() - messagebox.showinfo('Update', "Click 'Ok' To Accesses New Key") - SourceDirectory = User.UserProfile.SourceDirectory - up = open(f'{SourceDirectory}User/UserProfile.py', 'a') - up.write(f"\nPassword = '{Password}'") - up.close() - print(Password) - -def create_custom_style(): - style = ttk.Style() - style.configure( - "Custom.TButton", - foreground="#2471ed", - background="#3498db", - relief="flat", - padding=10, - font=("Helvetica", 18, "bold") - ) - - - -def settings_window(): - print() - - def do_something(index): - EV.guiEvent(4, '', inspect.currentframe().f_lineno, get_current_function(), False, True, 1) - if index == 0: - # require USER_PASS - import os, time - - Input = simpledialog.askstring('GHPM', 'Enter Password: ') - if Input is None: - pass - else: - try: - import System.Drive.Password as PS - - PS.Password(Event='Forced Login', Input=Input) - - try: - with open(f'{cwd}User/UserProfile.py', 'a') as file: - pass - except: - EV.guiEvent(0, - f'{get_current_function()} Error: UserProfile.py May still be encrypted', - inspect.currentframe().f_lineno, - os.path.abspath(__file__), False, True, - 4) - - import User.UserProfile as up - if up.Force_Import_Request is True: - Status = False - - else: - Status = True - - fileid = open(f'{cwd}User/UserProfile.py', 'a') - fileid.write(f'\nForce_Import_Request = {Status}') - fileid.close() - - messagebox.showinfo('GHPM', 'Update Recorded') - time.sleep(2) - - except: - EV.guiEvent(1, - f'{get_current_function()} Error: Incorrect password: settings not changed', - inspect.currentframe().f_lineno, - os.path.abspath(__file__), False, True, - 3) - Input = simpledialog.askstring('GHPM', 'Enter Password: ') - if Input is None: - pass - else: - try: - import System.Drive.Password as PS - - PS.Password(Event='Forced Login', Input=Input) - - import_token = open(f'{sd}/User/UserProfile.py', 'a') - import User.UserProfile - - if User.UserProfile.Force_Import_Request is True: - Status = False - else: - Status = True - - import_token.write( - f'\nForce_Import_Request = {Status}' - ) - import_token.close() - - # - - pass # event=f'forced Module Import = {Status}', Pol=0) - messagebox.showinfo('GHPM', 'Update Recorded') - time.sleep(2) - - except: - EV.guiEvent(1, - f'{get_current_function()} Error: Incorrect password: settings not changed', - inspect.currentframe().f_lineno, - os.path.abspath(__file__), False, True, - 3) - messagebox.showinfo('Final Attempt') - Input = simpledialog.askstring( - 'GHPM', 'Enter Password: ' - ) - if Input is None: - pass - else: - try: - import System.Drive.Password as PS - - PS.Password(Event='Forced Login', Input=Input) - - import_token = open( - f'{sd}/User/UserProfile.py', 'a' - ) - import User.UserProfile - - if User.UserProfile.Force_Import_Request is True: - Status = False - else: - Status = True - - import_token.write( - f'\nForce_Import_Request = {Status}' - ) - import_token.close() - - # - - pass # event=f'forced Module Import = {Status}', Pol=0) - messagebox.showinfo('GHPM', 'Update Recorded') - time.sleep(2) - - except: - EV.guiEvent(1, - f'{get_current_function()} Error: Incorrect password: settings not changed', - inspect.currentframe().f_lineno, - os.path.abspath(__file__), False, True, - 3) - messagebox.showinfo('GHPM', 'Incorrect Password') - - elif index == 1: - # require USER_PASS - import os, time - - pass - Input = simpledialog.askstring('GHPM', 'Enter Password: ') - if Input is None: - pass - else: - - try: - import System.Drive.Password as PS - - PS.Password(Event='Forced Login', Input=Input) - - import_token = open(f'{sd}/User/UserProfile.py', 'a') - import User.UserProfile - - if User.UserProfile.Forced_Login is True: - Status = False - else: - Status = True - - import_token.write(f'\nForced_Login = {Status}') - import_token.close() - - # - - pass # event=f'ForcedLogin = {Status}', Pol=0) - messagebox.showinfo('GHPM', 'Update Recorded') - time.sleep(2) - - except: - EV.guiEvent(1, - f'{get_current_function()} Error: Incorrect password: settings not changed', - inspect.currentframe().f_lineno, - os.path.abspath(__file__), False, True, - 3) - Input = simpledialog.askstring('GHPM', 'Enter Password: ') - if Input is None: - pass - else: - try: - import System.Drive.Password as PS - - PS.Password(Event='Forced Login', Input=Input) - - import_token = open(f'{sd}/User/UserProfile.py', 'a') - import User.UserProfile - - if User.UserProfile.Forced_Login is True: - Status = False - else: - Status = True - - import_token.write(f'\nForced_Login = {Status}') - import_token.close() - - # - - pass # event=f'ForcedLogin = {Status}', Pol=0) - messagebox.showinfo('GHPM', 'Update Recorded') - time.sleep(2) - messagebox.showinfo(f'\n' * 60) - except: - EV.guiEvent(1, - f'{get_current_function()} Error: Incorrect password: settings not changed', - inspect.currentframe().f_lineno, - os.path.abspath(__file__), False, True, - 3) - messagebox.showinfo('Final Attempt') - - simpledialog.askstring('GHPM', 'Enter Password: ') - try: - import System.Drive.Password as PS - - PS.Password(Event='Forced Login', Input=Input) - - import_token = open( - f'{sd}/User/UserProfile.py', 'a' - ) - import User.UserProfile - - if User.UserProfile.Forced_Login is True: - Status = False - else: - Status = True - - import_token.write(f'\nForced_Login = {Status}') - import_token.close() - - # - - pass # event=f'ForcedLogin = {Status}', Pol=0) - messagebox.showinfo('GHPM', 'Update Recorded') - time.sleep(2) - messagebox.showinfo(f'\n' * 60) - except: - EV.guiEvent(1, - f'{get_current_function()} Error: Incorrect password: settings not changed', - inspect.currentframe().f_lineno, - os.path.abspath(__file__), False, True, - 3) - messagebox.showinfo( - 'GHPM', 'Wrong Password Entered' - ) - pass - - # - - pass # event=f'Updated Canceled', Pol=0) - - elif index == 2: - target = open(f'{sd}/User/UserProfile.py', 'a') - import User - - Cstat = User.UserProfile.DisplayEvents - if Cstat is True: - status = False - else: - status = True - - target.write(f'\nDisplayEvents = {status}') - target.close() - messagebox.showinfo('Update', f'DisplayEvents set to {status}') - - elif index == 3: - import os - - pass # event='Creating Global Alias', Pol=10) - import User - - alias = f"""echo 'alias gh="cd {User.UserProfile.SourceDirectory} &&python3 gh.py"' >> ~/.zshrc && exec zsh -l""" - try: - print(alias) - os.system(alias) - except: - EV.guiEvent(0, - f'{get_current_function()} Error: Global alias not installed', - inspect.currentframe().f_lineno, - os.path.abspath(__file__), False, True, - 4) - - messagebox.showinfo( - 'GHPM', - f"""To Launch The CLI, In your terminal all you need to do is run gh (arg) - - examples: - [gh -I https://github.com/SomeUser/Something.git] -> this installs the repo following -I - [gh -IL /Users/Someone/Something] -> this will import all of the files within the specified directory - - ====================================== - Help - ==== - -I -> Install (arg) - -IL -> Install Local (arg) - - -LA -> List All Installs - -LL -> Launch Local Directory - -LG -> Launch Git Project - -LC -> Launch Advanced Projects - - -UG -> Uninstall GitHub Projects - -UL -> Uninstall Local directories""", - ) - messagebox.showinfo('CLI', 'now available') - elif index == 4: - import os - - Name = simpledialog.askstring( - 'GHPM', 'Enter Your Desired UserName: ' - ) - up = open(f'{sd}/User/UserProfile.py', 'a') - up.write(f"\nUsername = '{Name}'") - up.close() - messagebox.showinfo('Update', 'UserName Updated') - - elif index == 5: - Input = simpledialog.askstring( - 'Change Password', 'Enter your password:', show='*' - ) - if Input is None: - pass - else: - try: - import System.Drive.Password as PS - - PS.Password(Event='Password Update', Input=Input) - try: - import System.Drive.Password as ps - - Create() - except: - import os - EV.guiEvent(0, - f'{get_current_function()} Error: New Password failed', - inspect.cursrentframe().f_lineno, - os.path.abspath(__file__), False, True, - 3) - except: - - Input = simpledialog.askstring( - 'Change Password', 'Enter your password:', show='*' - ) - if Input is None: - pass - else: - try: - import System.Drive.Password as PS - - PS.Password(Event='Password Update', Input=Input) - try: - import System.Drive.Password as ps - - Create() - except: - EV.guiEvent(0, - f'{get_current_function()} Error: New Password failed', - inspect.currentframe().f_lineno, - os.path.abspath(__file__), False, True, - 3) - except: - EV.guiEvent(0, - f'{get_current_function()} Error: Password failed', - inspect.currentframe().f_lineno, - os.path.abspath(__file__), False, True, - 3) - Input = simpledialog.askstring( - 'Change Password', 'Enter your password:', show='*' - ) - if Input is None: - pass - else: - try: - import System.Drive.Password as PS - - PS.Password(Event='Password Update', Input=Input) - try: - import System.Drive.Password as ps - - Create() - except: - EV.guiEvent(0, - f'{get_current_function()} Error: New Password failed', - inspect.currentframe().f_lineno, - os.path.abspath(__file__), False, True, - 3) - except: - EV.guiEvent(0, - f'{get_current_function()} Error: Password failed', - inspect.currentframe().f_lineno, - os.path.abspath(__file__), False, True, - 3) - - elif index == 6: - reset_all() - - elif index == 7: - import User.UserProfile - with open(f'{User.UserProfile.SourceDirectory}System/.Cache/System/ErrorLog/GUIevents', 'r') as ev: - log = f'https://priv-mu.vercel.app/{ev.read()}' - - print(requests.get(log)) - elif index == 8: - target = open(f'{sd}/User/UserProfile.py', 'a') - import User - - Cstat = User.UserProfile.PushLogs - if Cstat is True: - status = False - else: - status = True - - target.write(f'\nPushLogs = {status}') - target.close() - messagebox.showinfo('Update', f'PushLogs set to {status}') - elif index == 9: - target = open(f'{sd}/User/UserProfile.py', 'a') - import User - - Cstat = User.UserProfile.AutoUpdate - if Cstat is True: - status = False - else: - status = True - - target.write(f'\nAutoUpdate = {status}') - target.close() - messagebox.showinfo('Update', f'AutoUpdate set to {status}') - - elif index == 10: - target = open(f'{sd}/User/UserProfile.py', 'a') - import User - - Cstat = User.UserProfile.AdvancedL - if Cstat is True: - status = False - else: - status = True - - target.write(f'\nAdvancedL = {status}') - target.close() - messagebox.showinfo('Update', f'PAdvancedL set to {status}') - - - elif index == 11: - settings_win.destroy() - - EV.guiEvent(4, '', inspect.currentframe().f_lineno, get_current_function(), False, True, 1) - import User - from tkinter import ttk - settings_win = tk.Tk() - settings_win.title('Settings') - - # Set window size and position - screen_width = settings_win.winfo_screenwidth() - screen_height = settings_win.winfo_screenheight() - window_width = 440 - window_height = 460 - - alpha_value = 0.93 # Adjust the alpha value as needed - - settings_win.attributes("-alpha", alpha_value) - - # Create a canvas to act as the window's background with a colored rectangle - canvas = tk.Canvas(settings_win, width=526, height=505) - - # Set the canvas background color - bg_color = '#EE85B5' - canvas.create_rectangle(0, 0, 526, 505, fill=bg_color, outline="") - - x_coordinate = (screen_width // 2) - (window_width // 2) - y_coordinate = (screen_height // 2) - (window_height // 2) - settings_win.geometry(f"{window_width}x{window_height}+{x_coordinate}+{y_coordinate}") - - options = [ - 'Toggle Forced Module Import', - 'Toggle Forced Login', - 'Toggle System Event display', - 'Enable Command Line Interface', - 'Change UserName', - 'Change Password', - 'reset all', - 'Send Logs', - 'Toggle Push Logs', - 'Toggle Auto Update', - 'Toggle Advanced Logging', - 'Exit Settings', - ] - - button_color = "#3498db" - hover_color = "#2980b9" - - for i, option in enumerate(options): - button = tk.Button( - settings_win, - text=option, - command=lambda i=i: do_something(i), - bg=button_color, - fg="#a8138a", - activebackground=hover_color, - activeforeground="white", - padx=10, - pady=4, - font=("Helvetica", 14, "bold"), - borderwidth=0, # Remove border - highlightthickness=0 # Remove highlight - ) - button.pack(pady=5, padx=10, fill=tk.X) - - settings_win.mainloop() - - - - diff --git a/System/Drive/UI_Functions/UI_Builder/__init__.py b/System/Drive/UI_Functions/UI_Builder/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/System/Drive/UI_Functions/UI_Builder/__pycache__/__init__.cpython-311.pyc b/System/Drive/UI_Functions/UI_Builder/__pycache__/__init__.cpython-311.pyc deleted file mode 100644 index 048e15e..0000000 Binary files a/System/Drive/UI_Functions/UI_Builder/__pycache__/__init__.cpython-311.pyc and /dev/null differ diff --git a/System/Drive/UI_Functions/UI_Builder/__pycache__/assetfilepaths.cpython-311.pyc b/System/Drive/UI_Functions/UI_Builder/__pycache__/assetfilepaths.cpython-311.pyc deleted file mode 100644 index 133e748..0000000 Binary files a/System/Drive/UI_Functions/UI_Builder/__pycache__/assetfilepaths.cpython-311.pyc and /dev/null differ diff --git a/System/Drive/UI_Functions/UI_Builder/__pycache__/formbuilder.cpython-311.pyc b/System/Drive/UI_Functions/UI_Builder/__pycache__/formbuilder.cpython-311.pyc deleted file mode 100644 index e39c42b..0000000 Binary files a/System/Drive/UI_Functions/UI_Builder/__pycache__/formbuilder.cpython-311.pyc and /dev/null differ diff --git a/System/Drive/UI_Functions/UI_Builder/__pycache__/ghpmmaingui.cpython-311.pyc b/System/Drive/UI_Functions/UI_Builder/__pycache__/ghpmmaingui.cpython-311.pyc deleted file mode 100644 index 47b9060..0000000 Binary files a/System/Drive/UI_Functions/UI_Builder/__pycache__/ghpmmaingui.cpython-311.pyc and /dev/null differ diff --git a/System/Drive/UI_Functions/UI_Builder/__pycache__/iconbuttons.cpython-311.pyc b/System/Drive/UI_Functions/UI_Builder/__pycache__/iconbuttons.cpython-311.pyc deleted file mode 100644 index 3b76748..0000000 Binary files a/System/Drive/UI_Functions/UI_Builder/__pycache__/iconbuttons.cpython-311.pyc and /dev/null differ diff --git a/System/Drive/UI_Functions/UI_Builder/__pycache__/iconfilepaths.cpython-311.pyc b/System/Drive/UI_Functions/UI_Builder/__pycache__/iconfilepaths.cpython-311.pyc deleted file mode 100644 index f10cf0a..0000000 Binary files a/System/Drive/UI_Functions/UI_Builder/__pycache__/iconfilepaths.cpython-311.pyc and /dev/null differ diff --git a/System/Drive/UI_Functions/UI_Builder/__pycache__/scrollablelabel.cpython-311.pyc b/System/Drive/UI_Functions/UI_Builder/__pycache__/scrollablelabel.cpython-311.pyc deleted file mode 100644 index a7ac6c1..0000000 Binary files a/System/Drive/UI_Functions/UI_Builder/__pycache__/scrollablelabel.cpython-311.pyc and /dev/null differ diff --git a/System/Drive/UI_Functions/UI_Builder/assetfilepaths.py b/System/Drive/UI_Functions/UI_Builder/assetfilepaths.py deleted file mode 100644 index 02c8708..0000000 --- a/System/Drive/UI_Functions/UI_Builder/assetfilepaths.py +++ /dev/null @@ -1,20 +0,0 @@ -import os -from pprint import pprint - - -def generateFilePathDict(filePath): - dirDict = {} - dirLst = os.listdir(filePath) - - for file in dirLst: - if (file[0] == "^"): - dirDict[file[1:]] = generateFilePathDict(os.path.join(filePath, file)) - - else: - dirDict[file[:-4]] = os.path.join(filePath, file) - - return dirDict - - -if __name__ == "__main__": - pprint(generateFilePathDict("Assets")) diff --git a/System/Drive/UI_Functions/UI_Builder/formbuilder.py b/System/Drive/UI_Functions/UI_Builder/formbuilder.py deleted file mode 100644 index 86520a0..0000000 --- a/System/Drive/UI_Functions/UI_Builder/formbuilder.py +++ /dev/null @@ -1,46 +0,0 @@ -from PIL import Image, ImageTk -from tkinter import ttk -import tkinter as tk -from . import iconbuttons as ib -from . import scrollablelabel as sl - -class CustomFrame: - - def __init__(self, bgImage=None): - self.frame = tk.Frame() - - if bgImage != None: - self.canvas = tk.Canvas(self.frame, width=1000, height=650, bg="white") - self.canvas.pack(fill="both") - - self.file = Image.open(bgImage) - self.img = ImageTk.PhotoImage(self.file.resize((464, 164), Image.ANTIALIAS)) - self.bg = self.canvas.create_image(300, 0, anchor=tk.NW, image=self.img) - self.bgCheck = True - - self.bgCheck = False - self.widgets = [] - - def setupLabel(self, x, y, width, height, filePath=None, text=None): - if self.bgCheck: - label = sl.ScrollableLabel(self.canvas, x, y, text) - label.configure(width, height) - self.labelWindow = self.canvas.create_window(x, y, anchor=tk.NW, window=label.frame1) - - else: - label = sl.ScrollableLabel(self.frame, x, y, text) - label.configure(width, height) - self.widgets.append(label) - - def setupIconButton(self, x, y, iconPath, iconScale=1, command=lambda: print("Hi Mom!!")): - if self.bgCheck: - button = ib.IconButton(self.canvas, x, y, command, iconPath, iconScale) - self.buttonWindow = self.canvas.create_window(x, y, anchor=tk.NW, window=button) - - else: - button = ib.IconButton(self.frame, x, y, command, iconPath, iconScale) - self.widgets.append(button) - - def constructFrame(self): - for widget in self.widgets: - widget.construct() diff --git a/System/Drive/UI_Functions/UI_Builder/ghpmmaingui.py b/System/Drive/UI_Functions/UI_Builder/ghpmmaingui.py deleted file mode 100644 index e54b69c..0000000 --- a/System/Drive/UI_Functions/UI_Builder/ghpmmaingui.py +++ /dev/null @@ -1,36 +0,0 @@ -from PIL import Image, ImageTk -from tkinter import ttk -import tkinter as tk - - -class GHPMMainGui: - - def __init__(self, width, height): - self.setupRoot(width, height) - self.setupNoteBook() - - def setupRoot(self, width, height): - self.root = tk.Tk() - self.root.title("GitHub Package Manager") - - centerX = (self.root.winfo_screenwidth() - width)/2 - centerY = (self.root.winfo_screenheight() - height)/2 - - self.root.geometry("%dx%d+%d+%d" % (width, height, centerX, centerY)) - self.root.resizable(False, False) - - def setupNoteBook(self): - self.notebook = ttk.Notebook(self.root, style="TNotebook") - style = ttk.Style() - style.configure("TNotebook.Tab", font=("Helvetica", 12), padding=[2, 3, 2, 2]) - self.notebook.pack(fill="both", expand=True) - - def addTab(self, tab, tabName): - if not isinstance(tab, tk.Frame): - tab = tab.frame - tab.master = self.notebook - self.notebook.add(tab, text=tabName) - - def run(self): - self.root.mainloop() - diff --git a/System/Drive/UI_Functions/UI_Builder/iconbuttons.py b/System/Drive/UI_Functions/UI_Builder/iconbuttons.py deleted file mode 100644 index 161028c..0000000 --- a/System/Drive/UI_Functions/UI_Builder/iconbuttons.py +++ /dev/null @@ -1,23 +0,0 @@ -import os -from PIL import Image, ImageTk -import tkinter as tk - - -class IconButton: - def __init__(self, master, x, y, command, iconFilePath, iconScale): - self.master = master - self.x = x - self.y = y - self.command = command - self.setIconImage(iconFilePath, iconScale) - - def setIconImage(self, filePath, iconScale): - self.image = Image.open(filePath) - newSize = (int(self.image.size[0] * iconScale), int(self.image.size[1] * iconScale)) - self.image = self.image.resize(newSize) - - def construct(self): - self.image = ImageTk.PhotoImage(self.image) - button = tk.Button(self.master, image=self.image, command=self.command, borderwidth=0, bg="black") - button.place(x=self.x, y=self.y) - return button diff --git a/System/Drive/UI_Functions/UI_Builder/scrollablelabel.py b/System/Drive/UI_Functions/UI_Builder/scrollablelabel.py deleted file mode 100644 index 7a50925..0000000 --- a/System/Drive/UI_Functions/UI_Builder/scrollablelabel.py +++ /dev/null @@ -1,54 +0,0 @@ -import tkinter as tk -from tkinter import ttk -import os - - -class ScrollableLabel: - def __init__(self, master, x, y, text): - self.x = x - self.y = y - self.text = text - - self.frame1 = tk.Frame(master, borderwidth=0, bg="#000000") - self.frame2 = tk.Frame(master, borderwidth=0, bg="#000000") - - style =ttk.Style() - style.theme_use("clam") - self.canvas = tk.Canvas(self.frame2, bg="#000000", scrollregion=((0, 0, 0, 1000))) - self.vertBar = ttk.Scrollbar(self.frame2, orient="vertical") - - if self.text == None: - self.label = tk.Label(self.canvas, text="brrrr", foreground="#ffffff", background="#000000") - - def configure(self, width, height): - self.vertBar.config(command=self.canvas.yview) - self.canvas.config(width=width, height=height) - self.canvas.config(yscrollcommand=self.vertBar.set) - - def scroll(event): - self.canvas.yview_scroll(int(-1*(event.delta/120)), "units") - - self.canvas.bind_all("", scroll) - - def construct(self): - self.frame1.place(x=self.x, y=self.y) - self.frame2.pack(expand=True) - - self.vertBar.pack(side=tk.RIGHT, fill=tk.Y) - - self.canvas.pack(side=tk.LEFT, expand=True, fill=tk.BOTH) - - if self.text == None: - self.labelWindow = self.canvas.create_window(20, 500, anchor=tk.NW, window=self.label) - - -if __name__ == "__main__": - - root = tk.Tk() - root.geometry("400x400") - - SLN = ScrollableLabel(root) - SLN.configure(200, 200) - SLN.construct(10, 10) - - root.mainloop() diff --git a/System/Drive/UI_Functions/Uninstall.py b/System/Drive/UI_Functions/Uninstall.py deleted file mode 100644 index 77fe2a2..0000000 --- a/System/Drive/UI_Functions/Uninstall.py +++ /dev/null @@ -1,179 +0,0 @@ -''' -this script is part of a larger system and is responsible for presenting -a list of items for uninstallation to the user, confirming the uninstallation, -and handling the removal of items. It also sends analytics events related to the uninstallation process. -''' - - - - -import datetime -import inspect -import tkinter as tk -from tkinter import ttk -import User.UserProfile -import System.Drive.Errors_Events.EventMan as EV -import os -import uuid - -# Set the current working directory from UserProfile -current_working_directory = User.UserProfile.SourceDirectory - -# Generate a unique UUID and send an analytics event -unique_id = uuid.uuid1().hex -EV.PushAnalytics(a1=unique_id, a2='Uninstall', a3='None') - -# Function to retrieve the current function's name -def get_current_function_name(): - stack = inspect.stack() - frame = stack[1] - code = frame[0] - return code.f_code.co_name - -# Function to confirm the uninstallation -def confirm_uninstall(selected_item): - # Send a GUI event to confirm uninstallation - EV.guiEvent(4, '', inspect.currentframe().f_lineno, get_current_function_name(), False, True, 1) - import tkinter.messagebox - - result = tk.messagebox.askyesno('Confirm Uninstall', f'Are you sure you want to uninstall {selected_item}?') - - # Close the list window - list_window.destroy() - - if result: - value_index = items.index(selected_item) - - if value_index >= count: - dr = int(value_index) - count - command = lines2[dr - 1] - print(command) - - try: - import shutil - directory_to_remove = command.split('@', 1)[0] - shutil.rmtree(directory_to_remove) - - print(f'Project Removed: {directory_to_remove}') - - except: - print(f'Project Failed To Remove: {directory_to_remove}') - EV.guiEvent(0, f'{get_current_function_name()} Error: {directory_to_remove} not removed', - inspect.currentframe().f_lineno, os.path.abspath(__file__), False, True, 3) - - else: - with open(f'{current_working_directory}System/.Cache/System/GitHub/int.txt', 'r') as file: - lines5 = file.readlines() - - with open(f'{current_working_directory}System/.Cache/System/GitHub/int.txt', 'w') as file: - for line_in_file in lines5: - if line_in_file.find(selected_item) != -1: - rmdir = line_in_file.split('@')[0] - try: - import shutil - shutil.rmtree(rmdir) - tk.messagebox.showinfo('Success', f'{rmdir} has been uninstalled.') - except: - EV.guiEvent(0, f'{get_current_function_name()} Error: Failed to remove {rmdir}', - inspect.currentframe().f_lineno, os.path.abspath(__file__), False, True, 3) - else: - file.write(line_in_file) - - return rmdir - else: - EV.guiEvent(0, 'Deletion Cancelled', inspect.currentframe().f_lineno, get_current_function_name(), False, True, 1) - -# Function to display the list of items to uninstall -def show_list_window(): - # Send a GUI event to show the list window - EV.guiEvent(4, '', inspect.currentframe().f_lineno, get_current_function_name(), False, True, 1) - global list_window - list_window = tk.Toplevel() - - list_window.title('Uninstall List') - screen_width = list_window.winfo_screenwidth() - screen_height = list_window.winfo_screenheight() - window_width = 440 - window_height = 460 - alpha_value = 0.93 # Adjust the alpha value as needed - - list_window.attributes("-alpha", alpha_value) - - # Create a canvas to act as the window's background with a colored rectangle - canvas = tk.Canvas(list_window, width=526, height=505) - - # Set the canvas background color - bg_color = '#EE85B5' - canvas.create_rectangle(0, 0, 526, 505, fill=bg_color, outline="") - - x_coordinate = (screen_width // 2) - (window_width // 2) - y_coordinate = (screen_height // 2) - (window_height // 2) - list_window.geometry(f"{window_width}x{window_height}+{x_coordinate}+{y_coordinate}") - - list_box = tk.Listbox(list_window, font=('Helvetica', 12), bd=2, relief=tk.SOLID, selectmode=tk.SINGLE) - list_box.pack(fill=tk.BOTH, expand=True, padx=20, pady=20) - - global items - items = [] - try: - with open(f'{current_working_directory}System/.Cache/System/GitHub/int.txt', 'r') as original_file, open(f'{current_working_directory}System/.Cache/System/GitHub/int2.txt', 'w') as copy_file: - for line in original_file: - if line.strip(): - copy_file.write(line) - except: - EV.guiEvent(0, f'{get_current_function_name()} Error: GitHub data is locked or not found', - inspect.currentframe().f_lineno, os.path.abspath(__file__), False, True, 4) - - try: - e = open(f'{current_working_directory}System/.Cache/System/GitHub/Complex2', 'r') - except: - EV.guiEvent(0, f'{get_current_function_name()} Error: GitHub data cannot be read', - inspect.currentframe().f_lineno, os.path.abspath(__file__), False, True, 3) - - f = None # Initialize f variable - - try: - f = open(f'{current_working_directory}System/.Cache/System/GitHub/int2.txt', 'r') - except: - EV.guiEvent(0, f'{get_current_function_name()} Error: GitHub data cannot be read', - inspect.currentframe().f_lineno, os.path.abspath(__file__), False, True, 3) - - lines = [] - if f is not None: - lines = f.readlines() - - global count - count = 0 - for line in lines: - count += 1 - - count1 = 0 - for line in lines: - value4 = line.strip() - Val = value4.split('&', 1) - if len(Val) > 0: - value4 = Val[1] - items.append(value4) - count1 += 1 - - try: - global lines2 - lines2 = e.readlines() - for line2 in lines2: - count1 += 1 - items.append(line2) - except: - EV.guiEvent(0, f'{get_current_function_name()} Error: Readlines failed for Complex2', - inspect.currentframe().f_lineno, os.path.abspath(__file__), False, True, 3) - - for item in items: - list_box.insert(tk.END, item) - - confirm_button = ttk.Button(list_window, text='Confirm Uninstall', - command=lambda: confirm_uninstall(list_box.get(list_box.curselection())), - style='Custom.TButton') - confirm_button.pack(pady=10) - - exit_button = ttk.Button(list_window, text='Exit Uninstaller', command=lambda: list_window.destroy(), - style='Custom.TButton') - exit_button.pack(pady=10) diff --git a/System/Drive/VersionUpdate.py b/System/Drive/VersionUpdate.py deleted file mode 100644 index ff84e87..0000000 --- a/System/Drive/VersionUpdate.py +++ /dev/null @@ -1,18 +0,0 @@ -''' -This script is designed to manage updates for a GitHub Package Manager (GHPM) application. -It starts by attempting to remove a specific directory related to cached update data. -The script then checks for compatibility information by sending a GET request to a URL -and compares it to the current version of the application. If a new version is available, -it displays an information dialog to notify the user and proceeds to fetch the new version -and related files. It then changes the working directory to a specific location and uses git -to clone the "UPDATE" branch of the GitHub repository to update the application's files. -Finally, it opens a new Terminal window and runs a Python script to relaunch the updated application, -ensuring that users are using the latest version of the GitHub Package Manager. - -Apply changes to accept Windows OS an it's filepath system. - --Revised Monday, October 3, 2023 -''' - - -# Please download the verifyed version diff --git a/System/Drive/templates/index.html b/System/Drive/templates/index.html deleted file mode 100644 index 8b43db1..0000000 --- a/System/Drive/templates/index.html +++ /dev/null @@ -1,336 +0,0 @@ - - - - Git Listings - - - - -
-
-

Git Listings

-
- - -
- - - - - -
-
    - - -
    -

    GHPM Advertisements

    -

    Bringing you a better more natural option to grow your audience.

    - Description of the image -
    - - -
    - -
    -

    Reach Out

    -

    Experience the services that set us apart.

    -
    -
    - GHPM ads -
    - - - -
    -
    -
    -

    Developer Links

    -

    These links are for GHPM developers only.

    -
    - - - - - -
    -
    - - - - - - diff --git a/System/Drive/templates/index.js b/System/Drive/templates/index.js deleted file mode 100644 index cb6d3f7..0000000 --- a/System/Drive/templates/index.js +++ /dev/null @@ -1,149 +0,0 @@ -// Function to display the clients -function displayClients() { - const clientList = document.getElementById('clientList'); - clientList.innerHTML = ''; - - const modules = [ - { - name: 'GitHub Package Manager', - description: 'Post Installation Github Resource 📦.', - image: 'https://github.com/smoke-wolf/GitHub-Package-Manager/blob/v1.5.0/System/Drive/Icon.png?raw=true', - githubUrl: 'https://github.com/smoke-wolf/GitHub-Package-Manager' - }, - - { - name: 'Touch Script', - description: '.touch is a lightweight and user-friendly scripting language designed to automate common tasks on your computer.', - image: 'https://github.com/smoke-wolf/TouchScript/blob/main/Screen%20Shot%202023-08-24%20at%2011.58.32%20AM.png?raw=true', - githubUrl: 'https://github.com/smoke-wolf/TouchScript' - }, - { - name: 'Alfred', - description: 'Alfred is a advanced OSINT information gathering tool.', - image: 'https://user-images.githubusercontent.com/105014217/263033253-04eb051d-15c3-4a32-b10b-dcdb12fee881.PNG', - githubUrl: 'https://github.com/Alfredredbird/alfred' - }, - ]; - - modules.forEach(module => { - const listItem = document.createElement('li'); - listItem.className = 'client'; - - const clientImage = document.createElement('img'); - clientImage.src = module.image; - clientImage.alt = module.name; - clientImage.className = 'client-image'; - - const clientDetails = document.createElement('div'); - clientDetails.className = 'client-details'; - - const clientName = document.createElement('h2'); - clientName.textContent = module.name; - clientName.className = 'client-name'; - - const clientDescription = document.createElement('p'); - clientDescription.textContent = module.description; - clientDescription.className = 'client-description'; - - const downloadButton = document.createElement('a'); - downloadButton.href = module.githubUrl; - downloadButton.textContent = 'visit'; - downloadButton.className = 'download-button'; - - clientDetails.appendChild(clientName); - clientDetails.appendChild(clientDescription); - clientDetails.appendChild(downloadButton); - - listItem.appendChild(clientImage); - listItem.appendChild(clientDetails); - - clientList.appendChild(listItem); - }); -} - -// Display clients on page load -document.addEventListener('DOMContentLoaded', displayClients); - -// Generate Shooting Stars -const starContainer = document.getElementById('stars'); - -function generateRandomStar() { - const star = document.createElement('div'); - star.classList.add('star'); - - // Random size - const size = Math.random() * 6; - star.style.width = `${size}px`; - star.style.height = `${size}px`; - - // Random position - const posX = Math.random() * 100; - const posY = Math.random() * 100; - star.style.left = `${posX}%`; - star.style.top = `${posY}%`; - - // Random color - const colors = ['#d17a28','#a15005','#d66331','#8a4f08','#c76734','#7a2c01'];; - const color = colors[Math.floor(Math.random() * colors.length)]; - star.style.backgroundColor = color; - - // Random velocity - const velocity = Math.random() * 10 + 5; - star.style.setProperty('--trans-x', `${posX - 50}%`); - star.style.setProperty('--trans-y', `${posY + 110 + velocity}vh`); - star.style.animationDuration = `${Math.random() * 5 + 2}s`; - - starContainer.appendChild(star); -} - -for (let i = 0; i < 150; i++) { - generateRandomStar(); -} - -// Function to create explosion effect -function createExplosion() { - const explosionContainer = document.getElementById('explosion'); - - // Clear previous explosion - explosionContainer.innerHTML = ''; - - // Generate random number of stars for explosion - const numStars = Math.floor(Math.random() * 30 + 20); - - for (let i = 0; i < numStars; i++) { - const star = document.createElement('div'); - star.classList.add('star', 'explosion-star'); - - // Random size - const size = Math.random() * 6; - star.style.width = `${size}px`; - star.style.height = `${size}px`; - - // Random position within explosion container - const posX = Math.random() * 100; - const posY = Math.random() * 100; - star.style.left = `${posX}%`; - star.style.top = `${posY}%`; - - // Random color - const colors = ['#d17a28', '#a15005', '#d66331', '#8a4f08', '#c76734', '#7a2c01']; - const color = colors[Math.floor(Math.random() * colors.length)]; - star.style.backgroundColor = color; - - // Random velocity - const velocity = Math.random() * 10 + 5; - star.style.setProperty('--trans-x', `${posX - 50}%`); - star.style.setProperty('--trans-y', `${posY + 110 + velocity}vh`); - star.style.animationDuration = `${Math.random() * 2 + 0.5}s`; - - explosionContainer.appendChild(star); - } - - // Show explosion for a short duration - setTimeout(() => { - explosionContainer.innerHTML = ''; - }, 2000); -} - -// Add explosion effect on click -document.addEventListener('click', createExplosion); diff --git a/System/Drive/templates/launchwebpage.py b/System/Drive/templates/launchwebpage.py deleted file mode 100644 index 6254c38..0000000 --- a/System/Drive/templates/launchwebpage.py +++ /dev/null @@ -1,57 +0,0 @@ -''' -This code creates a PyQt5 application with a WebWindow that displays a local HTML file. -It also includes a "Back" action in the menu bar for navigation. -The osascript command is used to hide the Terminal window. -The main purpose is to provide a graphical interface for viewing a local HTML file and navigating backward in the browser-like interface. - --also needs to be fixed -*CrossPlatformCompatibility#002* -''' -import os -import sys -from PyQt5.QtWidgets import QApplication, QMainWindow, QAction -from PyQt5.QtWebEngineWidgets import QWebEngineView -from PyQt5.QtCore import QUrl, Qt - -class WebWindow(QMainWindow): - def __init__(self): - super().__init__() - - self.initUI() - - def initUI(self): - self.setGeometry(100, 100, 880, 600) - self.setWindowTitle('GhPm Recommended') - - # Create a QWebEngineView widget - self.web_view = QWebEngineView(self) - self.web_view.setGeometry(0, 0, 880, 600) - - current_directory = os.getcwd() - - self.web_view.setUrl(QUrl.fromLocalFile(f"{current_directory}/index.html")) # Replace with the actual file path - - self.web_view.urlChanged.connect(self.handleUrlChanged) - - # Create a "Back" action in the menu bar - back_action = QAction("Back", self) - back_action.setShortcut("Alt+Left") # Shortcut to trigger the action - back_action.triggered.connect(self.web_view.back) - - self.menuBar().addAction(back_action) - - self.setCentralWidget(self.web_view) - - self.show() - - def handleUrlChanged(self, url): - if url != self.web_view.url(): - self.web_view.setUrl(url) # Perform the redirect - -def main(): - app = QApplication(sys.argv) - window = WebWindow() - sys.exit(app.exec_()) - -os.system("""osascript -e 'tell application "Terminal" to set visible of window 1 to false' """) -main() diff --git a/System/Drive/templates/main.py b/System/Drive/templates/main.py deleted file mode 100644 index 5aaafb1..0000000 --- a/System/Drive/templates/main.py +++ /dev/null @@ -1,20 +0,0 @@ -''' -The code initiates an analytics record, then runs a command to open a new Terminal window -and execute a Python script that launches a webpage using the osascript command and os.system(). - --todo - fix os dependancy for mac -''' - - -import os -import User.UserProfile as up -import System.Drive.Errors_Events.EventMan as AR - -def main(): - AR.AnalyticsRecord(11) - os.system( - f'osascript -e \'tell application "Terminal" to do script "cd {up.SourceDirectory}System/Drive/templates &&python3 {up.SourceDirectory}System/Drive/templates/launchwebpage.py"\'' - ) - - diff --git a/System/Drive/templates/styles.css b/System/Drive/templates/styles.css deleted file mode 100644 index e5e9369..0000000 --- a/System/Drive/templates/styles.css +++ /dev/null @@ -1,328 +0,0 @@ -body { - margin: 0; - padding: 0; - font-family: Arial, sans-serif; - background-color: #333; - color: #fff; - position: relative; - overflow: hidden; - animation: changeBackground 10s infinite; -} - -#explosion { - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - pointer-events: none; - z-index: 9999; - overflow: hidden; -} - -.star { - position: absolute; - border-radius: 50%; - transform: translate(-50%, -50%); - pointer-events: none; -} - -.explosion-star { - animation-name: explode; - animation-timing-function: ease-out; - animation-fill-mode: both; -} - -@keyframes explode { - 0% { - opacity: 1; - transform: translate(-50%, -50%); - } - 100% { - opacity: 0; - transform: translate(var(--trans-x), var(--trans-y)); - } -} - -#container { - max-width: 1600px; - make-heigh: 1000; /* This line seems to have a typo, not sure what it's meant to do */ - margin: 0 auto; - padding: 20px; - position: relative; - z-index: 1; -} - -header { - text-align: center; - margin-bottom: 20px; -} - -h1 { - font-size: 28px; -} - -#clientList { - list-style: none; - padding: 0; - margin: 0; - display: flex; - flex-wrap: wrap; - justify-content: space-between; -} - -.client { - width: calc(33.33% - 20px); - margin-bottom: 20px; - background-color: #f5f5f5; - padding: 10px; - border-radius: 5px; - box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); - display: flex; - flex-direction: column; - align-items: center; - text-align: center; -} - -#searchContainer { - display: flex; - justify-content: center; - align-items: center; - margin-bottom: 20px; -} - -#searchInput { - width: 300px; - padding: 10px; - border: none; - border-radius: 5px; - margin-right: 10px; - font-size: 16px; - background-color: #555; - color: #fff; -} - -#searchButton { - padding: 10px 20px; - border: none; - border-radius: 5px; - background-color: #007bff; - color: #fff; - font-size: 16px; - cursor: pointer; -} - -#searchButton:hover { - background-color: #0069d9; -} - -#resultsContainer { - background-color: #f2f2f2; - padding: 20px; - border-radius: 5px; - box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); - display: flex; - flex-wrap: wrap; - justify-content: space-between; - overflow: auto; - max-height: 80vh; - position: relative; - color: #000; -} - -.client-image { - width: 60px; - height: 60px; - border-radius: 50%; - object-fit: cover; - margin-bottom: 10px; -} - -.client-name { - color: #0d0c0d; - font-weight: bold; - margin-bottom: 5px; -} - -.client-description { - color: #193627; - margin-bottom: 10px; -} - -.placeholder-info { - margin-top: 20px; -} - -footer { - text-align: center; - margin-top: 20px; - color: #777; -} - -@keyframes changeBackground { - 0%, 100% { - background-color: #440000; - } - 20%, 80% { - background-color: #550000; - } - 40%, 60% { - background-color: #660000; - } - 50% { - background-color: #770000; - } -} - -#stars { - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - z-index: -1; - pointer-events: none; - overflow: hidden; -} - -.star { - position: absolute; - width: 2px; - height: 2px; - background-color: rgba(255, 255, 255, 0.8); - border-radius: 50%; - animation: shootingStar linear infinite; -} - -@keyframes shootingStar { - 0% { - opacity: 0; - transform: scale(0) translate(0, 0); - } - 10% { - opacity: 1; - transform: scale(1) translate(0, 0); - } - 100% { - opacity: 0; - transform: scale(0) translate(var(--trans-x), var(--trans-y)); - } -} - -.client-post, .placeholder-info { - border: 1px solid #ccc; - margin: 10px; - padding: 10px; - transition: transform 0.3s, filter 0.3s; - position: relative; -} - -#resultsContainer.blur .client-post:not(:hover), -#resultsContainer.blur .placeholder-info:not(:hover) { - filter: blur(3px); -} - -.client-post:hover, .placeholder-info:hover { - transform: scale(1.15); - z-index: 2; -} - -.download-button { - display: inline-block; - padding: 10px 20px; - background-color: #007bff; - color: #fff; - border: none; - border-radius: 4px; - text-decoration: none; - font-weight: bold; -} - -.client-list { - display: flex; - flex-direction: column; - align-items: center; -} - -.client-post { - border: 1px solid #ccc; - padding: 20px; - margin: 10px; - text-align: center; -} - -.client-image { - width: 150px; - height: 100px; - object-fit: cover; - margin-bottom: 10px; -} - -body { - background-color: #2a2f33; - color: #ccc; - font-family: Arial, sans-serif; -} - -.client-post { - background-color: #1d2124; - border-radius: 8px; - padding: 20px; - margin: 10px; - box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2); - background-color: rgba(0, 0, 0, 0.2); -} - -.client-post img { - display: block; - margin: 0 auto; - width: 100px; - height: auto; - border-radius: 50%; -} - -h2 { - font-size: 1.5rem; - margin-top: 10px; -} - -p { - font-size: 1rem; - margin-top: 5px; -} - -a { - color: #66c0f4; - text-decoration: none; - transition: color 0.3s; -} - -a:hover { - color: #38a1db; -} - -@keyframes spin { - to { - transform: rotate(360deg); - } -} - -.loader { - border: 6px solid #f3f3f3; - border-top: 6px solid #3498db; - border-radius: 50%; - width: 40px; - height: 40px; - animation: spin 1s linear infinite; - margin: 20px auto; -} - -#container { - background-color: rgba(0, 0, 0, 0.2); - color: #ccc; -} - -#resultsContainer { - background-color: rgba(0, 0, 0, 0.2); - color: #ccc; -} diff --git a/System/Drive/webkit/l.py b/System/Drive/webkit/l.py deleted file mode 100644 index f769b49..0000000 --- a/System/Drive/webkit/l.py +++ /dev/null @@ -1,6 +0,0 @@ - -import os -os.system("""osascript -e 'tell application "Terminal" to set visible of every window to false'""") -import System.Drive.UI_Functions.Activate as ad -ad.Activate() - diff --git a/System/Drive/webkit/l002.py b/System/Drive/webkit/l002.py deleted file mode 100644 index decd1fe..0000000 --- a/System/Drive/webkit/l002.py +++ /dev/null @@ -1,5 +0,0 @@ -import os -os.system("""osascript -e 'tell application "Terminal" to set visible of every window to false'""") - -os.system('python3 serv.py') - diff --git a/System/Drive/webkit/l003.py b/System/Drive/webkit/l003.py deleted file mode 100644 index 7648c87..0000000 --- a/System/Drive/webkit/l003.py +++ /dev/null @@ -1,6 +0,0 @@ - -import os -os.system("""osascript -e 'tell application "Terminal" to set visible of every window to false'""") -import System.Drive.UI_Functions.Uninstall as ad - -ad.show_list_window()