Skip to content

Commit

Permalink
[Update] Fix ROM Unpack
Browse files Browse the repository at this point in the history
  • Loading branch information
ColdWindScholar committed Feb 6, 2024
1 parent 7cd3748 commit 8ab7042
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,18 +124,21 @@ def sha1(file_path):

if not os.path.exists(ebinner):
error(1, "Binary not found\nMay Not Support Your Device?")
if os.path.basename(sys.argv[0]) == f'run_new{str() if os.name == "posix" else ".exe"}':
os.remove(os.path.join(LOCALDIR, f'run{str() if os.name == "posix" else ".exe"}'))
shutil.copyfile(os.path.join(LOCALDIR, f'run_new{str() if os.name == "posix" else ".exe"}'),
os.path.join(LOCALDIR, f'run{str() if os.name == "posix" else ".exe"}'))
elif os.path.basename(sys.argv[0]) == f'run{str() if os.name == "posix" else ".exe"}':
new = os.path.join(LOCALDIR, f'run_new{str() if os.name == "posix" else ".exe"}')
if os.path.exists(new):
if sha1(os.path.join(LOCALDIR, f'run{str() if os.name == "posix" else ".exe"}')) == sha1(new):
os.remove(new)
else:
subprocess.Popen([new])
sys.exit()
try:
if os.path.basename(sys.argv[0]) == f'run_new{str() if os.name == "posix" else ".exe"}':
os.remove(os.path.join(LOCALDIR, f'run{str() if os.name == "posix" else ".exe"}'))
shutil.copyfile(os.path.join(LOCALDIR, f'run_new{str() if os.name == "posix" else ".exe"}'),
os.path.join(LOCALDIR, f'run{str() if os.name == "posix" else ".exe"}'))
elif os.path.basename(sys.argv[0]) == f'run{str() if os.name == "posix" else ".exe"}':
new = os.path.join(LOCALDIR, f'run_new{str() if os.name == "posix" else ".exe"}')
if os.path.exists(new):
if sha1(os.path.join(LOCALDIR, f'run{str() if os.name == "posix" else ".exe"}')) == sha1(new):
os.remove(new)
else:
subprocess.Popen([new])
sys.exit()
except (Exception, BaseException):
...


class set_utils:
Expand Down

0 comments on commit 8ab7042

Please sign in to comment.