From 4ad4a707aad71cbe05354f298ad8aa8fc01c2863 Mon Sep 17 00:00:00 2001 From: Radiquum Date: Mon, 1 Sep 2025 00:17:11 +0500 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=BF=D0=B0=D1=82=D1=87=D0=B0=20=D0=B4?= =?UTF-8?q?=D0=BB=D1=8F=20=D1=83=D0=B4=D0=B0=D0=BB=D0=B5=D0=BD=D0=B8=D1=8F?= =?UTF-8?q?=20=D0=B1=D0=B0=D0=BD=D0=BD=D0=B5=D1=80=D0=B0=20"=D0=91=D0=B5?= =?UTF-8?q?=D1=82=D0=B0=20=D0=92=D0=B5=D1=80=D1=81=D0=B8=D1=8F"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- patches/disable_beta_banner.py | 39 ++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 patches/disable_beta_banner.py diff --git a/patches/disable_beta_banner.py b/patches/disable_beta_banner.py new file mode 100644 index 0000000..2e2d417 --- /dev/null +++ b/patches/disable_beta_banner.py @@ -0,0 +1,39 @@ +"""Remove beta banner""" + +priority = 0 +import os +from tqdm import tqdm +from lxml import etree + +from typing import TypedDict + + +def apply(config) -> bool: + attributes = [ + "paddingTop", + "paddingBottom", + "paddingStart", + "paddingEnd", + "layout_width", + "layout_height", + "layout_marginTop", + "layout_marginBottom", + "layout_marginStart", + "layout_marginEnd", + ] + + beta_banner_xml = "./decompiled/res/layout/item_beta.xml" + if os.path.exists(beta_banner_xml): + parser = etree.XMLParser(remove_blank_text=True) + tree = etree.parse(beta_banner_xml, parser) + root = tree.getroot() + + for attr in attributes: + # tqdm.write(f"set {attr} = 0.0dip") + root.set(f"{{{config["xml_ns"]['android']}}}{attr}", "0.0dip") + + tree.write( + beta_banner_xml, pretty_print=True, xml_declaration=True, encoding="utf-8" + ) + + return True