From 6f79746d788f196f3aa63b8e7c24b7f15ecd3f50 Mon Sep 17 00:00:00 2001 From: nullptr <107796137+johnconner122@users.noreply.github.com> Date: Fri, 13 Oct 2023 20:18:42 +0500 Subject: [PATCH] fix(YouTube - Hide Layout components): Exempt expandable chips from exceptions (#498) Co-authored-by: oSumAtrIX --- .../patches/components/LayoutComponentsFilter.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/app/revanced/integrations/patches/components/LayoutComponentsFilter.java b/app/src/main/java/app/revanced/integrations/patches/components/LayoutComponentsFilter.java index fa1d9b36..a5882d22 100644 --- a/app/src/main/java/app/revanced/integrations/patches/components/LayoutComponentsFilter.java +++ b/app/src/main/java/app/revanced/integrations/patches/components/LayoutComponentsFilter.java @@ -22,6 +22,7 @@ public final class LayoutComponentsFilter extends Filter { private final StringFilterGroup searchResultShelfHeader; private final StringFilterGroup inFeedSurvey; private final StringFilterGroup notifyMe; + private final StringFilterGroup expandableMetadata; @RequiresApi(api = Build.VERSION_CODES.N) public LayoutComponentsFilter() { @@ -114,7 +115,7 @@ public final class LayoutComponentsFilter extends Filter { "official_card" ); - final var expandableMetadata = new StringFilterGroup( + expandableMetadata = new StringFilterGroup( SettingsEnum.HIDE_EXPANDABLE_CHIP, "inline_expander" ); @@ -219,7 +220,8 @@ public final class LayoutComponentsFilter extends Filter { // The groups are excluded from the filter due to the exceptions list below. // Filter them separately here. - if (matchedGroup == notifyMe || matchedGroup == inFeedSurvey) return true; + if (matchedGroup == notifyMe || matchedGroup == inFeedSurvey || matchedGroup == expandableMetadata) + return super.isFiltered(identifier, path, protobufBufferArray, matchedList, matchedGroup, matchedIndex); if (matchedGroup != custom && exceptions.matches(path)) return false; // Exceptions are not filtered.