feat(YouTube - Hide ads): Add Hide end screen store banner (#4351)

This commit is contained in:
ILoveOpenSourceApplications 2025-01-27 14:02:15 +05:30 committed by GitHub
parent 59db22c10d
commit 5505087802
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 65 additions and 39 deletions

View File

@ -27,6 +27,9 @@ public final class AdsFilter extends Filter {
private final StringFilterGroup playerShoppingShelf;
private final ByteArrayFilterGroup playerShoppingShelfBuffer;
private final StringFilterGroup fullscreenOverlay;
private final ByteArrayFilterGroup endScreenStoreBannerBuffer;
private final StringFilterGroup channelProfile;
private final ByteArrayFilterGroup visitStoreButton;
@ -112,11 +115,6 @@ public final class AdsFilter extends Filter {
"expandable_list"
);
channelProfile = new StringFilterGroup(
null,
"channel_profile.eml"
);
playerShoppingShelf = new StringFilterGroup(
null,
"horizontal_shelf.eml"
@ -127,6 +125,21 @@ public final class AdsFilter extends Filter {
"shopping_item_card_list.eml"
);
fullscreenOverlay = new StringFilterGroup(
Settings.HIDE_END_SCREEN_STORE_BANNER,
"fullscreen_overlay.eml"
);
endScreenStoreBannerBuffer = new ByteArrayFilterGroup(
null,
"gstatic.com/shopping"
);
channelProfile = new StringFilterGroup(
null,
"channel_profile.eml"
);
visitStoreButton = new ByteArrayFilterGroup(
Settings.HIDE_VISIT_STORE_BUTTON,
"header_store_button"
@ -154,6 +167,7 @@ public final class AdsFilter extends Filter {
viewProducts,
selfSponsor,
fullscreenAd,
fullscreenOverlay,
channelProfile,
webLinkPanel,
shoppingLinks,
@ -172,6 +186,13 @@ public final class AdsFilter extends Filter {
return false;
}
if (matchedGroup == fullscreenOverlay) {
if (contentIndex == 0 && endScreenStoreBannerBuffer.check(protobufBufferArray).isFiltered()) {
return super.isFiltered(identifier, path, protobufBufferArray, matchedGroup, contentType, contentIndex);
}
return false;
}
if (exceptions.matches(path))
return false;

View File

@ -64,6 +64,7 @@ public class Settings extends BaseSettings {
// Ads
public static final BooleanSetting HIDE_BUTTONED_ADS = new BooleanSetting("revanced_hide_buttoned_ads", TRUE);
public static final BooleanSetting HIDE_END_SCREEN_STORE_BANNER = new BooleanSetting("revanced_hide_end_screen_store_banner", FALSE);
public static final BooleanSetting HIDE_FULLSCREEN_ADS = new BooleanSetting("revanced_hide_fullscreen_ads", TRUE);
public static final BooleanSetting HIDE_GENERAL_ADS = new BooleanSetting("revanced_hide_general_ads", TRUE);
public static final BooleanSetting HIDE_GET_PREMIUM = new BooleanSetting("revanced_hide_get_premium", TRUE);

View File

@ -37,6 +37,7 @@ private val hideAdsResourcePatch = resourcePatch {
PreferenceScreen.ADS.addPreferences(
SwitchPreference("revanced_hide_general_ads"),
SwitchPreference("revanced_hide_end_screen_store_banner"),
SwitchPreference("revanced_hide_fullscreen_ads"),
SwitchPreference("revanced_hide_buttoned_ads"),
SwitchPreference("revanced_hide_paid_promotion_label"),

View File

@ -169,9 +169,9 @@ Tap the continue button and allow optimization changes."</string>
You will not be notified of any unexpected events."</string>
</patch>
<patch id="layout.hide.general.hideLayoutComponentsPatch">
<string name="revanced_disable_like_subscribe_glow_title">Disable like / subscribe button glow</string>
<string name="revanced_disable_like_subscribe_glow_summary_on">Like and subscribe button will not glow when mentioned</string>
<string name="revanced_disable_like_subscribe_glow_summary_off">Like and subscribe button will glow when mentioned</string>
<string name="revanced_disable_like_subscribe_glow_title">Disable Like and Subscribe button glow</string>
<string name="revanced_disable_like_subscribe_glow_summary_on">Like and Subscribe button will not glow when mentioned</string>
<string name="revanced_disable_like_subscribe_glow_summary_off">Like and Subscribe button will glow when mentioned</string>
<string name="revanced_hide_album_cards_title">Hide album cards</string>
<string name="revanced_hide_album_cards_summary_on">Album cards are hidden</string>
<string name="revanced_hide_album_cards_summary_off">Album cards are shown</string>
@ -224,9 +224,9 @@ You will not be notified of any unexpected events."</string>
<string name="revanced_hide_chips_shelf_title">Hide chips shelf</string>
<string name="revanced_hide_chips_shelf_summary_on">Chips shelf is hidden</string>
<string name="revanced_hide_chips_shelf_summary_off">Chips shelf is shown</string>
<string name="revanced_hide_expandable_chip_title">Hide expandable chip under videos</string>
<string name="revanced_hide_expandable_chip_summary_on">Expandable chips are hidden</string>
<string name="revanced_hide_expandable_chip_summary_off">Expandable chips are shown</string>
<string name="revanced_hide_expandable_chip_title">Hide expandable card under videos</string>
<string name="revanced_hide_expandable_chip_summary_on">Expandable cards are hidden</string>
<string name="revanced_hide_expandable_chip_summary_off">Expandable cards are shown</string>
<string name="revanced_hide_community_posts_title">Hide community posts</string>
<string name="revanced_hide_community_posts_summary_on">Community posts are hidden</string>
<string name="revanced_hide_community_posts_summary_off">Community posts are shown</string>
@ -331,7 +331,7 @@ You will not be notified of any unexpected events."</string>
<string name="revanced_hide_comments_preview_comment_title">Hide preview comment</string>
<string name="revanced_hide_comments_preview_comment_summary_on">Preview comment is hidden</string>
<string name="revanced_hide_comments_preview_comment_summary_off">Preview comment is shown</string>
<string name="revanced_hide_comments_thanks_button_title">Hide thanks button</string>
<string name="revanced_hide_comments_thanks_button_title">Hide Thanks button</string>
<string name="revanced_hide_comments_thanks_button_summary_on">Thanks button is hidden</string>
<string name="revanced_hide_comments_thanks_button_summary_off">Thanks button is shown</string>
<string name="revanced_hide_comments_timestamp_and_emoji_buttons_title">Hide timestamp and emoji buttons</string>
@ -360,12 +360,12 @@ If a Doodle is currently showing in your region and this hide setting is on, the
<string name="revanced_hide_keyword_content_home_title">Hide home videos by keywords</string>
<string name="revanced_hide_keyword_content_home_summary_on">Videos in the home tab are filtered by keywords</string>
<string name="revanced_hide_keyword_content_home_summary_off">Videos in the home tab are not filtered by keywords</string>
<string name="revanced_hide_keyword_content_subscriptions_title">Hide subscription videos by keywords</string>
<string name="revanced_hide_keyword_content_subscriptions_summary_on">Videos in the subscriptions tab are filtered by keywords</string>
<string name="revanced_hide_keyword_content_subscriptions_summary_off">Videos in the subscriptions tab are not filtered by keywords</string>
<string name="revanced_hide_keyword_content_search_title">Hide search results by keywords</string>
<string name="revanced_hide_keyword_content_search_summary_on">Search results are filtered by keywords</string>
<string name="revanced_hide_keyword_content_search_summary_off">Search results are not filtered by keywords</string>
<string name="revanced_hide_keyword_content_subscriptions_title">Hide subscription videos by keywords</string>
<string name="revanced_hide_keyword_content_subscriptions_summary_on">Videos in the subscriptions tab are filtered by keywords</string>
<string name="revanced_hide_keyword_content_subscriptions_summary_off">Videos in the subscriptions tab are not filtered by keywords</string>
<string name="revanced_hide_keyword_content_phrases_title">Keywords to hide</string>
<!-- For localization it is preferred, but not required, if 'LeBlanc' is replaced with a localized name or a familiar word that has upper case letters in the middle of the word.
This is because keywords can be in any language, and showing an example in the localized script helps convey this. -->
@ -412,6 +412,9 @@ This feature is only available for older devices"</string>
<string name="revanced_hide_products_banner_title">Hide banner to view products</string>
<string name="revanced_hide_products_banner_summary_on">Banner is hidden</string>
<string name="revanced_hide_products_banner_summary_off">Banner is shown</string>
<string name="revanced_hide_end_screen_store_banner_title">Hide end screen store banner</string>
<string name="revanced_hide_end_screen_store_banner_summary_on">Store banner is hidden</string>
<string name="revanced_hide_end_screen_store_banner_summary_off">Store banner is shown</string>
<string name="revanced_hide_player_store_shelf_title">Hide player shopping shelf</string>
<string name="revanced_hide_player_store_shelf_summary_on">Shopping shelf is hidden</string>
<string name="revanced_hide_player_store_shelf_summary_off">Shopping shelf is shown</string>
@ -464,7 +467,7 @@ This feature is only available for older devices"</string>
<string name="revanced_external_downloader_summary_on">Download button shown in player</string>
<string name="revanced_external_downloader_summary_off">Download button not shown in player</string>
<!-- 'download action button' should be translated using the same wording as the translation of 'revanced_hide_download_button_title' -->
<string name="revanced_external_downloader_action_button_title">Override download action button</string>
<string name="revanced_external_downloader_action_button_title">Override Download action button</string>
<string name="revanced_external_downloader_action_button_summary_on">Download button opens your external downloader</string>
<string name="revanced_external_downloader_action_button_summary_off">Download button opens the native in-app downloader</string>
<string name="revanced_external_downloader_name_title">Downloader package name</string>
@ -651,14 +654,14 @@ Note: Enabling this also forcibly hides video ads"</string>
<string name="revanced_hide_player_previous_next_buttons_title">Hide previous &amp; next video buttons</string>
<string name="revanced_hide_player_previous_next_buttons_summary_on">Buttons are hidden</string>
<string name="revanced_hide_player_previous_next_buttons_summary_off">Buttons are shown</string>
<string name="revanced_hide_cast_button_title">Hide cast button</string>
<string name="revanced_hide_cast_button_title">Hide Cast button</string>
<string name="revanced_hide_cast_button_summary_on">Cast button is hidden</string>
<string name="revanced_hide_cast_button_summary_off">Cast button is shown</string>
<!-- This button does not display any text, but 'captions' should be translated using the same wording used as the translation of 'revanced_hide_player_flyout_captions_title' -->
<string name="revanced_hide_captions_button_title">Hide captions button</string>
<string name="revanced_hide_captions_button_title">Hide Captions button</string>
<string name="revanced_hide_captions_button_summary_on">Captions button is hidden</string>
<string name="revanced_hide_captions_button_summary_off">Captions button is shown</string>
<string name="revanced_hide_autoplay_button_title">Hide autoplay button</string>
<string name="revanced_hide_autoplay_button_title">Hide Autoplay button</string>
<string name="revanced_hide_autoplay_button_summary_on">Autoplay button is hidden</string>
<string name="revanced_hide_autoplay_button_summary_off">Autoplay button is shown</string>
</patch>
@ -668,7 +671,7 @@ Note: Enabling this also forcibly hides video ads"</string>
<string name="revanced_hide_endscreen_cards_summary_off">End screen cards are shown</string>
</patch>
<patch id="layout.hide.fullscreenambientmode.disableFullscreenAmbientModePatch">
<string name="revanced_disable_fullscreen_ambient_mode_title">Disable ambient mode in fullscreen</string>
<string name="revanced_disable_fullscreen_ambient_mode_title">Disable Ambient mode in fullscreen</string>
<string name="revanced_disable_fullscreen_ambient_mode_summary_on">Ambient mode disabled</string>
<string name="revanced_disable_fullscreen_ambient_mode_summary_off">Ambient mode enabled</string>
</patch>
@ -708,38 +711,38 @@ Note: Enabling this also forcibly hides video ads"</string>
<string name="revanced_hide_shorts_history_summary_on">Hidden in watch history</string>
<string name="revanced_hide_shorts_history_summary_off">Shown in watch history</string>
<!-- 'join' should be translated using the same localized wording YouTube displays for the button. -->
<string name="revanced_hide_shorts_join_button_title">Hide join button</string>
<string name="revanced_hide_shorts_join_button_title">Hide Join button</string>
<string name="revanced_hide_shorts_join_button_summary_on">Join button is hidden</string>
<string name="revanced_hide_shorts_join_button_summary_off">Join button is shown</string>
<!-- 'subscribe' should be translated using the same localized wording YouTube displays for the button. -->
<string name="revanced_hide_shorts_subscribe_button_title">Hide subscribe button</string>
<string name="revanced_hide_shorts_subscribe_button_title">Hide Subscribe button</string>
<string name="revanced_hide_shorts_subscribe_button_summary_on">Subscribe button is hidden</string>
<string name="revanced_hide_shorts_subscribe_button_summary_off">Subscribe button is shown</string>
<string name="revanced_hide_shorts_paused_overlay_buttons_title">Hide paused overlay buttons</string>
<string name="revanced_hide_shorts_paused_overlay_buttons_summary_on">Paused overlay buttons are hidden</string>
<string name="revanced_hide_shorts_paused_overlay_buttons_summary_off">Paused overlay buttons are shown</string>
<string name="revanced_hide_shorts_shop_button_title">Hide shop button</string>
<string name="revanced_hide_shorts_shop_button_title">Hide Shop button</string>
<string name="revanced_hide_shorts_shop_button_summary_on">Shop button is hidden</string>
<string name="revanced_hide_shorts_shop_button_summary_off">Shop button is shown</string>
<string name="revanced_hide_shorts_super_thanks_button_title">Hide super thanks button</string>
<string name="revanced_hide_shorts_super_thanks_button_summary_on">Super thanks button is hidden</string>
<string name="revanced_hide_shorts_super_thanks_button_summary_off">Super thanks button is shown</string>
<string name="revanced_hide_shorts_super_thanks_button_title">Hide Buy Super Thanks button</string>
<string name="revanced_hide_shorts_super_thanks_button_summary_on">Super Thanks button is hidden</string>
<string name="revanced_hide_shorts_super_thanks_button_summary_off">Super Thanks button is shown</string>
<string name="revanced_hide_shorts_tagged_products_title">Hide tagged products</string>
<string name="revanced_hide_shorts_tagged_products_summary_on">Tagged products are hidden</string>
<string name="revanced_hide_shorts_tagged_products_summary_off">Tagged products are shown</string>
<string name="revanced_hide_shorts_location_label_title">Hide location label</string>
<string name="revanced_hide_shorts_location_label_summary_on">Location label is hidden</string>
<string name="revanced_hide_shorts_location_label_summary_off">Location label is shown</string>
<string name="revanced_hide_shorts_save_sound_button_title">Hide save music button</string>
<string name="revanced_hide_shorts_save_sound_button_title">Hide Save music button</string>
<string name="revanced_hide_shorts_save_sound_button_summary_on">Save music button is hidden</string>
<string name="revanced_hide_shorts_save_sound_button_summary_off">Save music button is shown</string>
<string name="revanced_hide_shorts_use_template_button_title">Hide use template button</string>
<string name="revanced_hide_shorts_use_template_button_title">Hide Use template button</string>
<string name="revanced_hide_shorts_use_template_button_summary_on">Use template button is hidden</string>
<string name="revanced_hide_shorts_use_template_button_summary_off">Use template button is shown</string>
<string name="revanced_hide_shorts_upcoming_button_title">Hide upcoming button</string>
<string name="revanced_hide_shorts_upcoming_button_title">Hide Upcoming button</string>
<string name="revanced_hide_shorts_upcoming_button_summary_on">Upcoming button is hidden</string>
<string name="revanced_hide_shorts_upcoming_button_summary_off">Upcoming button is shown</string>
<string name="revanced_hide_shorts_green_screen_button_title">Hide green screen button</string>
<string name="revanced_hide_shorts_green_screen_button_title">Hide Green screen button</string>
<string name="revanced_hide_shorts_green_screen_button_summary_on">Green screen button is hidden</string>
<string name="revanced_hide_shorts_green_screen_button_summary_off">Green screen button is shown</string>
<string name="revanced_hide_shorts_hashtag_button_title">Hide hashtag button</string>
@ -751,24 +754,24 @@ Note: Enabling this also forcibly hides video ads"</string>
<string name="revanced_hide_shorts_stickers_title">Hide stickers</string>
<string name="revanced_hide_shorts_stickers_summary_on">Stickers are hidden</string>
<string name="revanced_hide_shorts_stickers_summary_off">Stickers are shown</string>
<string name="revanced_hide_shorts_like_fountain_title">Hide like fountain</string>
<string name="revanced_hide_shorts_like_fountain_title">Hide Like button fountain animation</string>
<string name="revanced_hide_shorts_like_fountain_summary_on">Like button fountain animation is hidden</string>
<string name="revanced_hide_shorts_like_fountain_summary_off">Like button fountain animation is shown</string>
<string name="revanced_hide_shorts_like_button_title">Hide like button</string>
<string name="revanced_hide_shorts_like_button_title">Hide Like button</string>
<string name="revanced_hide_shorts_like_button_summary_on">Like button is hidden</string>
<string name="revanced_hide_shorts_like_button_summary_off">Like button is shown</string>
<string name="revanced_hide_shorts_dislike_button_title">Hide dislike button</string>
<string name="revanced_hide_shorts_dislike_button_title">Hide Dislike button</string>
<string name="revanced_hide_shorts_dislike_button_summary_on">Dislike button is hidden</string>
<string name="revanced_hide_shorts_dislike_button_summary_off">Dislike button is shown</string>
<string name="revanced_hide_shorts_comments_button_title">Hide comments button</string>
<string name="revanced_hide_shorts_comments_button_title">Hide Comments button</string>
<string name="revanced_hide_shorts_comments_button_summary_on">Comments button is hidden</string>
<string name="revanced_hide_shorts_comments_button_summary_off">Comments button is shown</string>
<!-- 'remix' should be translated using the same localized wording YouTube displays for the button. -->
<string name="revanced_hide_shorts_remix_button_title">Hide remix button</string>
<string name="revanced_hide_shorts_remix_button_title">Hide Remix button</string>
<string name="revanced_hide_shorts_remix_button_summary_on">Remix button is hidden</string>
<string name="revanced_hide_shorts_remix_button_summary_off">Remix button is shown</string>
<!-- 'share' should be translated using the same localized wording YouTube displays for the button. -->
<string name="revanced_hide_shorts_share_button_title">Hide share button</string>
<string name="revanced_hide_shorts_share_button_title">Hide Share button</string>
<string name="revanced_hide_shorts_share_button_summary_on">Share button is hidden</string>
<string name="revanced_hide_shorts_share_button_summary_off">Share button is shown</string>
<string name="revanced_hide_shorts_info_panel_title">Hide info panel</string>
@ -847,7 +850,7 @@ Limitation: Dislikes may not appear in incognito mode"</string>
<string name="revanced_ryd_dislike_percentage_summary_on">Dislikes shown as percentage</string>
<string name="revanced_ryd_dislike_percentage_summary_off">Dislikes shown as number</string>
<!-- Translations should use language similar to 'revanced_sb_enable_compact_skip_button' -->
<string name="revanced_ryd_compact_layout_title">Compact like button</string>
<string name="revanced_ryd_compact_layout_title">Compact Like button</string>
<string name="revanced_ryd_compact_layout_summary_on">Like button styled for minimum width</string>
<string name="revanced_ryd_compact_layout_summary_off">Like button styled for best appearance</string>
<string name="revanced_ryd_toast_on_connection_error_title">Show a toast if API is not available</string>
@ -897,7 +900,7 @@ This feature works best with a video quality of 720p or lower and when using a v
<patch id="layout.sponsorblock.sponsorBlockResourcePatch">
<string name="revanced_sb_settings_title">SponsorBlock</string>
<string name="revanced_sb_enable_sb">Enable SponsorBlock</string>
<string name="revanced_sb_enable_sb_sum">SponsorBlock is a crowd-sourced system for skipping annoying parts of YouTube videos</string>
<string name="revanced_sb_enable_sb_sum">SponsorBlock is a crowdsourced system for skipping annoying parts of YouTube videos</string>
<string name="revanced_sb_appearance_category">Appearance</string>
<string name="revanced_sb_enable_voting">Show voting button</string>
<string name="revanced_sb_enable_voting_sum_on">Segment voting button is shown</string>
@ -962,7 +965,7 @@ Your user id is like a password and it should never be shared.
<string name="revanced_sb_segments_sponsor">Sponsor</string>
<string name="revanced_sb_segments_sponsor_sum">Paid promotion, paid referrals and direct advertisements. Not for self-promotion or free shout-outs to causes/creators/websites/products they like</string>
<string name="revanced_sb_segments_selfpromo">Unpaid/Self Promotion</string>
<string name="revanced_sb_segments_selfpromo_sum">Similar to \'Sponsor\' except for unpaid or self promotion. Includes sections about merchandise, donations, or information about who they collaborated with</string>
<string name="revanced_sb_segments_selfpromo_sum">Similar to Sponsor except for unpaid or self promotion. Includes sections about merchandise, donations, or information about who they collaborated with</string>
<string name="revanced_sb_segments_interaction">Interaction Reminder (Subscribe)</string>
<string name="revanced_sb_segments_interaction_sum">A short reminder to like, subscribe or follow them in the middle of content. If it is long or about something specific, it should instead be under self promotion</string>
<string name="revanced_sb_segments_highlight">Highlight</string>