mirror of
https://github.com/revanced/revanced-patches.git
synced 2025-05-24 02:22:16 +02:00
fix(YouTube - Hide ads): Hide new type of general ad (#5004)
This commit is contained in:
parent
48b2e081ad
commit
37e59d2771
@ -64,48 +64,45 @@ public final class AdsFilter extends Filter {
|
||||
"_interstitial"
|
||||
);
|
||||
|
||||
final var buttonedAd = new StringFilterGroup(
|
||||
Settings.HIDE_BUTTONED_ADS,
|
||||
"_ad_with",
|
||||
"_buttoned_layout",
|
||||
// text_image_button_group_layout, landscape_image_button_group_layout, full_width_square_image_button_group_layout
|
||||
"image_button_group_layout",
|
||||
"full_width_square_image_layout",
|
||||
"video_display_button_group_layout",
|
||||
"landscape_image_wide_button_layout",
|
||||
"video_display_carousel_button_group_layout",
|
||||
"video_display_full_buttoned_short_dr_layout",
|
||||
"compact_landscape_image_layout", // Tablet layout search results.
|
||||
"text_image_no_button_layout" // Tablet layout search results.
|
||||
);
|
||||
|
||||
final var generalAds = new StringFilterGroup(
|
||||
Settings.HIDE_GENERAL_ADS,
|
||||
"_ad_with",
|
||||
"_buttoned_layout",
|
||||
"ads_video_with_context",
|
||||
"banner_text_icon",
|
||||
"square_image_layout",
|
||||
"watch_metadata_app_promo",
|
||||
"video_display_full_layout",
|
||||
"hero_promo_image",
|
||||
"statement_banner",
|
||||
"brand_video_shelf",
|
||||
"brand_video_singleton",
|
||||
"carousel_footered_layout",
|
||||
"text_image_button_layout",
|
||||
"carousel_headered_layout",
|
||||
"compact_landscape_image_layout", // Tablet layout search results.
|
||||
"composite_concurrent_carousel_layout",
|
||||
"full_width_portrait_image_layout",
|
||||
"full_width_square_image_carousel_layout",
|
||||
"full_width_square_image_layout",
|
||||
"hero_promo_image",
|
||||
// text_image_button_group_layout, landscape_image_button_group_layout, full_width_square_image_button_group_layout
|
||||
"image_button_group_layout",
|
||||
"landscape_image_wide_button_layout",
|
||||
"primetime_promo",
|
||||
"product_details",
|
||||
"composite_concurrent_carousel_layout",
|
||||
"carousel_headered_layout",
|
||||
"full_width_portrait_image_layout",
|
||||
"brand_video_shelf",
|
||||
"brand_video_singleton"
|
||||
"square_image_layout",
|
||||
"statement_banner",
|
||||
"text_image_button_layout",
|
||||
"text_image_no_button_layout", // Tablet layout search results.
|
||||
"video_display_button_group_layout",
|
||||
"video_display_carousel_button_group_layout",
|
||||
"video_display_full_buttoned_short_dr_layout",
|
||||
"video_display_full_layout",
|
||||
"watch_metadata_app_promo"
|
||||
);
|
||||
|
||||
final var movieAds = new StringFilterGroup(
|
||||
Settings.HIDE_MOVIES_SECTION,
|
||||
"browsy_bar",
|
||||
"compact_movie",
|
||||
"compact_tvfilm_item",
|
||||
"horizontal_movie_shelf",
|
||||
"movie_and_show_upsell_card",
|
||||
"compact_tvfilm_item",
|
||||
"offer_module_root"
|
||||
);
|
||||
|
||||
@ -160,7 +157,6 @@ public final class AdsFilter extends Filter {
|
||||
|
||||
addPathCallbacks(
|
||||
generalAds,
|
||||
buttonedAd,
|
||||
merchandise,
|
||||
viewProducts,
|
||||
selfSponsor,
|
||||
@ -181,17 +177,19 @@ public final class AdsFilter extends Filter {
|
||||
}
|
||||
|
||||
// Check for the index because of likelihood of false positives.
|
||||
if (matchedGroup == shoppingLinks && contentIndex != 0) {
|
||||
if (contentIndex != 0 && matchedGroup == shoppingLinks) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (exceptions.matches(path))
|
||||
if (exceptions.matches(path)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (matchedGroup == fullscreenAd) {
|
||||
if (path.contains("|ImageType|")) closeFullscreenAd();
|
||||
|
||||
return false; // Do not actually filter the fullscreen ad otherwise it will leave a dimmed screen.
|
||||
// Do not actually filter the fullscreen ad otherwise it will leave a dimmed screen.
|
||||
return false;
|
||||
}
|
||||
|
||||
if (matchedGroup == channelProfile) {
|
||||
|
@ -68,7 +68,6 @@ public class Settings extends BaseSettings {
|
||||
public static final BooleanSetting FORCE_ORIGINAL_AUDIO = new BooleanSetting("revanced_force_original_audio", FALSE, new ForceOriginalAudioAvailability());
|
||||
|
||||
// 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", TRUE, true);
|
||||
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);
|
||||
|
@ -46,7 +46,6 @@ private val hideAdsResourcePatch = resourcePatch {
|
||||
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"),
|
||||
SwitchPreference("revanced_hide_player_store_shelf"),
|
||||
SwitchPreference("revanced_hide_self_sponsor_ads"),
|
||||
|
@ -427,9 +427,6 @@ Limitations
|
||||
|
||||
This feature is only available for older devices"</string>
|
||||
<string name="revanced_hide_fullscreen_ads_summary_off">Fullscreen ads are shown</string>
|
||||
<string name="revanced_hide_buttoned_ads_title">Hide buttoned ads</string>
|
||||
<string name="revanced_hide_buttoned_ads_summary_on">Buttoned ads are hidden</string>
|
||||
<string name="revanced_hide_buttoned_ads_summary_off">Buttoned ads are shown</string>
|
||||
<string name="revanced_hide_paid_promotion_label_title">Hide paid promotion label</string>
|
||||
<string name="revanced_hide_paid_promotion_label_summary_on">Paid promotion label is hidden</string>
|
||||
<string name="revanced_hide_paid_promotion_label_summary_off">Paid promotion label is shown</string>
|
||||
|
Loading…
x
Reference in New Issue
Block a user