Skip to content

Commit 19a9d11

Browse files
author
LisoUseInAIKyrios
authored
feat(YouTube - Custom filter): Custom filtering of the protocol buffer (#2682)
1 parent 61ee51b commit 19a9d11

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ object HideLayoutComponentsPatch : BytecodePatch(
5959
"Lapp/revanced/integrations/youtube/patches/components/LayoutComponentsFilter;"
6060
private const val DESCRIPTION_COMPONENTS_FILTER_CLASS_NAME =
6161
"Lapp/revanced/integrations/youtube/patches/components/DescriptionComponentsFilter;"
62+
private const val CUSTOM_FILTER_CLASS_NAME =
63+
"Lapp/revanced/integrations/youtube/patches/components/CustomFilter;"
64+
6265

6366
override fun execute(context: BytecodeContext) {
6467
AddResourcesPatch(this::class)
@@ -116,6 +119,7 @@ object HideLayoutComponentsPatch : BytecodePatch(
116119

117120
LithoFilterPatch.addFilter(LAYOUT_COMPONENTS_FILTER_CLASS_DESCRIPTOR)
118121
LithoFilterPatch.addFilter(DESCRIPTION_COMPONENTS_FILTER_CLASS_NAME)
122+
LithoFilterPatch.addFilter(CUSTOM_FILTER_CLASS_NAME)
119123

120124
// region Mix playlists
121125

src/main/resources/addresources/values/strings.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,9 @@
178178
<string name="revanced_custom_filter_strings_title">Custom filter</string>
179179
<string name="revanced_custom_filter_strings_summary">List of component path builder strings to filter separated by new line</string>
180180
<string name="revanced_custom_filter_preference_screen_summary">Hide components using custom filters</string>
181+
<string name="revanced_custom_filter_toast_invalid_characters">Invalid custom filter (must be ASCII only): %s</string>
182+
<string name="revanced_custom_filter_toast_invalid_syntax">Invalid custom filter: %s</string>
183+
<string name="revanced_custom_filter_toast_reset">Custom filter reset to default</string>
181184
</patch>
182185
<patch id="ad.general.HideAdsResourcePatch">
183186
<string name="revanced_hide_general_ads_title">Hide general ads</string>

0 commit comments

Comments
 (0)