From 9938bbf0de9592db015ae0cfea83e855e12f0c7e Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Wed, 17 Apr 2024 14:00:35 +0400 Subject: [PATCH] fix(YouTube - Hide Shorts components): Hide subscribe button in channel bar --- .../youtube/patches/components/ShortsFilter.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/app/revanced/integrations/youtube/patches/components/ShortsFilter.java b/app/src/main/java/app/revanced/integrations/youtube/patches/components/ShortsFilter.java index ad78ac8e..c03d4518 100644 --- a/app/src/main/java/app/revanced/integrations/youtube/patches/components/ShortsFilter.java +++ b/app/src/main/java/app/revanced/integrations/youtube/patches/components/ShortsFilter.java @@ -17,7 +17,12 @@ import app.revanced.integrations.youtube.shared.PlayerType; @SuppressWarnings("unused") public final class ShortsFilter extends Filter { public static PivotBar pivotBar; // Set by patch. - private final String REEL_CHANNEL_BAR_PATH = "reel_channel_bar.eml"; + + private final static String REEL_CHANNEL_BAR_PATH = "reel_channel_bar.eml"; + /** + * For subscribe button that appears in the channel bar. + */ + private final static String REEL_METAPANEL_PATH = "reel_metapanel.eml"; private final StringFilterGroup shortsCompactFeedVideoPath; private final ByteArrayFilterGroup shortsCompactFeedVideoBuffer; @@ -192,8 +197,8 @@ public final class ShortsFilter extends Filter { StringFilterGroup matchedGroup, FilterContentType contentType, int contentIndex) { if (contentType == FilterContentType.PATH) { if (matchedGroup == subscribeButton || matchedGroup == joinButton) { - // Filter only when reelChannelBar is visible to avoid false positives. - if (path.startsWith(REEL_CHANNEL_BAR_PATH)) { + // Selectively filter to avoid false positive filtering of other subscribe/join buttons. + if (path.startsWith(REEL_CHANNEL_BAR_PATH) || path.startsWith(REEL_METAPANEL_PATH)) { return super.isFiltered( identifier, path, protobufBufferArray, matchedGroup, contentType, contentIndex );