fix(YouTube - Hide layout components): Hide new channel watermark component

This commit is contained in:
oSumAtrIX 2023-10-13 17:13:47 +02:00
parent f7e99832fd
commit 9670bd305b
No known key found for this signature in database
GPG Key ID: A9B3094ACDB604B4
3 changed files with 15 additions and 12 deletions

View File

@ -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;
}
}

View File

@ -175,11 +175,17 @@ public final class LayoutComponentsFilter extends Filter {
"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 final class LayoutComponentsFilter extends Filter {
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 final class LayoutComponentsFilter extends Filter {
/**
* Injection point.
*
* Called from a different place then the other filters.
*/
public static boolean filterMixPlaylists(final byte[] bytes) {
@ -236,4 +243,8 @@ public final class LayoutComponentsFilter extends Filter {
return isMixPlaylistFiltered;
}
public static boolean showWatermark() {
return !SettingsEnum.HIDE_VIDEO_CHANNEL_WATERMARK.getBoolean();
}
}

View File

@ -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 @@ public enum SettingsEnum {
// 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.