Перенос добавления ресурсов в соответствующие патчи
This commit is contained in:
@@ -6,7 +6,6 @@ from lxml import etree
|
|||||||
from utils.public import (
|
from utils.public import (
|
||||||
insert_after_public,
|
insert_after_public,
|
||||||
insert_after_color,
|
insert_after_color,
|
||||||
insert_after_id,
|
|
||||||
change_color,
|
change_color,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -97,15 +96,4 @@ def apply(config: dict) -> bool:
|
|||||||
change_color("bottom_nav_indicator_icon_checked", main_color[0]+'ff'+main_color[1:])
|
change_color("bottom_nav_indicator_icon_checked", main_color[0]+'ff'+main_color[1:])
|
||||||
change_color("bottom_nav_indicator_label_checked", main_color[0]+'ff'+main_color[1:])
|
change_color("bottom_nav_indicator_label_checked", main_color[0]+'ff'+main_color[1:])
|
||||||
|
|
||||||
insert_after_public("warning_error_counter_background", "ic_custom_telegram")
|
|
||||||
insert_after_public("warning_error_counter_background", "ic_custom_crown")
|
|
||||||
|
|
||||||
try:
|
|
||||||
last = "speed75"
|
|
||||||
for speed in config.get("speeds", []):
|
|
||||||
insert_after_public(last, f"speed{int(float(speed)*10)}")
|
|
||||||
insert_after_id(last, f"speed{int(float(speed)*10)}")
|
|
||||||
last = f"speed{int(float(speed)*10)}"
|
|
||||||
except Exception as e:
|
|
||||||
print(f"Error occurred while processing speeds: {e}")
|
|
||||||
return True
|
return True
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ priority = 0
|
|||||||
import shutil
|
import shutil
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
from utils.public import insert_after_public
|
||||||
|
|
||||||
|
|
||||||
def apply(config: dict) -> bool:
|
def apply(config: dict) -> bool:
|
||||||
# Mod first launch window
|
# Mod first launch window
|
||||||
@@ -31,14 +33,7 @@ def apply(config: dict) -> bool:
|
|||||||
)
|
)
|
||||||
os.remove("./decompiled/res/font/ytsans_medium.otf")
|
os.remove("./decompiled/res/font/ytsans_medium.otf")
|
||||||
|
|
||||||
# IDK
|
insert_after_public("warning_error_counter_background", "ic_custom_telegram")
|
||||||
shutil.move(
|
insert_after_public("warning_error_counter_background", "ic_custom_crown")
|
||||||
"./decompiled/res/raw/bundled_cert.crt",
|
|
||||||
"./decompiled/res/raw/bundled_cert.cer",
|
|
||||||
)
|
|
||||||
shutil.move(
|
|
||||||
"./decompiled/res/raw/sdkinternalca.crt",
|
|
||||||
"./decompiled/res/raw/sdkinternalca.cer",
|
|
||||||
)
|
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|||||||
@@ -1,14 +1,19 @@
|
|||||||
"""Change application icon"""
|
"""Add custom video playback speed"""
|
||||||
priority = 0
|
priority = 0
|
||||||
|
|
||||||
import struct
|
from utils.smali_parser import float_to_hex
|
||||||
|
from utils.public import (
|
||||||
|
insert_after_public,
|
||||||
def float_to_hex(f):
|
insert_after_id,
|
||||||
b = struct.pack(">f", f)
|
)
|
||||||
return b.hex()
|
|
||||||
|
|
||||||
|
|
||||||
def apply(config: dict) -> bool:
|
def apply(config: dict) -> bool:
|
||||||
assert float_to_hex(1.5) == "0x3fc00000"
|
assert float_to_hex(1.5) == "0x3fc00000"
|
||||||
|
|
||||||
|
last = "speed75"
|
||||||
|
for speed in config.get("speeds", []):
|
||||||
|
insert_after_public(last, f"speed{int(float(speed)*10)}")
|
||||||
|
insert_after_id(last, f"speed{int(float(speed)*10)}")
|
||||||
|
last = f"speed{int(float(speed)*10)}"
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|||||||
+2
-10
@@ -1,10 +1,2 @@
|
|||||||
/res/layout/monetization_ads_internal_rewarded_close_verification.xml
|
/res/menu/bottom.xml
|
||||||
❯ diff a.txt b.txt
|
replace lines
|
||||||
4c4
|
|
||||||
< android:background="@drawable/monetization_ads_internal_rewarded_close_verification_button_close_background"
|
|
||||||
---
|
|
||||||
> android:background="@drawable/draw030e"
|
|
||||||
16c16
|
|
||||||
< android:background="@drawable/monetization_ads_internal_rewarded_close_verification_button_dismiss_background"
|
|
||||||
---
|
|
||||||
> android:background="@drawable/draw030f"
|
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
/res/menu/bottom.xml
|
|
||||||
replace lines
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
<color name="ic_launcher_background">#ff000000</color>
|
|
||||||
@@ -1,3 +1,6 @@
|
|||||||
|
import struct
|
||||||
|
|
||||||
|
|
||||||
def get_smali_lines(file: str) -> list[str]:
|
def get_smali_lines(file: str) -> list[str]:
|
||||||
lines = []
|
lines = []
|
||||||
with open(file, "r", encoding="utf-8") as smali:
|
with open(file, "r", encoding="utf-8") as smali:
|
||||||
@@ -51,6 +54,7 @@ def replace_smali_method_body(
|
|||||||
|
|
||||||
return new_content
|
return new_content
|
||||||
|
|
||||||
|
|
||||||
def find_and_replace_smali_line(
|
def find_and_replace_smali_line(
|
||||||
lines: list[str], search: str, replace: str
|
lines: list[str], search: str, replace: str
|
||||||
) -> list[str]:
|
) -> list[str]:
|
||||||
@@ -58,3 +62,8 @@ def find_and_replace_smali_line(
|
|||||||
if line.find(search) >= 0:
|
if line.find(search) >= 0:
|
||||||
lines[index] = lines[index].replace(search, replace)
|
lines[index] = lines[index].replace(search, replace)
|
||||||
return lines
|
return lines
|
||||||
|
|
||||||
|
|
||||||
|
def float_to_hex(f):
|
||||||
|
b = struct.pack(">f", f)
|
||||||
|
return b.hex()
|
||||||
|
|||||||
Reference in New Issue
Block a user