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