From 40b70b9f9a24cfbf76bcd69f562b87e5cfade66f Mon Sep 17 00:00:00 2001 From: OxrxL <108184954+OxrxL@users.noreply.github.com> Date: Wed, 12 Oct 2022 01:36:38 +0200 Subject: [PATCH] fix(youtube/theme): add missing theme condition check (#771) --- .../youtube/layout/theme/patch/CommentsFilterBarPatch.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/theme/patch/CommentsFilterBarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/theme/patch/CommentsFilterBarPatch.kt index 495bab904..d89a66366 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/theme/patch/CommentsFilterBarPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/theme/patch/CommentsFilterBarPatch.kt @@ -29,12 +29,17 @@ class CommentsFilterBarPatch : BytecodePatch( method.addInstructions( patchIndex, """ + invoke-static {}, Lapp/revanced/integrations/utils/ThemeHelper;->isDarkTheme()Z + move-result v2 + if-nez v2, :comments_filter_white const v1, -0x1 if-ne v1, p1, :comments_filter_white + const/4 p1, 0x0 + :comments_filter_white + if-eqz v2, :comments_filter_dark const v1, -0xdededf if-ne v1, p1, :comments_filter_dark const/4 p1, 0x0 - :comments_filter_white """, listOf(ExternalLabel("comments_filter_dark", method.instruction(patchIndex))) ) return PatchResultSuccess()