mirror of
https://github.com/Radiquum/anixart-patcher.git
synced 2025-09-09 12:43:49 +05:00
Compare commits
No commits in common. "977d959d3711bea42dc5e77841e9bfa4ce9bd786" and "0e47bf3e91e26dd1e5697886cc06b3d7119e6157" have entirely different histories.
977d959d37
...
0e47bf3e91
3 changed files with 1 additions and 61 deletions
21
LICENSE
21
LICENSE
|
@ -1,21 +0,0 @@
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2025 Kentai Radiquum
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
|
@ -138,7 +138,7 @@ def add_patch_info(patch_statuses: list):
|
||||||
|
|
||||||
item = create_Preference(
|
item = create_Preference(
|
||||||
patch["name"].replace("_", " ").strip().title(),
|
patch["name"].replace("_", " ").strip().title(),
|
||||||
summary = " ".join(description),
|
description=" ".join(description),
|
||||||
)
|
)
|
||||||
if url:
|
if url:
|
||||||
item.append(create_intent(data=url))
|
item.append(create_intent(data=url))
|
||||||
|
|
|
@ -7,7 +7,6 @@ priority = -98
|
||||||
|
|
||||||
# imports
|
# imports
|
||||||
## bundled
|
## bundled
|
||||||
import os
|
|
||||||
from typing import TypedDict
|
from typing import TypedDict
|
||||||
|
|
||||||
## installed
|
## installed
|
||||||
|
@ -48,42 +47,4 @@ def apply(patch_conf: PatchConfig_ChangeAppVersion) -> bool:
|
||||||
) as f:
|
) as f:
|
||||||
apktool_yaml = yaml.dump(apktool_yaml, f, indent=2, Dumper=yaml.Dumper)
|
apktool_yaml = yaml.dump(apktool_yaml, f, indent=2, Dumper=yaml.Dumper)
|
||||||
|
|
||||||
for root, dirs, files in os.walk(f"{config['folders']['decompiled']}"):
|
|
||||||
if len(files) < 0:
|
|
||||||
continue
|
|
||||||
|
|
||||||
for filename in files:
|
|
||||||
file_path = os.path.join(root, filename)
|
|
||||||
if os.path.isfile(file_path) and filename.endswith(".smali"):
|
|
||||||
file_contents = None
|
|
||||||
with open(file_path, "r", encoding="utf-8") as file:
|
|
||||||
file_contents = file.read()
|
|
||||||
|
|
||||||
if file_contents.find(str(patch_conf["_internal_app_build"])) >= 0 or file_contents.find(
|
|
||||||
hex(patch_conf["_internal_app_build"])
|
|
||||||
) >= 0:
|
|
||||||
file_contents = file_contents.replace(
|
|
||||||
str(patch_conf["_internal_app_build"]),
|
|
||||||
str(patch_conf["version_code"]) or str(patch_conf["_internal_app_build"]),
|
|
||||||
)
|
|
||||||
file_contents = file_contents.replace(
|
|
||||||
hex(patch_conf["_internal_app_build"]),
|
|
||||||
hex(patch_conf["version_code"]) or hex(patch_conf["_internal_app_build"]),
|
|
||||||
)
|
|
||||||
log.debug(f"replaced build number in file: {file_path}")
|
|
||||||
log.debug(f"previous: {patch_conf["_internal_app_build"]} ({hex(patch_conf['_internal_app_build'])})")
|
|
||||||
log.debug(f"replaced: {patch_conf["version_code"]} ({hex(patch_conf['version_code'])})")
|
|
||||||
|
|
||||||
if file_contents.find(patch_conf["_internal_app_version"]) >= 0:
|
|
||||||
file_contents = file_contents.replace(
|
|
||||||
patch_conf["_internal_app_version"],
|
|
||||||
patch_conf["version_name"] or patch_conf["_internal_app_version"],
|
|
||||||
)
|
|
||||||
log.debug(f"replaced version name in file: {file_path}")
|
|
||||||
log.debug(f"previous: {patch_conf["_internal_app_build"]}")
|
|
||||||
log.debug(f"replaced: {patch_conf["version_code"]}")
|
|
||||||
|
|
||||||
with open(file_path, "w", encoding="utf-8") as file:
|
|
||||||
file.write(file_contents)
|
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue