import os import sys import time import tkinter as tk from tkinter import * from tkinter import messagebox, ttk from tkinter.messagebox import showinfo import subprocess import webbrowser def resource_path(relative_path): try: base_path = sys._MEIPASS except Exception: base_path = os.path.abspath(".") return os.path.join(base_path, relative_path) root = tk.Tk() frame = tk.Frame(root, width=500, height=250) frame.pack(fill=BOTH, expand=True) try: root.iconphoto(False, tk.PhotoImage(file=resource_path('apple.gif'))) except: print("Icon not found") LAST_CONNECTED_UDID = "" LAST_CONNECTED_IOS_VER = "" def run_cmd(cmd): try: result = subprocess.run(cmd, shell=True, capture_output=True, text=True) return result.stdout + result.stderr except Exception as e: return str(e) def clear(): base = resource_path('palera1n') folders_to_delete = [ os.path.join(base, 'blobs'), os.path.join(base, 'work') ] if os.path.exists(base): for folder in os.listdir(base): if folder.startswith('boot'): folders_to_delete.append(os.path.join(base, folder)) for folder in folders_to_delete: if os.path.exists(folder): subprocess.run(f'rm -rf "{folder}"', shell=True) messagebox.showinfo("Done", "palera1n files cleared") def opentwitter(): webbrowser.open('https://bookra1n.com', new=2) def startbypass(): global LAST_CONNECTED_UDID, LAST_CONNECTED_IOS_VER device_dir = resource_path('device') palera1n_dir = resource_path('palera1n') print("Searching for device...") run_cmd("idevicepair unpair") run_cmd("idevicepair pair") ideviceinfo_path = os.path.join(device_dir, "ideviceinfo") output_file = os.path.join(device_dir, "lastdevice.txt") run_cmd(f'"{ideviceinfo_path}" > "{output_file}"') time.sleep(2) if not os.path.exists(output_file): messagebox.showerror("Error", "Device info not found.") return with open(output_file, "r") as f: fileData = f.read() if "ERROR:" in fileData: messagebox.showinfo("No device", "Reconnect your device.") return try: udid = fileData.split("UniqueDeviceID: ")[1].split("\n")[0] ios = fileData.split("ProductVersion: ")[1].split("\n")[0] LAST_CONNECTED_UDID = udid.strip() LAST_CONNECTED_IOS_VER = ios.strip() messagebox.showinfo("Device Found", f"iOS {LAST_CONNECTED_IOS_VER}") except: messagebox.showerror("Parse Error", "Could not read device info.") return if len(LAST_CONNECTED_IOS_VER) < 2: showinfo('Failed', 'Invalid iOS version.') return showinfo('Starting...', f'iOS {LAST_CONNECTED_IOS_VER} detected.') run_cmd("idevicepair unpair") run_cmd("idevicepair pair") palera_script = os.path.join(palera1n_dir, "palera1n.sh") subprocess.run(f'chmod +x "{palera_script}"', shell=True) run_cmd(f'cd "{palera1n_dir}" && ./palera1n.sh --tweaks --semi-tethered {LAST_CONNECTED_IOS_VER}') showinfo('Success', 'Device bypassed!') def enterRecMode(): script = os.path.join(resource_path('device'), "enterrecovery.sh") subprocess.run(f'chmod +x "{script}"', shell=True) run_cmd(script) def exitRecMode(): script = os.path.join(resource_path('device'), "exitrecovery.sh") subprocess.run(f'chmod +x "{script}"', shell=True) run_cmd(script) # ------------------------- # TTK styles — only way to force colors on macOS # ------------------------- style = ttk.Style() style.theme_use('default') style.configure('Green.TButton', background='#16a34a', foreground='white', font=('Helvetica', 10), relief='flat', borderwidth=0, ) style.map('Green.TButton', background=[('active', '#15803d'), ('pressed', '#166534')], foreground=[('active', 'white'), ('pressed', 'white')], ) style.configure('Cyan.TButton', background='#06b6d4', foreground='#083344', font=('Helvetica', 10), relief='flat', borderwidth=0, ) style.map('Cyan.TButton', background=[('active', '#0891b2'), ('pressed', '#0e7490')], foreground=[('active', '#083344'), ('pressed', '#083344')], ) style.configure('Black.TButton', background='black', foreground='white', font=('Helvetica', 10, 'bold'), relief='flat', borderwidth=0, ) style.map('Black.TButton', background=[('active', '#222222'), ('pressed', '#333333')], foreground=[('active', 'white'), ('pressed', 'white')], ) style.configure('Neutral.TButton', font=('Helvetica', 10), relief='flat', borderwidth=0, ) # ------------------------- # UI # ------------------------- root.title('hhheeeeeeellllllloooooooooooo') Label(root, text="Blue Testing", font=('Helvetica', 20)).place(x=120, y=60) Label(frame, text=" o()xxxx[{::::::::::::::::::::::::::::::::::>").place(x=130, y=120) Label(frame, text="📱 15-16.3").place(x=10, y=220) ttk.Button(frame, text="Enter Recovery", command=enterRecMode, style='Cyan.TButton').place(x=10, y=10) ttk.Button(frame, text="Exit Recovery", command=exitRecMode, style='Cyan.TButton').place(x=380, y=10) ttk.Button(frame, text="unlock", command=startbypass, style='Green.TButton').place(x=180, y=150) ttk.Button(frame, text="clear", command=clear, style='Neutral.TButton').place(x=300, y=150) ttk.Button(frame, text="Web", command=opentwitter, style='Neutral.TButton').place(x=340, y=213) ttk.Button(frame, text="✕", command=root.destroy, style='Black.TButton', width=2).place(x=468, y=213) root.geometry("500x250") root.resizable(False, False) root.eval('tk::PlaceWindow . center') root.mainloop()