This commit is contained in:
+31
-32
@@ -11,22 +11,20 @@
|
||||
}
|
||||
"""
|
||||
|
||||
priority = 0
|
||||
|
||||
# imports
|
||||
import os
|
||||
__author__ = "wowlikon <wowlikon@gmail.com>"
|
||||
__version__ = "1.0.0"
|
||||
import shutil
|
||||
from pydantic import Field
|
||||
from typing import Dict, Any
|
||||
from utils.config import PatchConfig
|
||||
from utils.smali_parser import (
|
||||
find_and_replace_smali_line,
|
||||
get_smali_lines,
|
||||
save_smali_lines
|
||||
)
|
||||
from typing import Any, Dict
|
||||
|
||||
#Config
|
||||
class Config(PatchConfig):
|
||||
from pydantic import Field
|
||||
|
||||
from utils.config import PatchTemplate
|
||||
from utils.smali_parser import (find_and_replace_smali_line, get_smali_lines,
|
||||
save_smali_lines)
|
||||
|
||||
|
||||
class Patch(PatchTemplate):
|
||||
priority: int = Field(frozen=True, exclude=True, default=0)
|
||||
title: str = Field("Anixarty", description="Заголовок")
|
||||
description: str = Field("Описание", description="Описание")
|
||||
link_text: str = Field("МЫ В TELEGRAM", description="Текст ссылки")
|
||||
@@ -34,23 +32,24 @@ class Config(PatchConfig):
|
||||
skip_text: str = Field("Пропустить", description="Текст кнопки пропуска")
|
||||
title_bg_color: str = Field("#FFFFFF", description="Цвет фона заголовка")
|
||||
|
||||
def apply(self, base: Dict[str, Any]) -> bool:
|
||||
file_path = "./decompiled/smali_classes2/com/swiftsoft/anixartd/ui/activity/MainActivity.smali"
|
||||
# Добавление ресурсов окна первого входа
|
||||
shutil.copy("./resources/avatar.png", "./decompiled/assets/avatar.png")
|
||||
shutil.copy(
|
||||
"./resources/OpenSans-Regular.ttf",
|
||||
"./decompiled/assets/OpenSans-Regular.ttf",
|
||||
)
|
||||
shutil.copytree("./resources/smali_classes4/", "./decompiled/smali_classes4/")
|
||||
|
||||
# Patch
|
||||
def apply(config: Config, base: Dict[str, Any]) -> bool:
|
||||
# Добавление ресурсов окна первого входа
|
||||
shutil.copy("./resources/avatar.png", "./decompiled/assets/avatar.png")
|
||||
shutil.copy(
|
||||
"./resources/OpenSans-Regular.ttf",
|
||||
"./decompiled/assets/OpenSans-Regular.ttf",
|
||||
)
|
||||
shutil.copytree(
|
||||
"./resources/smali_classes4/", "./decompiled/smali_classes4/"
|
||||
)
|
||||
method = "invoke-super {p0}, Lmoxy/MvpAppCompatActivity;->onResume()V"
|
||||
lines = get_smali_lines(file_path)
|
||||
lines = find_and_replace_smali_line(
|
||||
lines,
|
||||
method,
|
||||
method
|
||||
+ "\ninvoke-static {p0}, Lcom/swiftsoft/about/$2;->oooooo(Landroid/content/Context;)Ljava/lang/Object;",
|
||||
)
|
||||
save_smali_lines(file_path, lines)
|
||||
|
||||
file_path = "./decompiled/smali_classes2/com/swiftsoft/anixartd/ui/activity/MainActivity.smali"
|
||||
method = "invoke-super {p0}, Lmoxy/MvpAppCompatActivity;->onResume()V"
|
||||
lines = get_smali_lines(file_path)
|
||||
lines = find_and_replace_smali_line(lines, method, method+"\ninvoke-static {p0}, Lcom/swiftsoft/about/$2;->oooooo(Landroid/content/Context;)Ljava/lang/Object;")
|
||||
save_smali_lines(file_path, lines)
|
||||
|
||||
return True
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user