mirror of
https://github.com/elseif/MikroTikPatch.git
synced 2026-09-04 06:25:47 +00:00
modified: patch.py
This commit is contained in:
4
patch.py
4
patch.py
@@ -338,6 +338,10 @@ def patch_squashfs(path,key_dict):
|
||||
for file_path in [os.path.join(root, 'mode'),os.path.join(root, 'keyman')]:
|
||||
with open(file_path, 'rb') as f:
|
||||
data = f.read()
|
||||
for old_url,new_url in url_replacements.items():
|
||||
if old_url in data:
|
||||
print(f'{file_path} url patched {old_url.decode()[:7]}...')
|
||||
data = data.replace(old_url,new_url)
|
||||
modified = False
|
||||
for old_public_key,new_public_key in key_dict.items():
|
||||
new_data = replace_key(old_public_key,new_public_key,data,file_path)
|
||||
|
||||
Reference in New Issue
Block a user