From 12868c7f4be773df92fcc936034517d0a85737be Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sat, 13 Apr 2024 02:16:13 +0400 Subject: [PATCH 1/7] feat(YouTube - Hide Shorts components): Hide tagged products --- .../shared/settings/EnumSetting.java | 4 +- .../preference/SharedPrefCategory.java | 4 +- .../patches/components/ShortsFilter.java | 51 ++++++++++--------- .../youtube/settings/Settings.java | 2 +- 4 files changed, 32 insertions(+), 29 deletions(-) diff --git a/app/src/main/java/app/revanced/integrations/shared/settings/EnumSetting.java b/app/src/main/java/app/revanced/integrations/shared/settings/EnumSetting.java index 20ef4821e0..a6301def24 100644 --- a/app/src/main/java/app/revanced/integrations/shared/settings/EnumSetting.java +++ b/app/src/main/java/app/revanced/integrations/shared/settings/EnumSetting.java @@ -17,7 +17,7 @@ * All saved JSON text is converted to lowercase to keep the output less obnoxious. */ @SuppressWarnings("unused") -public class EnumSetting extends Setting { +public class EnumSetting> extends Setting { public EnumSetting(String key, T defaultValue) { super(key, defaultValue); } @@ -72,7 +72,7 @@ protected void writeToJSON(JSONObject json, String importExportKey) throws JSONE @NonNull private T getEnumFromString(String enumName) { //noinspection ConstantConditions - for (Enum value : defaultValue.getClass().getEnumConstants()) { + for (Enum value : defaultValue.getClass().getEnumConstants()) { if (value.name().equalsIgnoreCase(enumName)) { // noinspection unchecked return (T) value; diff --git a/app/src/main/java/app/revanced/integrations/shared/settings/preference/SharedPrefCategory.java b/app/src/main/java/app/revanced/integrations/shared/settings/preference/SharedPrefCategory.java index 9c7fa45ca8..ddbc31cb04 100644 --- a/app/src/main/java/app/revanced/integrations/shared/settings/preference/SharedPrefCategory.java +++ b/app/src/main/java/app/revanced/integrations/shared/settings/preference/SharedPrefCategory.java @@ -53,7 +53,7 @@ public void saveBoolean(@NonNull String key, boolean value) { /** * @param value a NULL parameter removes the value from the preferences */ - public void saveEnumAsString(@NonNull String key, @Nullable Enum value) { + public void saveEnumAsString(@NonNull String key, @Nullable Enum value) { saveObjectAsString(key, value); } @@ -98,7 +98,7 @@ public String getString(@NonNull String key, @NonNull String _default) { } @NonNull - public T getEnum(@NonNull String key, @NonNull T _default) { + public > T getEnum(@NonNull String key, @NonNull T _default) { Objects.requireNonNull(_default); try { String enumName = preferences.getString(key, null); 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 05835b50ff..966c13bbf9 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 @@ -33,8 +33,8 @@ public final class ShortsFilter extends Filter { private final StringFilterGroup joinButton; private final StringFilterGroup shelfHeader; - private final StringFilterGroup suggestedActionPath; - private final ByteArrayFilterGroupList suggestedActions = new ByteArrayFilterGroupList(); + private final StringFilterGroup suggestedAction; + private final ByteArrayFilterGroupList suggestedActionsGroupList = new ByteArrayFilterGroupList(); private final StringFilterGroup actionBar; private final ByteArrayFilterGroupList videoActionButtonGroupList = new ByteArrayFilterGroupList(); @@ -59,14 +59,7 @@ public ShortsFilter() { "shelf_header.eml" ); - // Home / subscription feed components. - - var thanksButton = new StringFilterGroup( // Edit: Does this item show up anymore? - Settings.HIDE_SHORTS_THANKS_BUTTON, - "suggested_action" - ); - - addIdentifierCallbacks(shorts, shelfHeader, thanksButton); + addIdentifierCallbacks(shorts, shelfHeader); // // Path components. @@ -130,14 +123,14 @@ public ShortsFilter() { "shorts_action_bar" ); - suggestedActionPath = new StringFilterGroup( + suggestedAction = new StringFilterGroup( null, "suggested_action.eml" ); addPathCallbacks( shortsCompactFeedVideoPath, - joinButton, subscribeButton, subscribeButtonPaused, suggestedActionPath, + joinButton, subscribeButton, subscribeButtonPaused, suggestedAction, channelBar, fullVideoLinkLabel, videoTitle, reelSoundMetadata, soundButton, infoPanel, actionBar ); @@ -181,11 +174,15 @@ public ShortsFilter() { // // Suggested actions. // - suggestedActions.addAll( + suggestedActionsGroupList.addAll( new ByteArrayFilterGroup( Settings.HIDE_SHORTS_SHOP_BUTTON, "yt_outline_bag_" ), + new ByteArrayFilterGroup( + Settings.HIDE_SHORTS_TAGGED_PRODUCTS, + "PAproduct_listZ" + ), new ByteArrayFilterGroup( Settings.HIDE_SHORTS_LOCATION_BUTTON, "yt_outline_location_point_" @@ -221,30 +218,36 @@ boolean isFiltered(@Nullable String identifier, String path, byte[] protobufBuff if (matchedGroup == subscribeButton || matchedGroup == joinButton) { // Filter only when reelChannelBar is visible to avoid false positives. - if (path.startsWith(REEL_CHANNEL_BAR_PATH)) return super.isFiltered( - identifier, path, protobufBufferArray, matchedGroup, contentType, contentIndex - ); + if (path.startsWith(REEL_CHANNEL_BAR_PATH)) { + return super.isFiltered( + identifier, path, protobufBufferArray, matchedGroup, contentType, contentIndex + ); + } return false; } // Video action buttons (like, dislike, comment, share, remix) have the same path. if (matchedGroup == actionBar) { - if (videoActionButtonGroupList.check(protobufBufferArray).isFiltered()) return super.isFiltered( - identifier, path, protobufBufferArray, matchedGroup, contentType, contentIndex - ); + if (videoActionButtonGroupList.check(protobufBufferArray).isFiltered()) { + return super.isFiltered( + identifier, path, protobufBufferArray, matchedGroup, contentType, contentIndex + ); + } return false; } - if (matchedGroup == suggestedActionPath) { - if (contentIndex == 0 && suggestedActions.check(protobufBufferArray).isFiltered()) return super.isFiltered( - identifier, path, protobufBufferArray, matchedGroup, contentType, contentIndex - ); + if (matchedGroup == suggestedAction) { + if (contentIndex == 0 && suggestedActionsGroupList.check(protobufBufferArray).isFiltered()) { + return super.isFiltered( + identifier, path, protobufBufferArray, matchedGroup, contentType, contentIndex + ); + } // else, return false; } return false; } else { - // Feed/search path components. + // Feed/search identifier components. if (matchedGroup == shelfHeader) { // Because the header is used in watch history and possibly other places, check for the index, // which is 0 when the shelf header is used for Shorts. diff --git a/app/src/main/java/app/revanced/integrations/youtube/settings/Settings.java b/app/src/main/java/app/revanced/integrations/youtube/settings/Settings.java index ed90f89dfa..c780ccd171 100644 --- a/app/src/main/java/app/revanced/integrations/youtube/settings/Settings.java +++ b/app/src/main/java/app/revanced/integrations/youtube/settings/Settings.java @@ -159,8 +159,8 @@ public class Settings extends BaseSettings { public static final BooleanSetting HIDE_SHORTS_JOIN_BUTTON = new BooleanSetting("revanced_hide_shorts_join_button", TRUE); public static final BooleanSetting HIDE_SHORTS_SUBSCRIBE_BUTTON = new BooleanSetting("revanced_hide_shorts_subscribe_button", TRUE); public static final BooleanSetting HIDE_SHORTS_SUBSCRIBE_BUTTON_PAUSED = new BooleanSetting("revanced_hide_shorts_subscribe_button_paused", FALSE); - public static final BooleanSetting HIDE_SHORTS_THANKS_BUTTON = new BooleanSetting("revanced_hide_shorts_thanks_button", TRUE); public static final BooleanSetting HIDE_SHORTS_SHOP_BUTTON = new BooleanSetting("revanced_hide_shorts_shop_button", TRUE); + public static final BooleanSetting HIDE_SHORTS_TAGGED_PRODUCTS = new BooleanSetting("revanced_hide_shorts_tagged_products", TRUE); public static final BooleanSetting HIDE_SHORTS_LOCATION_BUTTON = new BooleanSetting("revanced_hide_shorts_location_button", FALSE); public static final BooleanSetting HIDE_SHORTS_SAVE_SOUND_BUTTON = new BooleanSetting("revanced_hide_shorts_save_sound_button", FALSE); public static final BooleanSetting HIDE_SHORTS_LIKE_BUTTON = new BooleanSetting("revanced_hide_shorts_like_button", FALSE); From 6c2cba88071722d8bacb5d086a23cc49c19d2d75 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sat, 13 Apr 2024 02:39:23 +0400 Subject: [PATCH 2/7] refactor: no functional changes --- .../patches/components/ShortsFilter.java | 50 ++++++++----------- 1 file changed, 20 insertions(+), 30 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 966c13bbf9..c30fa03887 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 @@ -138,37 +138,27 @@ public ShortsFilter() { // // Action buttons // - var shortsLikeButton = new ByteArrayFilterGroup( - Settings.HIDE_SHORTS_LIKE_BUTTON, - "shorts_like_button" - ); - - var shortsDislikeButton = new ByteArrayFilterGroup( - Settings.HIDE_SHORTS_DISLIKE_BUTTON, - "shorts_dislike_button" - ); - - var shortsCommentButton = new ByteArrayFilterGroup( - Settings.HIDE_SHORTS_COMMENTS_BUTTON, - "reel_comment_button" - ); - - var shortsShareButton = new ByteArrayFilterGroup( - Settings.HIDE_SHORTS_SHARE_BUTTON, - "reel_share_button" - ); - - var shortsRemixButton = new ByteArrayFilterGroup( - Settings.HIDE_SHORTS_REMIX_BUTTON, - "reel_remix_button" - ); - videoActionButtonGroupList.addAll( - shortsLikeButton, - shortsDislikeButton, - shortsCommentButton, - shortsShareButton, - shortsRemixButton + new ByteArrayFilterGroup( + Settings.HIDE_SHORTS_LIKE_BUTTON, + "shorts_like_button" + ), + new ByteArrayFilterGroup( + Settings.HIDE_SHORTS_DISLIKE_BUTTON, + "shorts_dislike_button" + ), + new ByteArrayFilterGroup( + Settings.HIDE_SHORTS_COMMENTS_BUTTON, + "reel_comment_button" + ), + new ByteArrayFilterGroup( + Settings.HIDE_SHORTS_SHARE_BUTTON, + "reel_share_button" + ), + new ByteArrayFilterGroup( + Settings.HIDE_SHORTS_REMIX_BUTTON, + "reel_remix_button" + ) ); // From f68b0feb7cdfe5e915398d8edbdc7050669efcbd Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sat, 13 Apr 2024 02:44:49 +0400 Subject: [PATCH 3/7] fix: Hide like/dislike button and do not hide all action buttons --- .../youtube/patches/components/ShortsFilter.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 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 c30fa03887..5215978414 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 @@ -139,13 +139,17 @@ public ShortsFilter() { // Action buttons // videoActionButtonGroupList.addAll( + // This also appears as the path item 'shorts_like_button.eml' new ByteArrayFilterGroup( Settings.HIDE_SHORTS_LIKE_BUTTON, - "shorts_like_button" + "reel_like_button", + "reel_like_toggled_button" ), + // This also appears as the path item 'shorts_dislike_button.eml' new ByteArrayFilterGroup( Settings.HIDE_SHORTS_DISLIKE_BUTTON, - "shorts_dislike_button" + "reel_dislike_button", + "reel_dislike_toggled_button" ), new ByteArrayFilterGroup( Settings.HIDE_SHORTS_COMMENTS_BUTTON, From bd1d5ac64b24272282574ba1e14d3d172cf2dd91 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sat, 13 Apr 2024 16:08:37 +0400 Subject: [PATCH 4/7] feat(YouTube - Hide Shorts components): Hide search suggestions --- .../youtube/patches/components/ShortsFilter.java | 6 ++++++ .../revanced/integrations/youtube/settings/Settings.java | 1 + 2 files changed, 7 insertions(+) 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 5215978414..7c04c513f5 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 @@ -175,6 +175,8 @@ public ShortsFilter() { ), new ByteArrayFilterGroup( Settings.HIDE_SHORTS_TAGGED_PRODUCTS, + // Product buttons show pictures of the products, and does not have any unique icons to identify. + // Instead use a unique identifier found in the buffer. "PAproduct_listZ" ), new ByteArrayFilterGroup( @@ -184,6 +186,10 @@ public ShortsFilter() { new ByteArrayFilterGroup( Settings.HIDE_SHORTS_SAVE_SOUND_BUTTON, "yt_outline_list_add_" + ), + new ByteArrayFilterGroup( + Settings.HIDE_SHORTS_SEARCH_SUGGESTIONS, + "yt_outline_search_" ) ); } diff --git a/app/src/main/java/app/revanced/integrations/youtube/settings/Settings.java b/app/src/main/java/app/revanced/integrations/youtube/settings/Settings.java index c780ccd171..bb92c9f232 100644 --- a/app/src/main/java/app/revanced/integrations/youtube/settings/Settings.java +++ b/app/src/main/java/app/revanced/integrations/youtube/settings/Settings.java @@ -163,6 +163,7 @@ public class Settings extends BaseSettings { public static final BooleanSetting HIDE_SHORTS_TAGGED_PRODUCTS = new BooleanSetting("revanced_hide_shorts_tagged_products", TRUE); public static final BooleanSetting HIDE_SHORTS_LOCATION_BUTTON = new BooleanSetting("revanced_hide_shorts_location_button", FALSE); public static final BooleanSetting HIDE_SHORTS_SAVE_SOUND_BUTTON = new BooleanSetting("revanced_hide_shorts_save_sound_button", FALSE); + public static final BooleanSetting HIDE_SHORTS_SEARCH_SUGGESTIONS = new BooleanSetting("revanced_hide_shorts_search_suggestions", FALSE); public static final BooleanSetting HIDE_SHORTS_LIKE_BUTTON = new BooleanSetting("revanced_hide_shorts_like_button", FALSE); public static final BooleanSetting HIDE_SHORTS_DISLIKE_BUTTON = new BooleanSetting("revanced_hide_shorts_dislike_button", FALSE); public static final BooleanSetting HIDE_SHORTS_COMMENTS_BUTTON = new BooleanSetting("revanced_hide_shorts_comments_button", FALSE); From 958f7d7aa27e185b97c773fbe3db9c5bbe304612 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sat, 13 Apr 2024 18:48:46 +0400 Subject: [PATCH 5/7] refactor: Simplify --- .../patches/components/ShortsFilter.java | 82 ++++++++----------- 1 file changed, 32 insertions(+), 50 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 7c04c513f5..9f1ac722f5 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 @@ -22,14 +22,7 @@ public final class ShortsFilter extends Filter { private final StringFilterGroup shortsCompactFeedVideoPath; private final ByteArrayFilterGroup shortsCompactFeedVideoBuffer; - private final StringFilterGroup channelBar; - private final StringFilterGroup fullVideoLinkLabel; - private final StringFilterGroup videoTitle; - private final StringFilterGroup reelSoundMetadata; private final StringFilterGroup subscribeButton; - private final StringFilterGroup subscribeButtonPaused; - private final StringFilterGroup soundButton; - private final StringFilterGroup infoPanel; private final StringFilterGroup joinButton; private final StringFilterGroup shelfHeader; @@ -44,7 +37,7 @@ public ShortsFilter() { // Identifier components. // - var shorts = new StringFilterGroup( + var shortsIdentifiers = new StringFilterGroup( null, // Setting is based on navigation state. "shorts_shelf", "inline_shorts", @@ -52,6 +45,7 @@ public ShortsFilter() { "shorts_video_cell", "shorts_pivot_item" ); + // Feed Shorts shelf header. // Use a different filter group for this pattern, as it requires an additional check after matching. shelfHeader = new StringFilterGroup( @@ -59,7 +53,7 @@ public ShortsFilter() { "shelf_header.eml" ); - addIdentifierCallbacks(shorts, shelfHeader); + addIdentifierCallbacks(shortsIdentifiers, shelfHeader); // // Path components. @@ -73,51 +67,51 @@ public ShortsFilter() { shortsCompactFeedVideoBuffer = new ByteArrayFilterGroup(null, "/frame0.jpg"); // Shorts player components. - joinButton = new StringFilterGroup( - Settings.HIDE_SHORTS_JOIN_BUTTON, - "sponsor_button" - ); - - subscribeButton = new StringFilterGroup( - Settings.HIDE_SHORTS_SUBSCRIBE_BUTTON, - "subscribe_button" - ); - - subscribeButtonPaused = new StringFilterGroup( + StringFilterGroup subscribeButtonPaused = new StringFilterGroup( Settings.HIDE_SHORTS_SUBSCRIBE_BUTTON_PAUSED, "shorts_paused_state" ); - channelBar = new StringFilterGroup( + StringFilterGroup channelBar = new StringFilterGroup( Settings.HIDE_SHORTS_CHANNEL_BAR, REEL_CHANNEL_BAR_PATH ); - fullVideoLinkLabel = new StringFilterGroup( + StringFilterGroup fullVideoLinkLabel = new StringFilterGroup( Settings.HIDE_SHORTS_FULL_VIDEO_LINK_LABEL, "reel_multi_format_link" ); - videoTitle = new StringFilterGroup( + StringFilterGroup videoTitle = new StringFilterGroup( Settings.HIDE_SHORTS_VIDEO_TITLE, "shorts_video_title_item" ); - reelSoundMetadata = new StringFilterGroup( + StringFilterGroup reelSoundMetadata = new StringFilterGroup( Settings.HIDE_SHORTS_SOUND_METADATA_LABEL, "reel_sound_metadata" ); - soundButton = new StringFilterGroup( + StringFilterGroup soundButton = new StringFilterGroup( Settings.HIDE_SHORTS_SOUND_BUTTON, "reel_pivot_button" ); - infoPanel = new StringFilterGroup( + StringFilterGroup infoPanel = new StringFilterGroup( Settings.HIDE_SHORTS_INFO_PANEL, "shorts_info_panel_overview" ); + joinButton = new StringFilterGroup( + Settings.HIDE_SHORTS_JOIN_BUTTON, + "sponsor_button" + ); + + subscribeButton = new StringFilterGroup( + Settings.HIDE_SHORTS_SUBSCRIBE_BUTTON, + "subscribe_button" + ); + actionBar = new StringFilterGroup( null, "shorts_action_bar" @@ -129,10 +123,9 @@ public ShortsFilter() { ); addPathCallbacks( - shortsCompactFeedVideoPath, - joinButton, subscribeButton, subscribeButtonPaused, suggestedAction, - channelBar, fullVideoLinkLabel, videoTitle, reelSoundMetadata, - soundButton, infoPanel, actionBar + shortsCompactFeedVideoPath, suggestedAction, actionBar, joinButton, subscribeButton, + subscribeButtonPaused, channelBar, fullVideoLinkLabel, videoTitle, reelSoundMetadata, + soundButton, infoPanel ); // @@ -198,24 +191,6 @@ public ShortsFilter() { boolean isFiltered(@Nullable String identifier, String path, byte[] protobufBufferArray, StringFilterGroup matchedGroup, FilterContentType contentType, int contentIndex) { if (contentType == FilterContentType.PATH) { - // Always filter if matched. - if (matchedGroup == soundButton || - matchedGroup == infoPanel || - matchedGroup == channelBar || - matchedGroup == fullVideoLinkLabel || - matchedGroup == videoTitle || - matchedGroup == reelSoundMetadata || - matchedGroup == subscribeButtonPaused - ) return super.isFiltered(identifier, path, protobufBufferArray, matchedGroup, contentType, contentIndex); - - if (matchedGroup == shortsCompactFeedVideoPath) { - if (shouldHideShortsFeedItems() && contentIndex == 0 - && shortsCompactFeedVideoBuffer.check(protobufBufferArray).isFiltered()) { - return super.isFiltered(identifier, path, protobufBufferArray, matchedGroup, contentType, contentIndex); - } - return false; - } - if (matchedGroup == subscribeButton || matchedGroup == joinButton) { // Filter only when reelChannelBar is visible to avoid false positives. if (path.startsWith(REEL_CHANNEL_BAR_PATH)) { @@ -226,6 +201,14 @@ boolean isFiltered(@Nullable String identifier, String path, byte[] protobufBuff return false; } + if (matchedGroup == shortsCompactFeedVideoPath) { + if (shouldHideShortsFeedItems() && contentIndex == 0 + && shortsCompactFeedVideoBuffer.check(protobufBufferArray).isFiltered()) { + return super.isFiltered(identifier, path, protobufBufferArray, matchedGroup, contentType, contentIndex); + } + return false; + } + // Video action buttons (like, dislike, comment, share, remix) have the same path. if (matchedGroup == actionBar) { if (videoActionButtonGroupList.check(protobufBufferArray).isFiltered()) { @@ -242,10 +225,9 @@ boolean isFiltered(@Nullable String identifier, String path, byte[] protobufBuff identifier, path, protobufBufferArray, matchedGroup, contentType, contentIndex ); } - // else, return false; + return false; } - return false; } else { // Feed/search identifier components. if (matchedGroup == shelfHeader) { From 149289f38d7d83edcd84e634e0539c1999f0d5ab Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sun, 14 Apr 2024 11:49:14 +0400 Subject: [PATCH 6/7] refactor: Simplify --- .../integrations/youtube/patches/components/ShortsFilter.java | 2 +- .../app/revanced/integrations/youtube/settings/Settings.java | 2 +- 2 files changed, 2 insertions(+), 2 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 9f1ac722f5..bd37043271 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 @@ -173,7 +173,7 @@ public ShortsFilter() { "PAproduct_listZ" ), new ByteArrayFilterGroup( - Settings.HIDE_SHORTS_LOCATION_BUTTON, + Settings.HIDE_SHORTS_LOCATION_LABEL, "yt_outline_location_point_" ), new ByteArrayFilterGroup( diff --git a/app/src/main/java/app/revanced/integrations/youtube/settings/Settings.java b/app/src/main/java/app/revanced/integrations/youtube/settings/Settings.java index bb92c9f232..17ba65e924 100644 --- a/app/src/main/java/app/revanced/integrations/youtube/settings/Settings.java +++ b/app/src/main/java/app/revanced/integrations/youtube/settings/Settings.java @@ -161,7 +161,7 @@ public class Settings extends BaseSettings { public static final BooleanSetting HIDE_SHORTS_SUBSCRIBE_BUTTON_PAUSED = new BooleanSetting("revanced_hide_shorts_subscribe_button_paused", FALSE); public static final BooleanSetting HIDE_SHORTS_SHOP_BUTTON = new BooleanSetting("revanced_hide_shorts_shop_button", TRUE); public static final BooleanSetting HIDE_SHORTS_TAGGED_PRODUCTS = new BooleanSetting("revanced_hide_shorts_tagged_products", TRUE); - public static final BooleanSetting HIDE_SHORTS_LOCATION_BUTTON = new BooleanSetting("revanced_hide_shorts_location_button", FALSE); + public static final BooleanSetting HIDE_SHORTS_LOCATION_LABEL = new BooleanSetting("revanced_hide_shorts_location_label", FALSE); public static final BooleanSetting HIDE_SHORTS_SAVE_SOUND_BUTTON = new BooleanSetting("revanced_hide_shorts_save_sound_button", FALSE); public static final BooleanSetting HIDE_SHORTS_SEARCH_SUGGESTIONS = new BooleanSetting("revanced_hide_shorts_search_suggestions", FALSE); public static final BooleanSetting HIDE_SHORTS_LIKE_BUTTON = new BooleanSetting("revanced_hide_shorts_like_button", FALSE); From 75a50109bcb200ba61ee84f36a84df3bac268ca6 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sun, 14 Apr 2024 17:25:24 +0400 Subject: [PATCH 7/7] fix: rename `Hide subscribe button when paused` --- .../youtube/patches/components/ShortsFilter.java | 6 +++--- .../revanced/integrations/youtube/settings/Settings.java | 2 +- 2 files changed, 4 insertions(+), 4 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 bd37043271..cbe254aa86 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 @@ -67,8 +67,8 @@ public ShortsFilter() { shortsCompactFeedVideoBuffer = new ByteArrayFilterGroup(null, "/frame0.jpg"); // Shorts player components. - StringFilterGroup subscribeButtonPaused = new StringFilterGroup( - Settings.HIDE_SHORTS_SUBSCRIBE_BUTTON_PAUSED, + StringFilterGroup pausedOverlayButtons = new StringFilterGroup( + Settings.HIDE_SHORTS_PAUSED_OVERLAY_BUTTONS, "shorts_paused_state" ); @@ -124,7 +124,7 @@ public ShortsFilter() { addPathCallbacks( shortsCompactFeedVideoPath, suggestedAction, actionBar, joinButton, subscribeButton, - subscribeButtonPaused, channelBar, fullVideoLinkLabel, videoTitle, reelSoundMetadata, + pausedOverlayButtons, channelBar, fullVideoLinkLabel, videoTitle, reelSoundMetadata, soundButton, infoPanel ); diff --git a/app/src/main/java/app/revanced/integrations/youtube/settings/Settings.java b/app/src/main/java/app/revanced/integrations/youtube/settings/Settings.java index eb4b736c17..f7432af5c9 100644 --- a/app/src/main/java/app/revanced/integrations/youtube/settings/Settings.java +++ b/app/src/main/java/app/revanced/integrations/youtube/settings/Settings.java @@ -159,7 +159,7 @@ public class Settings extends BaseSettings { public static final BooleanSetting HIDE_SHORTS_SEARCH = new BooleanSetting("revanced_hide_shorts_search", FALSE); public static final BooleanSetting HIDE_SHORTS_JOIN_BUTTON = new BooleanSetting("revanced_hide_shorts_join_button", TRUE); public static final BooleanSetting HIDE_SHORTS_SUBSCRIBE_BUTTON = new BooleanSetting("revanced_hide_shorts_subscribe_button", TRUE); - public static final BooleanSetting HIDE_SHORTS_SUBSCRIBE_BUTTON_PAUSED = new BooleanSetting("revanced_hide_shorts_subscribe_button_paused", FALSE); + public static final BooleanSetting HIDE_SHORTS_PAUSED_OVERLAY_BUTTONS = new BooleanSetting("revanced_hide_shorts_paused_overlay_buttons", FALSE); public static final BooleanSetting HIDE_SHORTS_SHOP_BUTTON = new BooleanSetting("revanced_hide_shorts_shop_button", TRUE); public static final BooleanSetting HIDE_SHORTS_TAGGED_PRODUCTS = new BooleanSetting("revanced_hide_shorts_tagged_products", TRUE); public static final BooleanSetting HIDE_SHORTS_LOCATION_LABEL = new BooleanSetting("revanced_hide_shorts_location_label", FALSE);