From cab04b3a56cfc5bf00b7c6fcf6f86ab75aa5d4fd Mon Sep 17 00:00:00 2001 From: johnconner122 <107796137+johnconner122@users.noreply.github.com> Date: Sun, 18 Jun 2023 04:47:31 +0500 Subject: [PATCH] fix(youtube/comments): add missing filter (#2423) --- .../layout/hide/comments/patch/CommentsPatch.kt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/patch/CommentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/patch/CommentsPatch.kt index 5ebb44d1..e0e41e36 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/patch/CommentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/patch/CommentsPatch.kt @@ -9,21 +9,23 @@ import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.Patch -import app.revanced.patches.shared.mapping.misc.patch.ResourceMappingPatch import app.revanced.patches.shared.settings.preference.impl.PreferenceScreen import app.revanced.patches.shared.settings.preference.impl.StringResource import app.revanced.patches.shared.settings.preference.impl.SwitchPreference import app.revanced.patches.youtube.layout.hide.comments.annotations.HideCommentsCompatibility +import app.revanced.patches.youtube.misc.litho.filter.patch.LithoFilterPatch import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch @Patch @Name("comments") @Description("Hides components related to comments.") @HideCommentsCompatibility -@DependsOn([SettingsPatch::class, ResourceMappingPatch::class]) +@DependsOn([SettingsPatch::class, LithoFilterPatch::class]) @Version("0.0.1") class CommentsPatch : ResourcePatch { override fun execute(context: ResourceContext): PatchResult { + LithoFilterPatch.addFilter(FILTER_CLASS_DESCRIPTOR) + SettingsPatch.PreferenceScreen.LAYOUT.addPreferences( PreferenceScreen( "revanced_comments_preference_screen", @@ -48,4 +50,8 @@ class CommentsPatch : ResourcePatch { return PatchResultSuccess() } -} \ No newline at end of file + + private companion object { + const val FILTER_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/patches/components/CommentsFilter;" + } +}