From 872a5b6d8969ab1569cd57ece3c400c3741049be Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Fri, 2 Feb 2024 12:15:34 +0400 Subject: [PATCH] feat(YouTube - Custom filter): Custom filtering of the protocol buffer (#2682) --- .../youtube/layout/hide/general/HideLayoutComponentsPatch.kt | 4 ++++ src/main/resources/addresources/values/strings.xml | 3 +++ 2 files changed, 7 insertions(+) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt index 5d8c261a..deecff9a 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt @@ -59,6 +59,9 @@ object HideLayoutComponentsPatch : BytecodePatch( "Lapp/revanced/integrations/youtube/patches/components/LayoutComponentsFilter;" private const val DESCRIPTION_COMPONENTS_FILTER_CLASS_NAME = "Lapp/revanced/integrations/youtube/patches/components/DescriptionComponentsFilter;" + private const val CUSTOM_FILTER_CLASS_NAME = + "Lapp/revanced/integrations/youtube/patches/components/CustomFilter;" + override fun execute(context: BytecodeContext) { AddResourcesPatch(this::class) @@ -116,6 +119,7 @@ object HideLayoutComponentsPatch : BytecodePatch( LithoFilterPatch.addFilter(LAYOUT_COMPONENTS_FILTER_CLASS_DESCRIPTOR) LithoFilterPatch.addFilter(DESCRIPTION_COMPONENTS_FILTER_CLASS_NAME) + LithoFilterPatch.addFilter(CUSTOM_FILTER_CLASS_NAME) // region Mix playlists diff --git a/src/main/resources/addresources/values/strings.xml b/src/main/resources/addresources/values/strings.xml index 9d1b377b..609a7cf1 100644 --- a/src/main/resources/addresources/values/strings.xml +++ b/src/main/resources/addresources/values/strings.xml @@ -178,6 +178,9 @@ Custom filter List of component path builder strings to filter separated by new line Hide components using custom filters + Invalid custom filter (must be ASCII only): %s + Invalid custom filter: %s + Custom filter reset to default Hide general ads