From 6730aaf2b864b747a6b77411cdaceee653b36218 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Thu, 5 Oct 2023 03:41:52 +0200 Subject: [PATCH] fix(YouTube - Hide shorts components): Hide the subscribe button when paused --- .../patches/components/ShortsFilter.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/app/revanced/integrations/patches/components/ShortsFilter.java b/app/src/main/java/app/revanced/integrations/patches/components/ShortsFilter.java index 6b03173b..a2149447 100644 --- a/app/src/main/java/app/revanced/integrations/patches/components/ShortsFilter.java +++ b/app/src/main/java/app/revanced/integrations/patches/components/ShortsFilter.java @@ -16,6 +16,7 @@ public final class ShortsFilter extends Filter { private final String REEL_CHANNEL_BAR_PATH = "reel_channel_bar.eml"; private final StringFilterGroup channelBar; + private final StringFilterGroup subscribeButton; private final StringFilterGroup soundButton; private final StringFilterGroup infoPanel; private final StringFilterGroup shelfHeader; @@ -53,7 +54,8 @@ public final class ShortsFilter extends Filter { SettingsEnum.HIDE_SHORTS_JOIN_BUTTON, "sponsor_button" ); - var subscribeButton = new StringFilterGroup( + + subscribeButton = new StringFilterGroup( SettingsEnum.HIDE_SHORTS_SUBSCRIBE_BUTTON, "subscribe_button", "shorts_paused_state" @@ -63,6 +65,7 @@ public final class ShortsFilter extends Filter { SettingsEnum.HIDE_SHORTS_CHANNEL_BAR, REEL_CHANNEL_BAR_PATH ); + soundButton = new StringFilterGroup( SettingsEnum.HIDE_SHORTS_SOUND_BUTTON, "reel_pivot_button" @@ -105,8 +108,11 @@ public final class ShortsFilter extends Filter { FilterGroupList matchedList, FilterGroup matchedGroup, int matchedIndex) { if (matchedList == pathFilterGroupList) { // Always filter if matched. - if (matchedGroup == soundButton || matchedGroup == infoPanel || matchedGroup == channelBar) - return super.isFiltered(identifier, path, protobufBufferArray, matchedList, matchedGroup, matchedIndex); + if (matchedGroup == soundButton || + matchedGroup == infoPanel || + matchedGroup == channelBar || + matchedGroup == subscribeButton + ) return super.isFiltered(identifier, path, protobufBufferArray, matchedList, matchedGroup, matchedIndex); // Video action buttons (comment, share, remix) have the same path. if (matchedGroup == videoActionButton) {