1
0
Fork 0
mirror of https://github.com/Radiquum/anixart-patcher.git synced 2025-09-06 11:13:51 +05:00

feat: add disable beta banner patch

This commit is contained in:
Kentai Radiquum 2025-08-31 21:48:59 +05:00
parent 4ec18d7dd4
commit 8498cace94
Signed by: Radiquum
GPG key ID: 858E8EE696525EED
4 changed files with 84 additions and 19 deletions

View file

@ -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