diff --git a/app/src/main/java/app/revanced/integrations/patches/BrandingWaterMarkPatch.java b/app/src/main/java/app/revanced/integrations/patches/BrandingWaterMarkPatch.java deleted file mode 100644 index e729e153fd..0000000000 --- a/app/src/main/java/app/revanced/integrations/patches/BrandingWaterMarkPatch.java +++ /dev/null @@ -1,11 +0,0 @@ -package app.revanced.integrations.patches; - -import app.revanced.integrations.settings.SettingsEnum; - -public class BrandingWaterMarkPatch { - - // Used by: app.revanced.patches.youtube.layout.watermark.patch.HideWatermarkPatch - public static boolean isBrandingWatermarkShown() { - return SettingsEnum.HIDE_VIDEO_WATERMARK.getBoolean() == false; - } -} diff --git a/app/src/main/java/app/revanced/integrations/patches/components/LayoutComponentsFilter.java b/app/src/main/java/app/revanced/integrations/patches/components/LayoutComponentsFilter.java index 4ee419d38d..fa1d9b3696 100644 --- a/app/src/main/java/app/revanced/integrations/patches/components/LayoutComponentsFilter.java +++ b/app/src/main/java/app/revanced/integrations/patches/components/LayoutComponentsFilter.java @@ -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, @@ -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)) @@ -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) { @@ -236,4 +243,8 @@ public static boolean filterMixPlaylists(final byte[] bytes) { return isMixPlaylistFiltered; } + + public static boolean showWatermark() { + return !SettingsEnum.HIDE_VIDEO_CHANNEL_WATERMARK.getBoolean(); + } } diff --git a/app/src/main/java/app/revanced/integrations/settings/SettingsEnum.java b/app/src/main/java/app/revanced/integrations/settings/SettingsEnum.java index 3affe38447..0d72259bd8 100644 --- a/app/src/main/java/app/revanced/integrations/settings/SettingsEnum.java +++ b/app/src/main/java/app/revanced/integrations/settings/SettingsEnum.java @@ -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"), @@ -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.