diff --git a/build.sh b/build.sh index 98e000a..4ca1346 100644 --- a/build.sh +++ b/build.sh @@ -13,7 +13,7 @@ function build_droid() { elif [[ "$OSTYPE" == "darwin"* ]] then # macOS - pyinstaller --noconfirm --onefile --add-data "/usr/local/lib/python3.10/site-packages/customtkinter:customtkinter/" "main.py" --name droid-$(uname) + pyinstaller --noconfirm --onefile --add-data "/usr/local/lib/python3.10/site-packages/customtkinter:customtkinter/" "droid-$(uname).spec" --name droid-$(uname) else pyinstaller --noconfirm --onefile --add-data "/usr/local/lib/python3.10/site-packages/customtkinter;customtkinter/" "main.py" --name droid-$(echo $current_os) fi diff --git a/main.py b/main.py index d50cbd5..10b3204 100644 --- a/main.py +++ b/main.py @@ -36,7 +36,7 @@ args = parser.parse_args() author = "Hifumi1337" -version = "1.4.19" +version = "1.4.20" # Default Android Debug Bridge (adb) location on specific platforms if platform.system() == 'Darwin': diff --git a/utils/view.py b/utils/view.py index 19944ea..a24a8f3 100644 --- a/utils/view.py +++ b/utils/view.py @@ -19,6 +19,17 @@ whoami = getoutput("whoami") adb = f"/home/{whoami}/Android/Sdk/platform-tools/adb" +if platform.system() == 'Darwin': + import sys, os + + def import_resources(relative_path): + try: + base_path = sys._MEIPASS + except Exception: + base_path = os.path.abspath(".") + + return os.path.join(base_path, relative_path) + INFO_CODE = "[INFO]" class View(customtkinter.CTk): @@ -33,8 +44,9 @@ def __init__(self, version): self.grid_columnconfigure(1, weight=1) self.grid_rowconfigure(0, weight=1) - img = PhotoImage(file='assets/droid.png') - self.iconphoto(True, img) + if platform.system() == 'Darwin': + img = PhotoImage(file=f"{import_resources('assets/droid.png')}") + self.iconphoto(True, img) # Sidebar self.frame_left = customtkinter.CTkFrame(master=self, width=200, corner_radius=0)