Перенос resources и добавления assets в патч настроек

This commit is contained in:
2025-09-22 09:35:51 +03:00
parent 5ff882a8d5
commit 670c53ba69
18 changed files with 23 additions and 20 deletions
+1 -1
View File
@@ -11,7 +11,7 @@
- `patches` Модули патчей - `patches` Модули патчей
- `utils` Вспомогательные модули - `utils` Вспомогательные модули
- `tools` Инструменты для модификации - `tools` Инструменты для модификации
- `patches/resources` Ресурсы, используемые патчами - `resources` Ресурсы, используемые патчами
- `todo_drafts` Заметки для новых патчей(можно в любом формате) - `todo_drafts` Заметки для новых патчей(можно в любом формате)
### Схема ### Схема
+1 -1
View File
@@ -104,7 +104,7 @@ def compress_png_files(config):
def remove_AI_voiceover(config): def remove_AI_voiceover(config):
blank = "./patches/resources/blank.mp3" blank = "./resources/blank.mp3"
path = "./decompiled/res/raw" path = "./decompiled/res/raw"
files = [ files = [
"reputation_1.mp3", "reputation_1.mp3",
+7 -18
View File
@@ -17,31 +17,20 @@ from utils.public import insert_after_public
# Patch # Patch
def apply(config: dict) -> bool: def apply(config: dict) -> bool:
# Mod first launch window # Mod first launch window
shutil.copy("./resources/avatar.png", "./decompiled/assets/avatar.png")
shutil.copy(
"./resources/OpenSans-Regular.ttf",
"./decompiled/assets/OpenSans-Regular.ttf",
)
shutil.copytree( shutil.copytree(
"./patches/resources/smali_classes4/", "./decompiled/smali_classes4/" "./resources/smali_classes4/", "./decompiled/smali_classes4/"
) )
# Mod assets # Mod assets
shutil.copy("./patches/resources/avatar.png", "./decompiled/assets/avatar.png")
shutil.copy( shutil.copy(
"./patches/resources/OpenSans-Regular.ttf", "./resources/ytsans_medium.ttf",
"./decompiled/assets/OpenSans-Regular.ttf",
)
shutil.copy(
"./patches/resources/ic_custom_crown.xml",
"./decompiled/res/drawable/ic_custom_crown.xml",
)
shutil.copy(
"./patches/resources/ic_custom_telegram.xml",
"./decompiled/res/drawable/ic_custom_telegram.xml",
)
shutil.copy(
"./patches/resources/ytsans_medium.ttf",
"./decompiled/res/font/ytsans_medium.ttf", "./decompiled/res/font/ytsans_medium.ttf",
) )
os.remove("./decompiled/res/font/ytsans_medium.otf") os.remove("./decompiled/res/font/ytsans_medium.otf")
insert_after_public("warning_error_counter_background", "ic_custom_telegram")
insert_after_public("warning_error_counter_background", "ic_custom_crown")
return True return True
+14
View File
@@ -24,7 +24,9 @@
priority = 0 priority = 0
# imports # imports
import shutil
from lxml import etree from lxml import etree
from utils.public import insert_after_public
# Patch # Patch
@@ -48,6 +50,18 @@ def make_category(ns, name, items):
return cat return cat
def apply(config: dict) -> bool: def apply(config: dict) -> bool:
shutil.copy(
"./resources/ic_custom_crown.xml",
"./decompiled/res/drawable/ic_custom_crown.xml",
)
insert_after_public("warning_error_counter_background", "ic_custom_crown")
shutil.copy(
"./resources/ic_custom_telegram.xml",
"./decompiled/res/drawable/ic_custom_telegram.xml",
)
insert_after_public("warning_error_counter_background", "ic_custom_telegram")
file_path = "./decompiled/res/xml/preference_main.xml" file_path = "./decompiled/res/xml/preference_main.xml"
parser = etree.XMLParser(remove_blank_text=True) parser = etree.XMLParser(remove_blank_text=True)
tree = etree.parse(file_path, parser) tree = etree.parse(file_path, parser)

Before

Width:  |  Height:  |  Size: 26 MiB

After

Width:  |  Height:  |  Size: 26 MiB