mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2026-01-10 05:06:17 +00:00
feat(YouTube - Hide Shorts components): Add "Hide auto-dubbed label" and "Hide live preview" options (#6334)
This commit is contained in:
committed by
GitHub
parent
d8ca4ee931
commit
a7c220a4ae
@@ -44,9 +44,10 @@ public final class ShortsFilter extends Filter {
|
|||||||
private final StringFilterGroup useTemplateButton;
|
private final StringFilterGroup useTemplateButton;
|
||||||
private final ByteArrayFilterGroup useTemplateButtonBuffer;
|
private final ByteArrayFilterGroup useTemplateButtonBuffer;
|
||||||
|
|
||||||
|
private final StringFilterGroup autoDubbedLabel;
|
||||||
private final StringFilterGroup subscribeButton;
|
private final StringFilterGroup subscribeButton;
|
||||||
private final StringFilterGroup joinButton;
|
private final StringFilterGroup joinButton;
|
||||||
private final StringFilterGroup paidPromotionButton;
|
private final StringFilterGroup paidPromotionLabel;
|
||||||
private final StringFilterGroup shelfHeader;
|
private final StringFilterGroup shelfHeader;
|
||||||
|
|
||||||
private final StringFilterGroup suggestedAction;
|
private final StringFilterGroup suggestedAction;
|
||||||
@@ -161,6 +162,18 @@ public final class ShortsFilter extends Filter {
|
|||||||
"participation_bar.e"
|
"participation_bar.e"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
StringFilterGroup livePreview = new StringFilterGroup(
|
||||||
|
Settings.HIDE_SHORTS_LIVE_PREVIEW,
|
||||||
|
// Live Shorts preview that can popup while scrolling through Shorts player.
|
||||||
|
// Can be removed if a way to disable live Shorts is found.
|
||||||
|
"live_preview_page_vm.e"
|
||||||
|
);
|
||||||
|
|
||||||
|
autoDubbedLabel = new StringFilterGroup(
|
||||||
|
Settings.HIDE_SHORTS_AUTO_DUBBED_LABEL,
|
||||||
|
"badge."
|
||||||
|
);
|
||||||
|
|
||||||
joinButton = new StringFilterGroup(
|
joinButton = new StringFilterGroup(
|
||||||
Settings.HIDE_SHORTS_JOIN_BUTTON,
|
Settings.HIDE_SHORTS_JOIN_BUTTON,
|
||||||
"sponsor_button"
|
"sponsor_button"
|
||||||
@@ -171,9 +184,10 @@ public final class ShortsFilter extends Filter {
|
|||||||
"subscribe_button"
|
"subscribe_button"
|
||||||
);
|
);
|
||||||
|
|
||||||
paidPromotionButton = new StringFilterGroup(
|
paidPromotionLabel = new StringFilterGroup(
|
||||||
Settings.HIDE_PAID_PROMOTION_LABEL,
|
Settings.HIDE_PAID_PROMOTION_LABEL,
|
||||||
"reel_player_disclosure.e"
|
"reel_player_disclosure.e",
|
||||||
|
"shorts_disclosures.e"
|
||||||
);
|
);
|
||||||
|
|
||||||
shortsActionBar = new StringFilterGroup(
|
shortsActionBar = new StringFilterGroup(
|
||||||
@@ -219,10 +233,10 @@ public final class ShortsFilter extends Filter {
|
|||||||
);
|
);
|
||||||
|
|
||||||
addPathCallbacks(
|
addPathCallbacks(
|
||||||
shortsCompactFeedVideo, joinButton, subscribeButton, paidPromotionButton,
|
shortsCompactFeedVideo, joinButton, subscribeButton, paidPromotionLabel, autoDubbedLabel,
|
||||||
shortsActionBar, suggestedAction, pausedOverlayButtons, channelBar, previewComment,
|
shortsActionBar, suggestedAction, pausedOverlayButtons, channelBar, previewComment,
|
||||||
fullVideoLinkLabel, videoTitle, useSoundButton, reelSoundMetadata, soundButton, infoPanel,
|
fullVideoLinkLabel, videoTitle, useSoundButton, reelSoundMetadata, soundButton, infoPanel,
|
||||||
stickers, likeFountain, likeButton, dislikeButton
|
stickers, likeFountain, likeButton, dislikeButton, livePreview
|
||||||
);
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -250,6 +264,12 @@ public final class ShortsFilter extends Filter {
|
|||||||
// Suggested actions.
|
// Suggested actions.
|
||||||
//
|
//
|
||||||
suggestedActionsBuffer.addAll(
|
suggestedActionsBuffer.addAll(
|
||||||
|
new ByteArrayFilterGroup(
|
||||||
|
Settings.HIDE_SHORTS_PREVIEW_COMMENT,
|
||||||
|
// Preview comment that can popup while a Short is playing.
|
||||||
|
// Uses no bundled icons, and instead the users profile photo is shown.
|
||||||
|
"shorts-comments-panel"
|
||||||
|
),
|
||||||
new ByteArrayFilterGroup(
|
new ByteArrayFilterGroup(
|
||||||
Settings.HIDE_SHORTS_SHOP_BUTTON,
|
Settings.HIDE_SHORTS_SHOP_BUTTON,
|
||||||
"yt_outline_bag_"
|
"yt_outline_bag_"
|
||||||
@@ -322,7 +342,8 @@ public final class ShortsFilter extends Filter {
|
|||||||
boolean isFiltered(String identifier, String path, byte[] buffer,
|
boolean isFiltered(String identifier, String path, byte[] buffer,
|
||||||
StringFilterGroup matchedGroup, FilterContentType contentType, int contentIndex) {
|
StringFilterGroup matchedGroup, FilterContentType contentType, int contentIndex) {
|
||||||
if (contentType == FilterContentType.PATH) {
|
if (contentType == FilterContentType.PATH) {
|
||||||
if (matchedGroup == subscribeButton || matchedGroup == joinButton || matchedGroup == paidPromotionButton) {
|
if (matchedGroup == subscribeButton || matchedGroup == joinButton
|
||||||
|
|| matchedGroup == paidPromotionLabel || matchedGroup == autoDubbedLabel) {
|
||||||
// Selectively filter to avoid false positive filtering of other subscribe/join buttons.
|
// Selectively filter to avoid false positive filtering of other subscribe/join buttons.
|
||||||
return path.startsWith(REEL_CHANNEL_BAR_PATH) || path.startsWith(REEL_METAPANEL_PATH);
|
return path.startsWith(REEL_CHANNEL_BAR_PATH) || path.startsWith(REEL_METAPANEL_PATH);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -295,6 +295,7 @@ public class Settings extends BaseSettings {
|
|||||||
public static final BooleanSetting DISABLE_RESUMING_SHORTS_PLAYER = new BooleanSetting("revanced_disable_resuming_shorts_player", FALSE);
|
public static final BooleanSetting DISABLE_RESUMING_SHORTS_PLAYER = new BooleanSetting("revanced_disable_resuming_shorts_player", FALSE);
|
||||||
public static final BooleanSetting DISABLE_SHORTS_BACKGROUND_PLAYBACK = new BooleanSetting("revanced_shorts_disable_background_playback", FALSE);
|
public static final BooleanSetting DISABLE_SHORTS_BACKGROUND_PLAYBACK = new BooleanSetting("revanced_shorts_disable_background_playback", FALSE);
|
||||||
public static final EnumSetting<ShortsPlayerType> SHORTS_PLAYER_TYPE = new EnumSetting<>("revanced_shorts_player_type", ShortsPlayerType.SHORTS_PLAYER);
|
public static final EnumSetting<ShortsPlayerType> SHORTS_PLAYER_TYPE = new EnumSetting<>("revanced_shorts_player_type", ShortsPlayerType.SHORTS_PLAYER);
|
||||||
|
public static final BooleanSetting HIDE_SHORTS_AUTO_DUBBED_LABEL = new BooleanSetting("revanced_hide_shorts_auto_dubbed_label", FALSE);
|
||||||
public static final BooleanSetting HIDE_SHORTS_CHANNEL_BAR = new BooleanSetting("revanced_hide_shorts_channel_bar", FALSE);
|
public static final BooleanSetting HIDE_SHORTS_CHANNEL_BAR = new BooleanSetting("revanced_hide_shorts_channel_bar", FALSE);
|
||||||
public static final BooleanSetting HIDE_SHORTS_COMMENTS_BUTTON = new BooleanSetting("revanced_hide_shorts_comments_button", FALSE);
|
public static final BooleanSetting HIDE_SHORTS_COMMENTS_BUTTON = new BooleanSetting("revanced_hide_shorts_comments_button", FALSE);
|
||||||
public static final BooleanSetting HIDE_SHORTS_DISLIKE_BUTTON = new BooleanSetting("revanced_hide_shorts_dislike_button", FALSE);
|
public static final BooleanSetting HIDE_SHORTS_DISLIKE_BUTTON = new BooleanSetting("revanced_hide_shorts_dislike_button", FALSE);
|
||||||
@@ -309,6 +310,7 @@ 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_JOIN_BUTTON = new BooleanSetting("revanced_hide_shorts_join_button", TRUE);
|
||||||
public static final BooleanSetting HIDE_SHORTS_LIKE_BUTTON = new BooleanSetting("revanced_hide_shorts_like_button", FALSE);
|
public static final BooleanSetting HIDE_SHORTS_LIKE_BUTTON = new BooleanSetting("revanced_hide_shorts_like_button", FALSE);
|
||||||
public static final BooleanSetting HIDE_SHORTS_LIKE_FOUNTAIN = new BooleanSetting("revanced_hide_shorts_like_fountain", TRUE);
|
public static final BooleanSetting HIDE_SHORTS_LIKE_FOUNTAIN = new BooleanSetting("revanced_hide_shorts_like_fountain", TRUE);
|
||||||
|
public static final BooleanSetting HIDE_SHORTS_LIVE_PREVIEW = new BooleanSetting("revanced_hide_shorts_live_preview", FALSE);
|
||||||
public static final BooleanSetting HIDE_SHORTS_LOCATION_LABEL = new BooleanSetting("revanced_hide_shorts_location_label", FALSE);
|
public static final BooleanSetting HIDE_SHORTS_LOCATION_LABEL = new BooleanSetting("revanced_hide_shorts_location_label", FALSE);
|
||||||
public static final BooleanSetting HIDE_SHORTS_NAVIGATION_BAR = new BooleanSetting("revanced_hide_shorts_navigation_bar", FALSE, true);
|
public static final BooleanSetting HIDE_SHORTS_NAVIGATION_BAR = new BooleanSetting("revanced_hide_shorts_navigation_bar", FALSE, 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_PAUSED_OVERLAY_BUTTONS = new BooleanSetting("revanced_hide_shorts_paused_overlay_buttons", FALSE);
|
||||||
|
|||||||
@@ -101,6 +101,7 @@ private val hideShortsComponentsResourcePatch = resourcePatch {
|
|||||||
SwitchPreference("revanced_hide_shorts_effect_button"),
|
SwitchPreference("revanced_hide_shorts_effect_button"),
|
||||||
SwitchPreference("revanced_hide_shorts_green_screen_button"),
|
SwitchPreference("revanced_hide_shorts_green_screen_button"),
|
||||||
SwitchPreference("revanced_hide_shorts_hashtag_button"),
|
SwitchPreference("revanced_hide_shorts_hashtag_button"),
|
||||||
|
SwitchPreference("revanced_hide_shorts_live_preview"),
|
||||||
SwitchPreference("revanced_hide_shorts_new_posts_button"),
|
SwitchPreference("revanced_hide_shorts_new_posts_button"),
|
||||||
SwitchPreference("revanced_hide_shorts_shop_button"),
|
SwitchPreference("revanced_hide_shorts_shop_button"),
|
||||||
SwitchPreference("revanced_hide_shorts_tagged_products"),
|
SwitchPreference("revanced_hide_shorts_tagged_products"),
|
||||||
@@ -109,6 +110,7 @@ private val hideShortsComponentsResourcePatch = resourcePatch {
|
|||||||
SwitchPreference("revanced_hide_shorts_stickers"),
|
SwitchPreference("revanced_hide_shorts_stickers"),
|
||||||
|
|
||||||
// Bottom of the screen.
|
// Bottom of the screen.
|
||||||
|
SwitchPreference("revanced_hide_shorts_auto_dubbed_label"),
|
||||||
SwitchPreference("revanced_hide_shorts_location_label"),
|
SwitchPreference("revanced_hide_shorts_location_label"),
|
||||||
SwitchPreference("revanced_hide_shorts_channel_bar"),
|
SwitchPreference("revanced_hide_shorts_channel_bar"),
|
||||||
SwitchPreference("revanced_hide_shorts_info_panel"),
|
SwitchPreference("revanced_hide_shorts_info_panel"),
|
||||||
|
|||||||
@@ -893,6 +893,9 @@ To show the Audio track menu, change \'Spoof video streams\' to \'Android No SDK
|
|||||||
<string name="revanced_hide_shorts_history_title">Hide Shorts in watch history</string>
|
<string name="revanced_hide_shorts_history_title">Hide Shorts in watch history</string>
|
||||||
<string name="revanced_hide_shorts_history_summary_on">Hidden in watch history</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>
|
<string name="revanced_hide_shorts_history_summary_off">Shown in watch history</string>
|
||||||
|
<string name="revanced_hide_shorts_auto_dubbed_label_title">Hide auto-dubbed label</string>
|
||||||
|
<string name="revanced_hide_shorts_auto_dubbed_label_summary_on">Auto-dubbed label is hidden</string>
|
||||||
|
<string name="revanced_hide_shorts_auto_dubbed_label_summary_off">Auto-dubbed label 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_title">Hide Buy Super Thanks button</string>
|
||||||
<string name="revanced_hide_shorts_super_thanks_button_summary_on">Buy Super Thanks button is hidden</string>
|
<string name="revanced_hide_shorts_super_thanks_button_summary_on">Buy Super Thanks button is hidden</string>
|
||||||
<string name="revanced_hide_shorts_super_thanks_button_summary_off">Buy Super Thanks button is shown</string>
|
<string name="revanced_hide_shorts_super_thanks_button_summary_off">Buy Super Thanks button is shown</string>
|
||||||
@@ -909,6 +912,9 @@ To show the Audio track menu, change \'Spoof video streams\' to \'Android No SDK
|
|||||||
<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_on">Join button is hidden</string>
|
||||||
<string name="revanced_hide_shorts_join_button_summary_off">Join button is shown</string>
|
<string name="revanced_hide_shorts_join_button_summary_off">Join button is shown</string>
|
||||||
|
<string name="revanced_hide_shorts_live_preview_title">Hide live preview</string>
|
||||||
|
<string name="revanced_hide_shorts_live_preview_summary_on">Live preview is hidden</string>
|
||||||
|
<string name="revanced_hide_shorts_live_preview_summary_off">Live preview is shown</string>
|
||||||
<string name="revanced_hide_shorts_location_label_title">Hide location label</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_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_location_label_summary_off">Location label is shown</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user