From d6cd550880596de5cd2eb4a0d1325a73326d4af9 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sun, 14 Apr 2024 02:06:41 +0200 Subject: [PATCH 01/12] feat(YouTube - Hide layout components): Hide playables --- .../youtube/patches/components/LayoutComponentsFilter.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/LayoutComponentsFilter.java b/app/src/main/java/app/revanced/integrations/youtube/patches/components/LayoutComponentsFilter.java index f0e560e4..a0adedde 100644 --- a/app/src/main/java/app/revanced/integrations/youtube/patches/components/LayoutComponentsFilter.java +++ b/app/src/main/java/app/revanced/integrations/youtube/patches/components/LayoutComponentsFilter.java @@ -177,6 +177,11 @@ public final class LayoutComponentsFilter extends Filter { "fullscreen_related_videos" ); + final var playables = new StringFilterGroup( + Settings.HIDE_PLAYABLES, + "horizontal_gaming_shelf.eml" + ); + final var quickActions = new StringFilterGroup( Settings.HIDE_QUICK_ACTIONS, "quick_actions" @@ -256,6 +261,7 @@ public final class LayoutComponentsFilter extends Filter { latestPosts, channelWatermark, communityGuidelines, + playables, quickActions, relatedVideos, compactBanner, 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 ed90f89d..2e3a3801 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 @@ -117,6 +117,7 @@ public class Settings extends BaseSettings { public static final BooleanSetting HIDE_NOTIFY_ME_BUTTON = new BooleanSetting("revanced_hide_notify_me_button", TRUE); public static final BooleanSetting HIDE_PLAYER_BUTTONS = new BooleanSetting("revanced_hide_player_buttons", FALSE); public static final BooleanSetting HIDE_PREVIEW_COMMENT = new BooleanSetting("revanced_hide_preview_comment", FALSE, true); + public static final BooleanSetting HIDE_PLAYABLES = new BooleanSetting("revanced_hide_quick_actions", TRUE); public static final BooleanSetting HIDE_QUICK_ACTIONS = new BooleanSetting("revanced_hide_quick_actions", FALSE); public static final BooleanSetting HIDE_RELATED_VIDEOS = new BooleanSetting("revanced_hide_related_videos", FALSE); public static final BooleanSetting HIDE_SEARCH_RESULT_SHELF_HEADER = new BooleanSetting("revanced_hide_search_result_shelf_header", FALSE); From 96f42b3892256bc9c80306e9c1991a29f2eb7a5e Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Sun, 14 Apr 2024 00:10:19 +0000 Subject: [PATCH 02/12] chore(release): 1.8.0-dev.8 [skip ci] # [1.8.0-dev.8](https://github.com/ReVanced/revanced-integrations/compare/v1.8.0-dev.7...v1.8.0-dev.8) (2024-04-14) ### Features * **YouTube - Hide layout components:** Hide playables ([d6cd550](https://github.com/ReVanced/revanced-integrations/commit/d6cd550880596de5cd2eb4a0d1325a73326d4af9)) --- CHANGELOG.md | 7 +++++++ gradle.properties | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2bcbf968..45953416 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [1.8.0-dev.8](https://github.com/ReVanced/revanced-integrations/compare/v1.8.0-dev.7...v1.8.0-dev.8) (2024-04-14) + + +### Features + +* **YouTube - Hide layout components:** Hide playables ([d6cd550](https://github.com/ReVanced/revanced-integrations/commit/d6cd550880596de5cd2eb4a0d1325a73326d4af9)) + # [1.8.0-dev.7](https://github.com/ReVanced/revanced-integrations/compare/v1.8.0-dev.6...v1.8.0-dev.7) (2024-04-12) diff --git a/gradle.properties b/gradle.properties index 3786b15f..95fdd24d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ org.gradle.parallel = true org.gradle.caching = true android.useAndroidX = true -version = 1.8.0-dev.7 +version = 1.8.0-dev.8 From a2b15433cffec082394a50d14f7eef625a6351c1 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sun, 14 Apr 2024 13:30:41 +0400 Subject: [PATCH 03/12] fix: Use correct hide playables setting key --- .../app/revanced/integrations/youtube/settings/Settings.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 2e3a3801..d6617681 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 @@ -117,7 +117,7 @@ public class Settings extends BaseSettings { public static final BooleanSetting HIDE_NOTIFY_ME_BUTTON = new BooleanSetting("revanced_hide_notify_me_button", TRUE); public static final BooleanSetting HIDE_PLAYER_BUTTONS = new BooleanSetting("revanced_hide_player_buttons", FALSE); public static final BooleanSetting HIDE_PREVIEW_COMMENT = new BooleanSetting("revanced_hide_preview_comment", FALSE, true); - public static final BooleanSetting HIDE_PLAYABLES = new BooleanSetting("revanced_hide_quick_actions", TRUE); + public static final BooleanSetting HIDE_PLAYABLES = new BooleanSetting("revanced_hide_playables", TRUE); public static final BooleanSetting HIDE_QUICK_ACTIONS = new BooleanSetting("revanced_hide_quick_actions", FALSE); public static final BooleanSetting HIDE_RELATED_VIDEOS = new BooleanSetting("revanced_hide_related_videos", FALSE); public static final BooleanSetting HIDE_SEARCH_RESULT_SHELF_HEADER = new BooleanSetting("revanced_hide_search_result_shelf_header", FALSE); From 79a3a44961d211dcc9832921e6168fb9166524f5 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Sun, 14 Apr 2024 09:33:39 +0000 Subject: [PATCH 04/12] chore(release): 1.8.0-dev.9 [skip ci] # [1.8.0-dev.9](https://github.com/ReVanced/revanced-integrations/compare/v1.8.0-dev.8...v1.8.0-dev.9) (2024-04-14) ### Bug Fixes * Use correct hide playables setting key ([a2b1543](https://github.com/ReVanced/revanced-integrations/commit/a2b15433cffec082394a50d14f7eef625a6351c1)) --- CHANGELOG.md | 7 +++++++ gradle.properties | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 45953416..5c2cd0e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [1.8.0-dev.9](https://github.com/ReVanced/revanced-integrations/compare/v1.8.0-dev.8...v1.8.0-dev.9) (2024-04-14) + + +### Bug Fixes + +* Use correct hide playables setting key ([a2b1543](https://github.com/ReVanced/revanced-integrations/commit/a2b15433cffec082394a50d14f7eef625a6351c1)) + # [1.8.0-dev.8](https://github.com/ReVanced/revanced-integrations/compare/v1.8.0-dev.7...v1.8.0-dev.8) (2024-04-14) diff --git a/gradle.properties b/gradle.properties index 95fdd24d..8539044b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ org.gradle.parallel = true org.gradle.caching = true android.useAndroidX = true -version = 1.8.0-dev.8 +version = 1.8.0-dev.9 From 0586fb70e347c25742e03102441cfb37315b5937 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sun, 14 Apr 2024 18:53:48 +0400 Subject: [PATCH 05/12] feat(YouTube - Hide Shorts components): Hide tagged products, hide search suggestions (#615) --- .../shared/settings/EnumSetting.java | 4 +- .../preference/SharedPrefCategory.java | 4 +- .../patches/components/ShortsFilter.java | 219 ++++++++---------- .../youtube/settings/Settings.java | 7 +- 4 files changed, 110 insertions(+), 124 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 20ef4821..a6301def 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 @@ import java.util.Objects; * 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 @@ public class EnumSetting extends Setting { @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 9c7fa45c..ddbc31cb 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 class SharedPrefCategory { /** * @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 class SharedPrefCategory { } @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 05835b50..cbe254aa 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,19 +22,12 @@ 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; - 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(); @@ -44,7 +37,7 @@ public final class ShortsFilter extends Filter { // 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 final class ShortsFilter extends Filter { "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,14 +53,7 @@ public final class ShortsFilter extends Filter { "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(shortsIdentifiers, shelfHeader); // // Path components. @@ -80,6 +67,41 @@ public final class ShortsFilter extends Filter { shortsCompactFeedVideoBuffer = new ByteArrayFilterGroup(null, "/frame0.jpg"); // Shorts player components. + StringFilterGroup pausedOverlayButtons = new StringFilterGroup( + Settings.HIDE_SHORTS_PAUSED_OVERLAY_BUTTONS, + "shorts_paused_state" + ); + + StringFilterGroup channelBar = new StringFilterGroup( + Settings.HIDE_SHORTS_CHANNEL_BAR, + REEL_CHANNEL_BAR_PATH + ); + + StringFilterGroup fullVideoLinkLabel = new StringFilterGroup( + Settings.HIDE_SHORTS_FULL_VIDEO_LINK_LABEL, + "reel_multi_format_link" + ); + + StringFilterGroup videoTitle = new StringFilterGroup( + Settings.HIDE_SHORTS_VIDEO_TITLE, + "shorts_video_title_item" + ); + + StringFilterGroup reelSoundMetadata = new StringFilterGroup( + Settings.HIDE_SHORTS_SOUND_METADATA_LABEL, + "reel_sound_metadata" + ); + + StringFilterGroup soundButton = new StringFilterGroup( + Settings.HIDE_SHORTS_SOUND_BUTTON, + "reel_pivot_button" + ); + + StringFilterGroup infoPanel = new StringFilterGroup( + Settings.HIDE_SHORTS_INFO_PANEL, + "shorts_info_panel_overview" + ); + joinButton = new StringFilterGroup( Settings.HIDE_SHORTS_JOIN_BUTTON, "sponsor_button" @@ -90,109 +112,77 @@ public final class ShortsFilter extends Filter { "subscribe_button" ); - subscribeButtonPaused = new StringFilterGroup( - Settings.HIDE_SHORTS_SUBSCRIBE_BUTTON_PAUSED, - "shorts_paused_state" - ); - - channelBar = new StringFilterGroup( - Settings.HIDE_SHORTS_CHANNEL_BAR, - REEL_CHANNEL_BAR_PATH - ); - - fullVideoLinkLabel = new StringFilterGroup( - Settings.HIDE_SHORTS_FULL_VIDEO_LINK_LABEL, - "reel_multi_format_link" - ); - - videoTitle = new StringFilterGroup( - Settings.HIDE_SHORTS_VIDEO_TITLE, - "shorts_video_title_item" - ); - - reelSoundMetadata = new StringFilterGroup( - Settings.HIDE_SHORTS_SOUND_METADATA_LABEL, - "reel_sound_metadata" - ); - - soundButton = new StringFilterGroup( - Settings.HIDE_SHORTS_SOUND_BUTTON, - "reel_pivot_button" - ); - - infoPanel = new StringFilterGroup( - Settings.HIDE_SHORTS_INFO_PANEL, - "shorts_info_panel_overview" - ); - actionBar = new StringFilterGroup( null, "shorts_action_bar" ); - suggestedActionPath = new StringFilterGroup( + suggestedAction = new StringFilterGroup( null, "suggested_action.eml" ); addPathCallbacks( - shortsCompactFeedVideoPath, - joinButton, subscribeButton, subscribeButtonPaused, suggestedActionPath, - channelBar, fullVideoLinkLabel, videoTitle, reelSoundMetadata, - soundButton, infoPanel, actionBar + shortsCompactFeedVideoPath, suggestedAction, actionBar, joinButton, subscribeButton, + pausedOverlayButtons, channelBar, fullVideoLinkLabel, videoTitle, reelSoundMetadata, + soundButton, infoPanel ); // // 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 + // This also appears as the path item 'shorts_like_button.eml' + new ByteArrayFilterGroup( + Settings.HIDE_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, + "reel_dislike_button", + "reel_dislike_toggled_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" + ) ); // // Suggested actions. // - suggestedActions.addAll( + suggestedActionsGroupList.addAll( new ByteArrayFilterGroup( Settings.HIDE_SHORTS_SHOP_BUTTON, "yt_outline_bag_" ), new ByteArrayFilterGroup( - Settings.HIDE_SHORTS_LOCATION_BUTTON, + 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( + Settings.HIDE_SHORTS_LOCATION_LABEL, "yt_outline_location_point_" ), new ByteArrayFilterGroup( Settings.HIDE_SHORTS_SAVE_SOUND_BUTTON, "yt_outline_list_add_" + ), + new ByteArrayFilterGroup( + Settings.HIDE_SHORTS_SEARCH_SUGGESTIONS, + "yt_outline_search_" ) ); } @@ -201,15 +191,15 @@ public final class ShortsFilter extends Filter { 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 == 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 + ); + } + return false; + } if (matchedGroup == shortsCompactFeedVideoPath) { if (shouldHideShortsFeedItems() && contentIndex == 0 @@ -219,32 +209,27 @@ public final class ShortsFilter extends Filter { return false; } - 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 - ); - 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 - ); - // else, return false; + if (matchedGroup == suggestedAction) { + if (contentIndex == 0 && suggestedActionsGroupList.check(protobufBufferArray).isFiltered()) { + return super.isFiltered( + identifier, path, protobufBufferArray, matchedGroup, contentType, contentIndex + ); + } + 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 d6617681..f7432af5 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,11 +159,12 @@ 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_THANKS_BUTTON = new BooleanSetting("revanced_hide_shorts_thanks_button", TRUE); + 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_LOCATION_BUTTON = new BooleanSetting("revanced_hide_shorts_location_button", FALSE); + 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); 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 e9cd8986516a5c388a9755c34d1b7e594f987cf9 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Sun, 14 Apr 2024 14:57:08 +0000 Subject: [PATCH 06/12] chore(release): 1.8.0-dev.10 [skip ci] # [1.8.0-dev.10](https://github.com/ReVanced/revanced-integrations/compare/v1.8.0-dev.9...v1.8.0-dev.10) (2024-04-14) ### Features * **YouTube - Hide Shorts components:** Hide tagged products, hide search suggestions ([#615](https://github.com/ReVanced/revanced-integrations/issues/615)) ([0586fb7](https://github.com/ReVanced/revanced-integrations/commit/0586fb70e347c25742e03102441cfb37315b5937)) --- CHANGELOG.md | 7 +++++++ gradle.properties | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c2cd0e5..6b0018ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [1.8.0-dev.10](https://github.com/ReVanced/revanced-integrations/compare/v1.8.0-dev.9...v1.8.0-dev.10) (2024-04-14) + + +### Features + +* **YouTube - Hide Shorts components:** Hide tagged products, hide search suggestions ([#615](https://github.com/ReVanced/revanced-integrations/issues/615)) ([0586fb7](https://github.com/ReVanced/revanced-integrations/commit/0586fb70e347c25742e03102441cfb37315b5937)) + # [1.8.0-dev.9](https://github.com/ReVanced/revanced-integrations/compare/v1.8.0-dev.8...v1.8.0-dev.9) (2024-04-14) diff --git a/gradle.properties b/gradle.properties index 8539044b..26dac1ae 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ org.gradle.parallel = true org.gradle.caching = true android.useAndroidX = true -version = 1.8.0-dev.9 +version = 1.8.0-dev.10 From 9108205445c533550db454731d4f9460a3241a03 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sun, 14 Apr 2024 23:37:17 +0400 Subject: [PATCH 07/12] fix(YouTube - Return YouTube Dislike): Do not show error toast if API success response contains new lines (#612) --- .../requests/ReturnYouTubeDislikeApi.java | 33 ++++++++----------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/app/src/main/java/app/revanced/integrations/youtube/returnyoutubedislike/requests/ReturnYouTubeDislikeApi.java b/app/src/main/java/app/revanced/integrations/youtube/returnyoutubedislike/requests/ReturnYouTubeDislikeApi.java index 73db5f00..9b22aafc 100644 --- a/app/src/main/java/app/revanced/integrations/youtube/returnyoutubedislike/requests/ReturnYouTubeDislikeApi.java +++ b/app/src/main/java/app/revanced/integrations/youtube/returnyoutubedislike/requests/ReturnYouTubeDislikeApi.java @@ -279,7 +279,7 @@ public class ReturnYouTubeDislikeApi { } if (responseCode == HTTP_STATUS_CODE_SUCCESS) { - // do not disconnect, the same server connection will likely be used again soon + // Do not disconnect, the same server connection will likely be used again soon. JSONObject json = Requester.parseJSONObject(connection); try { RYDVoteData votingData = new RYDVoteData(json); @@ -377,20 +377,17 @@ public class ReturnYouTubeDislikeApi { connection.disconnect(); // disconnect, as no more connections will be made for a little while return null; } - String result = null; if (responseCode == HTTP_STATUS_CODE_SUCCESS) { - result = Requester.parseJson(connection); - if (result.equalsIgnoreCase("true")) { - Logger.printDebug(() -> "Registration confirmation successful"); - return userId; - } + Logger.printDebug(() -> "Registration confirmation successful"); + return userId; } - final String resultLog = result == null ? "(no response)" : result; + + // Something went wrong, might as well disconnect. + String response = Requester.parseJsonAndDisconnect(connection); Logger.printInfo(() -> "Failed to confirm registration for user: " + userId - + " solution: " + solution + " responseCode: " + responseCode + " responseString: " + resultLog); + + " solution: " + solution + " responseCode: " + responseCode + " response: '" + response + "''"); handleConnectionError(str("revanced_ryd_failure_connection_status_code", responseCode), null, true); - connection.disconnect(); // something went wrong, might as well disconnect } catch (SocketTimeoutException ex) { handleConnectionError(str("revanced_ryd_failure_connection_timeout"), ex, false); } catch (IOException ex) { @@ -461,6 +458,7 @@ public class ReturnYouTubeDislikeApi { String solution = solvePuzzle(challenge, difficulty); return confirmVote(videoId, userId, solution); } + Logger.printInfo(() -> "Failed to send vote for video: " + videoId + " vote: " + vote + " response code was: " + responseCode); handleConnectionError(str("revanced_ryd_failure_connection_status_code", responseCode), @@ -501,20 +499,17 @@ public class ReturnYouTubeDislikeApi { connection.disconnect(); // disconnect, as no more connections will be made for a little while return false; } - String result = null; if (responseCode == HTTP_STATUS_CODE_SUCCESS) { - result = Requester.parseJson(connection); - if (result.equalsIgnoreCase("true")) { - Logger.printDebug(() -> "Vote confirm successful for video: " + videoId); - return true; - } + Logger.printDebug(() -> "Vote confirm successful for video: " + videoId); + return true; } - final String resultLog = result == null ? "(no response)" : result; + + // Something went wrong, might as well disconnect. + String response = Requester.parseJsonAndDisconnect(connection); Logger.printInfo(() -> "Failed to confirm vote for video: " + videoId - + " solution: " + solution + " responseCode: " + responseCode + " responseString: " + resultLog); + + " solution: " + solution + " responseCode: " + responseCode + " response: '" + response + "'"); handleConnectionError(str("revanced_ryd_failure_connection_status_code", responseCode), null, true); - connection.disconnect(); // something went wrong, might as well disconnect } catch (SocketTimeoutException ex) { handleConnectionError(str("revanced_ryd_failure_connection_timeout"), ex, false); } catch (IOException ex) { From 92c591735a10da31b30620bd9a6d30f0a85e2b15 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Sun, 14 Apr 2024 19:40:10 +0000 Subject: [PATCH 08/12] chore(release): 1.8.0-dev.11 [skip ci] # [1.8.0-dev.11](https://github.com/ReVanced/revanced-integrations/compare/v1.8.0-dev.10...v1.8.0-dev.11) (2024-04-14) ### Bug Fixes * **YouTube - Return YouTube Dislike:** Do not show error toast if API success response contains new lines ([#612](https://github.com/ReVanced/revanced-integrations/issues/612)) ([9108205](https://github.com/ReVanced/revanced-integrations/commit/9108205445c533550db454731d4f9460a3241a03)) --- CHANGELOG.md | 7 +++++++ gradle.properties | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b0018ae..afcdb064 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [1.8.0-dev.11](https://github.com/ReVanced/revanced-integrations/compare/v1.8.0-dev.10...v1.8.0-dev.11) (2024-04-14) + + +### Bug Fixes + +* **YouTube - Return YouTube Dislike:** Do not show error toast if API success response contains new lines ([#612](https://github.com/ReVanced/revanced-integrations/issues/612)) ([9108205](https://github.com/ReVanced/revanced-integrations/commit/9108205445c533550db454731d4f9460a3241a03)) + # [1.8.0-dev.10](https://github.com/ReVanced/revanced-integrations/compare/v1.8.0-dev.9...v1.8.0-dev.10) (2024-04-14) diff --git a/gradle.properties b/gradle.properties index 26dac1ae..4eb0f747 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ org.gradle.parallel = true org.gradle.caching = true android.useAndroidX = true -version = 1.8.0-dev.10 +version = 1.8.0-dev.11 From 13dc17288d13d024a3fbe318ee0fb23a0d46af85 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Mon, 15 Apr 2024 19:18:48 +0400 Subject: [PATCH 09/12] fix(YouTube - Hide ads): rename `Hide paid content` to `Hide paid promotion label` (#616) --- .../youtube/patches/components/LayoutComponentsFilter.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/LayoutComponentsFilter.java b/app/src/main/java/app/revanced/integrations/youtube/patches/components/LayoutComponentsFilter.java index a0adedde..0f69f546 100644 --- a/app/src/main/java/app/revanced/integrations/youtube/patches/components/LayoutComponentsFilter.java +++ b/app/src/main/java/app/revanced/integrations/youtube/patches/components/LayoutComponentsFilter.java @@ -113,8 +113,8 @@ public final class LayoutComponentsFilter extends Filter { "medical_panel" ); - final var paidContent = new StringFilterGroup( - Settings.HIDE_PAID_CONTENT, + final var paidPromotion = new StringFilterGroup( + Settings.HIDE_PAID_PROMOTION_LABEL, "paid_content_overlay" ); @@ -256,7 +256,7 @@ public final class LayoutComponentsFilter extends Filter { notifyMe, channelBar, communityPosts, - paidContent, + paidPromotion, searchResultVideo, latestPosts, channelWatermark, 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 f7432af5..98770fea 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 @@ -49,7 +49,7 @@ public class Settings extends BaseSettings { public static final BooleanSetting HIDE_GET_PREMIUM = new BooleanSetting("revanced_hide_get_premium", TRUE); public static final BooleanSetting HIDE_HIDE_LATEST_POSTS = new BooleanSetting("revanced_hide_latest_posts_ads", TRUE); public static final BooleanSetting HIDE_MERCHANDISE_BANNERS = new BooleanSetting("revanced_hide_merchandise_banners", TRUE); - public static final BooleanSetting HIDE_PAID_CONTENT = new BooleanSetting("revanced_hide_paid_content_ads", TRUE); + public static final BooleanSetting HIDE_PAID_PROMOTION_LABEL = new BooleanSetting("revanced_hide_paid_promotion_label", TRUE); public static final BooleanSetting HIDE_PRODUCTS_BANNER = new BooleanSetting("revanced_hide_products_banner", TRUE); public static final BooleanSetting HIDE_SHOPPING_LINKS = new BooleanSetting("revanced_hide_shopping_links", TRUE); public static final BooleanSetting HIDE_SELF_SPONSOR = new BooleanSetting("revanced_hide_self_sponsor_ads", TRUE); From 8e36a018f459e88987626888c0a16c5b081ac241 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Mon, 15 Apr 2024 15:21:42 +0000 Subject: [PATCH 10/12] chore(release): 1.8.0-dev.12 [skip ci] # [1.8.0-dev.12](https://github.com/ReVanced/revanced-integrations/compare/v1.8.0-dev.11...v1.8.0-dev.12) (2024-04-15) ### Bug Fixes * **YouTube - Hide ads:** rename `Hide paid content` to `Hide paid promotion label` ([#616](https://github.com/ReVanced/revanced-integrations/issues/616)) ([13dc172](https://github.com/ReVanced/revanced-integrations/commit/13dc17288d13d024a3fbe318ee0fb23a0d46af85)) --- CHANGELOG.md | 7 +++++++ gradle.properties | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index afcdb064..61685fc2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [1.8.0-dev.12](https://github.com/ReVanced/revanced-integrations/compare/v1.8.0-dev.11...v1.8.0-dev.12) (2024-04-15) + + +### Bug Fixes + +* **YouTube - Hide ads:** rename `Hide paid content` to `Hide paid promotion label` ([#616](https://github.com/ReVanced/revanced-integrations/issues/616)) ([13dc172](https://github.com/ReVanced/revanced-integrations/commit/13dc17288d13d024a3fbe318ee0fb23a0d46af85)) + # [1.8.0-dev.11](https://github.com/ReVanced/revanced-integrations/compare/v1.8.0-dev.10...v1.8.0-dev.11) (2024-04-14) diff --git a/gradle.properties b/gradle.properties index 4eb0f747..9df66908 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ org.gradle.parallel = true org.gradle.caching = true android.useAndroidX = true -version = 1.8.0-dev.11 +version = 1.8.0-dev.12 From bba421ddb63597bf918ecccacfd4a33493016b9f Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Tue, 16 Apr 2024 06:43:40 +0400 Subject: [PATCH 11/12] fix(YouTube - Hide Shorts components): Hide suggested actions in incognito mode --- .../integrations/youtube/patches/components/ShortsFilter.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 cbe254aa..ad78ac8e 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 @@ -220,7 +220,8 @@ public final class ShortsFilter extends Filter { } if (matchedGroup == suggestedAction) { - if (contentIndex == 0 && suggestedActionsGroupList.check(protobufBufferArray).isFiltered()) { + // Suggested actions can be at the start or in the middle of a path. + if (suggestedActionsGroupList.check(protobufBufferArray).isFiltered()) { return super.isFiltered( identifier, path, protobufBufferArray, matchedGroup, contentType, contentIndex ); From d60dcf98ab0bbc5017bd0226d2424f266439fb2c Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Tue, 16 Apr 2024 02:46:53 +0000 Subject: [PATCH 12/12] chore(release): 1.8.0-dev.13 [skip ci] # [1.8.0-dev.13](https://github.com/ReVanced/revanced-integrations/compare/v1.8.0-dev.12...v1.8.0-dev.13) (2024-04-16) ### Bug Fixes * **YouTube - Hide Shorts components:** Hide suggested actions in incognito mode ([bba421d](https://github.com/ReVanced/revanced-integrations/commit/bba421ddb63597bf918ecccacfd4a33493016b9f)) --- CHANGELOG.md | 7 +++++++ gradle.properties | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 61685fc2..8dc5df47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [1.8.0-dev.13](https://github.com/ReVanced/revanced-integrations/compare/v1.8.0-dev.12...v1.8.0-dev.13) (2024-04-16) + + +### Bug Fixes + +* **YouTube - Hide Shorts components:** Hide suggested actions in incognito mode ([bba421d](https://github.com/ReVanced/revanced-integrations/commit/bba421ddb63597bf918ecccacfd4a33493016b9f)) + # [1.8.0-dev.12](https://github.com/ReVanced/revanced-integrations/compare/v1.8.0-dev.11...v1.8.0-dev.12) (2024-04-15) diff --git a/gradle.properties b/gradle.properties index 9df66908..6e2db839 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ org.gradle.parallel = true org.gradle.caching = true android.useAndroidX = true -version = 1.8.0-dev.12 +version = 1.8.0-dev.13