From ac241e11890928cdb4a708cd1cd66e2be0679e43 Mon Sep 17 00:00:00 2001 From: wowlikon Date: Sun, 14 Sep 2025 20:37:14 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D0=BD=D0=BE=D1=81=20?= =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D1=8F=20?= =?UTF-8?q?=D1=80=D0=B5=D1=81=D1=83=D1=80=D1=81=D0=BE=D0=B2=20=D0=B2=20?= =?UTF-8?q?=D1=81=D0=BE=D0=BE=D1=82=D0=B2=D0=B5=D1=82=D1=81=D1=82=D0=B2?= =?UTF-8?q?=D1=83=D1=8E=D1=89=D0=B8=D0=B5=20=D0=BF=D0=B0=D1=82=D1=87=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- patches/color_theme.py | 12 ------------ patches/insert_new.py | 13 ++++--------- patches/todo_custom_speed.py | 21 +++++++++++++-------- todo_drafts/todo1.txt | 12 ++---------- todo_drafts/todo3.txt | 2 -- todo_drafts/todo4.txt | 1 - utils/smali_parser.py | 9 +++++++++ 7 files changed, 28 insertions(+), 42 deletions(-) delete mode 100644 todo_drafts/todo3.txt delete mode 100644 todo_drafts/todo4.txt diff --git a/patches/color_theme.py b/patches/color_theme.py index 9ef3a32..24e5928 100644 --- a/patches/color_theme.py +++ b/patches/color_theme.py @@ -6,7 +6,6 @@ from lxml import etree from utils.public import ( insert_after_public, insert_after_color, - insert_after_id, 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_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 diff --git a/patches/insert_new.py b/patches/insert_new.py index ee1308f..1afc230 100644 --- a/patches/insert_new.py +++ b/patches/insert_new.py @@ -4,6 +4,8 @@ priority = 0 import shutil import os +from utils.public import insert_after_public + def apply(config: dict) -> bool: # Mod first launch window @@ -31,14 +33,7 @@ def apply(config: dict) -> bool: ) os.remove("./decompiled/res/font/ytsans_medium.otf") - # IDK - shutil.move( - "./decompiled/res/raw/bundled_cert.crt", - "./decompiled/res/raw/bundled_cert.cer", - ) - shutil.move( - "./decompiled/res/raw/sdkinternalca.crt", - "./decompiled/res/raw/sdkinternalca.cer", - ) + insert_after_public("warning_error_counter_background", "ic_custom_telegram") + insert_after_public("warning_error_counter_background", "ic_custom_crown") return True diff --git a/patches/todo_custom_speed.py b/patches/todo_custom_speed.py index c245860..b0e6bad 100644 --- a/patches/todo_custom_speed.py +++ b/patches/todo_custom_speed.py @@ -1,14 +1,19 @@ -"""Change application icon""" +"""Add custom video playback speed""" priority = 0 -import struct - - -def float_to_hex(f): - b = struct.pack(">f", f) - return b.hex() - +from utils.smali_parser import float_to_hex +from utils.public import ( + insert_after_public, + insert_after_id, +) def apply(config: dict) -> bool: 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 diff --git a/todo_drafts/todo1.txt b/todo_drafts/todo1.txt index 9b341e7..cbf0e14 100644 --- a/todo_drafts/todo1.txt +++ b/todo_drafts/todo1.txt @@ -1,10 +1,2 @@ -/res/layout/monetization_ads_internal_rewarded_close_verification.xml -❯ diff a.txt b.txt -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" +/res/menu/bottom.xml +replace lines diff --git a/todo_drafts/todo3.txt b/todo_drafts/todo3.txt deleted file mode 100644 index cbf0e14..0000000 --- a/todo_drafts/todo3.txt +++ /dev/null @@ -1,2 +0,0 @@ -/res/menu/bottom.xml -replace lines diff --git a/todo_drafts/todo4.txt b/todo_drafts/todo4.txt deleted file mode 100644 index 382b5d0..0000000 --- a/todo_drafts/todo4.txt +++ /dev/null @@ -1 +0,0 @@ -#ff000000 diff --git a/utils/smali_parser.py b/utils/smali_parser.py index c2b8a78..7cc6a12 100644 --- a/utils/smali_parser.py +++ b/utils/smali_parser.py @@ -1,3 +1,6 @@ +import struct + + def get_smali_lines(file: str) -> list[str]: lines = [] with open(file, "r", encoding="utf-8") as smali: @@ -51,6 +54,7 @@ def replace_smali_method_body( return new_content + def find_and_replace_smali_line( lines: list[str], search: str, replace: str ) -> list[str]: @@ -58,3 +62,8 @@ def find_and_replace_smali_line( if line.find(search) >= 0: lines[index] = lines[index].replace(search, replace) return lines + + +def float_to_hex(f): + b = struct.pack(">f", f) + return b.hex()