mirror of
https://github.com/Radiquum/anixart-patcher.git
synced 2025-09-06 03:03:50 +05:00
feat: add disable beta banner patch
This commit is contained in:
parent
4ec18d7dd4
commit
8498cace94
4 changed files with 84 additions and 19 deletions
|
@ -69,19 +69,25 @@ def apply_patches(patches: list[str]) -> list[PatchStatus]:
|
|||
)
|
||||
modules.append(Patch(name, module))
|
||||
modules.sort(key=lambda x: x.package.priority, reverse=True)
|
||||
|
||||
for patch in tqdm(modules, colour="green", desc="patching apk"):
|
||||
tqdm.write(f"patch apply: {patch.name}")
|
||||
conf = {}
|
||||
if os.path.exists(f"{config['folders']['patches']}/{patch.name}.config.json"):
|
||||
with open(
|
||||
f"{config['folders']['patches']}/{patch.name}.config.json",
|
||||
"r",
|
||||
encoding="utf-8",
|
||||
) as conf:
|
||||
conf = json.loads(conf.read())
|
||||
conf["src"] = config["folders"]["decompiled"]
|
||||
status = patch.apply(conf)
|
||||
statuses.append({"name": patch.name, "status": status})
|
||||
|
||||
with tqdm(
|
||||
total=len(modules),
|
||||
unit="patch",
|
||||
unit_divisor=1,
|
||||
) as bar:
|
||||
for patch in modules:
|
||||
bar.set_description(f"{patch.name}")
|
||||
conf = {}
|
||||
if os.path.exists(f"{config['folders']['patches']}/{patch.name}.config.json"):
|
||||
with open(
|
||||
f"{config['folders']['patches']}/{patch.name}.config.json",
|
||||
"r",
|
||||
encoding="utf-8",
|
||||
) as conf:
|
||||
conf = json.loads(conf.read())
|
||||
conf["src"] = config["folders"]["decompiled"]
|
||||
status = patch.apply(conf)
|
||||
statuses.append({"name": patch.name, "status": status})
|
||||
bar.update()
|
||||
|
||||
return statuses
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue