mirror of
https://github.com/revanced/revanced-patches.git
synced 2025-06-12 13:17:38 +02:00
feat(YouTube - Hide ads): Add Hide end screen store banner
(#4351)
This commit is contained in:

committed by
GitHub

parent
59db22c10d
commit
5505087802
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
|
Reference in New Issue
Block a user