Skip to content

Commit

Permalink
Update SamsungFlashGUI.py
Browse files Browse the repository at this point in the history
  • Loading branch information
justaCasualCoder committed Feb 21, 2023
1 parent c49ee5e commit dc83dcc
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions SamsungFlashGUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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)
print("Flashing completed.")

0 comments on commit dc83dcc

Please sign in to comment.