forked from anixart-mod/patcher
Обновление структуры проекта, использование pydantic для конфигураций, улучшение отчёта о патчах
This commit is contained in:
+11
-3
@@ -10,6 +10,10 @@ priority = 0
|
||||
|
||||
# imports
|
||||
import textwrap
|
||||
from tqdm import tqdm
|
||||
from typing import Dict, Any
|
||||
|
||||
from utils.config import PatchConfig
|
||||
from utils.smali_parser import (
|
||||
find_smali_method_end,
|
||||
find_smali_method_start,
|
||||
@@ -18,13 +22,17 @@ from utils.smali_parser import (
|
||||
)
|
||||
|
||||
|
||||
#Config
|
||||
class Config(PatchConfig): ...
|
||||
|
||||
|
||||
# Patch
|
||||
def apply(config) -> bool:
|
||||
replacement = textwrap.dedent("""\
|
||||
def apply(config: Config, base: Dict[str, Any]) -> bool:
|
||||
replacement = [f'\t{line}\n' for line in textwrap.dedent("""\
|
||||
.locals 0
|
||||
const/4 p0, 0x1
|
||||
return p0
|
||||
""").splitlines()
|
||||
""").splitlines()]
|
||||
|
||||
path = "./decompiled/smali_classes2/com/swiftsoft/anixartd/Prefs.smali"
|
||||
lines = get_smali_lines(path)
|
||||
|
||||
Reference in New Issue
Block a user