forked from anixart-mod/patcher
игнорирование недоделаных патчей, удаление лишних импортов
This commit is contained in:
@@ -61,6 +61,11 @@ def select_apk() -> str:
|
||||
print("Нет файлов .apk в текущей директории")
|
||||
sys.exit(1)
|
||||
|
||||
if len(apks) == 1:
|
||||
apk = apks[0]
|
||||
print(f"Выбран файл {apk}")
|
||||
return apk
|
||||
|
||||
while True:
|
||||
print("Выберете файл для модификации")
|
||||
for index, apk in enumerate(apks):
|
||||
@@ -127,7 +132,7 @@ patch = decompile_apk(apk)
|
||||
|
||||
patches = []
|
||||
for filename in os.listdir("patches/"):
|
||||
if filename.endswith(".py") and filename != "__init__.py":
|
||||
if filename.endswith(".py") and filename != "__init__.py" and not filename.startswith("todo_"):
|
||||
module_name = filename[:-3]
|
||||
module = importlib.import_module(f"patches.{module_name}")
|
||||
patches.append(Patch(module_name, module))
|
||||
|
||||
@@ -5,6 +5,7 @@ from tqdm import tqdm
|
||||
import os
|
||||
import shutil
|
||||
|
||||
|
||||
def apply(config: dict) -> bool:
|
||||
for item in os.listdir("./decompiled/unknown/"):
|
||||
item_path = os.path.join("./decompiled/unknown/", item)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
"""Change application theme"""
|
||||
priority = 0
|
||||
from tqdm import tqdm
|
||||
|
||||
from lxml import etree
|
||||
|
||||
|
||||
def apply(config: dict) -> bool:
|
||||
main_color = config["theme"]["colors"]["primary"]
|
||||
splash_color = config["theme"]["colors"]["secondary"]
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
"""Compress PNGs"""
|
||||
|
||||
priority = -1
|
||||
from tqdm import tqdm
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
"""Disable ad banners"""
|
||||
|
||||
priority = 0
|
||||
|
||||
from utils.smali_parser import (
|
||||
@@ -9,6 +8,7 @@ from utils.smali_parser import (
|
||||
replace_smali_method_body,
|
||||
)
|
||||
|
||||
|
||||
replace = """ .locals 0
|
||||
|
||||
const/4 p0, 0x1
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
"""Remove beta banner"""
|
||||
|
||||
priority = 0
|
||||
import os
|
||||
from tqdm import tqdm
|
||||
|
||||
import os
|
||||
from lxml import etree
|
||||
|
||||
from typing import TypedDict
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
"""Insert new files"""
|
||||
|
||||
priority = 0
|
||||
from tqdm import tqdm
|
||||
|
||||
import shutil
|
||||
import os
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
"""Change package name of apk"""
|
||||
|
||||
priority = -1
|
||||
from tqdm import tqdm
|
||||
|
||||
import os
|
||||
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
"""Add new settings"""
|
||||
priority = 0
|
||||
from tqdm import tqdm
|
||||
|
||||
from lxml import etree
|
||||
|
||||
# Generate PreferenceCategory
|
||||
|
||||
def make_category(ns, name, items):
|
||||
cat = etree.Element("PreferenceCategory", nsmap=ns)
|
||||
cat.set(f"{{{ns['android']}}}title", name)
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
"""Change application icon"""
|
||||
priority = 0
|
||||
from tqdm import tqdm
|
||||
|
||||
import time
|
||||
|
||||
def apply(config: dict) -> bool:
|
||||
time.sleep(0.2)
|
||||
return False
|
||||
@@ -5,6 +5,7 @@ from tqdm import tqdm
|
||||
import json
|
||||
import requests
|
||||
|
||||
|
||||
def apply(config: dict) -> bool:
|
||||
response = requests.get(config['server'])
|
||||
if response.status_code == 200:
|
||||
@@ -1,7 +1,5 @@
|
||||
"""Change application icon"""
|
||||
|
||||
priority = 0
|
||||
from tqdm import tqdm
|
||||
|
||||
import struct
|
||||
|
||||
Reference in New Issue
Block a user