mirror of
https://github.com/elseif/MikroTikPatch
synced 2026-07-17 18:49:41 +00:00
Update patch.py
Signed-off-by: elseif <elseif@live.cn>
This commit is contained in:
parent
9bad9f06f1
commit
a350e2badd
9
patch.py
9
patch.py
@ -294,11 +294,12 @@ def patch_loader(loader_file):
|
||||
|
||||
def patch_squashfs(path,key_dict):
|
||||
for root, dirs, files in os.walk(path):
|
||||
for file in files:
|
||||
if file =='loader':
|
||||
patch_loader(loader_file)
|
||||
file = os.path.join(root,file)
|
||||
for _file in files:
|
||||
file = os.path.join(root,_file)
|
||||
if os.path.isfile(file):
|
||||
if _file =='loader':
|
||||
patch_loader(file)
|
||||
continue
|
||||
data = open(file,'rb').read()
|
||||
for old_public_key,new_public_key in key_dict.items():
|
||||
_data = replace_key(old_public_key,new_public_key,data,file)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user