Skip to content

Commit

Permalink
- [Tool] Fix Boot became bigger after repack!!
Browse files Browse the repository at this point in the history
Signed-off-by: ColdWindScholar <3590361911@qq.com>
  • Loading branch information
ColdWindScholar committed Sep 30, 2024
1 parent 962e3ef commit be4049b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -2945,7 +2945,7 @@ def jboot(bn: str = 'boot'):
return
re_folder(work + bn)
os.chdir(work + bn)
if call(['magiskboot', 'unpack', '-h', boot]) != 0:
if call(['magiskboot', 'unpack', '-h', '-n', boot]) != 0:
print(f"Unpack {boot} Fail...")
os.chdir(cwd_path)
rmtree(work + bn)
Expand Down Expand Up @@ -3002,11 +3002,14 @@ def dboot(nm: str = 'boot'):
os.remove("ramdisk.cpio")
except (Exception, BaseException):
logging.exception('Bugs')
if comp == 'gzip':
comp = 'gz'
os.rename(f"ramdisk-new.cpio.{comp.split('_')[0]}", "ramdisk.cpio")
else:
print("Successfully packed Ramdisk..")
os.remove("ramdisk.cpio")
os.rename("ramdisk-new.cpio", "ramdisk.cpio")
print(f"Ramdisk Compression:{comp}")
if comp == "unknown":
flag = "-n"
os.chdir(work + nm + os.sep)
Expand Down

0 comments on commit be4049b

Please sign in to comment.