Skip to content

Commit

Permalink
fix(YouTube - Hide layout components): Hide new channel watermark com…
Browse files Browse the repository at this point in the history
…ponent
  • Loading branch information
oSumAtrIX committed Oct 13, 2023
1 parent f7e9983 commit 9670bd3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.

This file was deleted.

Expand Up @@ -175,11 +175,17 @@ public LayoutComponentsFilter() {
"chips_shelf"
);

final var channelWatermark = new StringFilterGroup(
SettingsEnum.HIDE_VIDEO_CHANNEL_WATERMARK,
"featured_channel_watermark_overlay"
);

this.pathFilterGroupList.addAll(
channelBar,
communityPosts,
paidContent,
latestPosts,
channelWatermark,
communityGuidelines,
quickActions,
expandableMetadata,
Expand Down Expand Up @@ -211,6 +217,8 @@ public LayoutComponentsFilter() {
public boolean isFiltered(@Nullable String identifier, String path, byte[] protobufBufferArray,
FilterGroupList matchedList, FilterGroup matchedGroup, int matchedIndex) {

// The groups are excluded from the filter due to the exceptions list below.
// Filter them separately here.
if (matchedGroup == notifyMe || matchedGroup == inFeedSurvey) return true;

if (matchedGroup != custom && exceptions.matches(path))
Expand All @@ -225,7 +233,6 @@ public boolean isFiltered(@Nullable String identifier, String path, byte[] proto

/**
* Injection point.
*
* Called from a different place then the other filters.
*/
public static boolean filterMixPlaylists(final byte[] bytes) {
Expand All @@ -236,4 +243,8 @@ public static boolean filterMixPlaylists(final byte[] bytes) {

return isMixPlaylistFiltered;
}

public static boolean showWatermark() {
return !SettingsEnum.HIDE_VIDEO_CHANNEL_WATERMARK.getBoolean();
}
}
Expand Up @@ -123,6 +123,7 @@ public enum SettingsEnum {
HIDE_SUBSCRIPTIONS_BUTTON("revanced_hide_subscriptions_button", BOOLEAN, FALSE, true),
HIDE_TIMESTAMP("revanced_hide_timestamp", BOOLEAN, FALSE),
HIDE_VIDEO_WATERMARK("revanced_hide_video_watermark", BOOLEAN, TRUE),
HIDE_VIDEO_CHANNEL_WATERMARK("revanced_hide_channel_watermark", BOOLEAN, TRUE),
PLAYER_POPUP_PANELS("revanced_hide_player_popup_panels", BOOLEAN, FALSE),
SWITCH_CREATE_WITH_NOTIFICATIONS_BUTTON("revanced_switch_create_with_notifications_button", BOOLEAN, TRUE, true),
SPOOF_APP_VERSION("revanced_spoof_app_version", BOOLEAN, FALSE, true, "revanced_spoof_app_version_user_dialog_message"),
Expand Down Expand Up @@ -374,6 +375,8 @@ private static void loadAllSettings() {

// region Migration

migrateOldSettingToNew(HIDE_VIDEO_WATERMARK, HIDE_VIDEO_CHANNEL_WATERMARK);

// Do _not_ delete this SB private user id migration property until sometime in 2024.
// This is the only setting that cannot be reconfigured if lost,
// and more time should be given for users who rarely upgrade.
Expand Down

0 comments on commit 9670bd3

Please sign in to comment.