From dc83dcc054ddd82b0b159e2d64fff0527ff44f59 Mon Sep 17 00:00:00 2001 From: justaCasualCoder <120528794+justaCasualCoder@users.noreply.github.com> Date: Mon, 20 Feb 2023 20:54:10 -0500 Subject: [PATCH] Update SamsungFlashGUI.py --- SamsungFlashGUI.py | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/SamsungFlashGUI.py b/SamsungFlashGUI.py index 49e5fe5..0255bc6 100644 --- a/SamsungFlashGUI.py +++ b/SamsungFlashGUI.py @@ -13,7 +13,6 @@ if operating_system == 'Linux': print("You are running Linux!") - heimdall = operating_system elif operating_system == 'Windows': print("You are running Windows") else: @@ -109,23 +108,16 @@ def select_img_file(): file_filter = "IMG Files (*.img)" file_path, _ = QFileDialog.getOpenFileName(None, "Please select the *.IMG file to be flashed", os.path.expanduser("~"), file_filter, "", options=options) return file_path - # Example usage: img_file = select_img_file() -print(f"{img_file} Selected") if img_file == "": - print("Quiting....") + print("Quitting...") sys.exit(0) else: - heimdallcmd = f"sudo heimdall flash --{partition} {img_file}" + if operating_system == 'Windows': + heimdallcmd = f"heimdall/heimdall.exe flash --{partition} {img_file}" + else: + heimdallcmd = f"sudo heimdall flash --{partition} {img_file}" os.system(heimdallcmd) -# Example usage: -img_file = select_img_file() -print(f"{img_file} Selected") -if img_file == "": - print("Quiting....") - sys.exit(0) -else: - heimdallcmd = f"sudo heimdall flash --{partition} {img_file}" - os.system(heimdallcmd) \ No newline at end of file +print("Flashing completed.") \ No newline at end of file