Skip to content
This repository has been archived by the owner on Oct 26, 2024. It is now read-only.

Commit

Permalink
fix(YouTube - Player flyout menu): Add hide Lock screen menu (#609)
Browse files Browse the repository at this point in the history
  • Loading branch information
LisoUseInAIKyrios authored Apr 4, 2024
1 parent 20162f9 commit b2fe105
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ public PlayerFlyoutMenuItemsFilter() {
Settings.HIDE_MORE_INFO_MENU,
"yt_outline_info_circle"
),
new ByteArrayFilterGroup(
Settings.HIDE_LOCK_SCREEN_MENU,
"yt_outline_lock"
),
new ByteArrayFilterGroup(
Settings.HIDE_SPEED_MENU,
"yt_outline_play_arrow_half_circle"
Expand All @@ -75,15 +79,21 @@ public PlayerFlyoutMenuItemsFilter() {
@Override
boolean isFiltered(@Nullable String identifier, String path, byte[] protobufBufferArray,
StringFilterGroup matchedGroup, FilterContentType contentType, int contentIndex) {
// Only 1 path callback was added, so the matched group must be the overflow menu.
if (contentIndex != 0) {
return false; // Overflow menu is always the start of the path.
}

// Shorts also use this player flyout panel
if (PlayerType.getCurrent().isNoneOrHidden() || exception.check(protobufBufferArray).isFiltered())
if (PlayerType.getCurrent().isNoneOrHidden() || exception.check(protobufBufferArray).isFiltered()) {
return false;
}

// Only 1 path callback was added, so the matched group must be the overflow menu.
if (contentIndex == 0 && flyoutFilterGroupList.check(protobufBufferArray).isFiltered()) {
if (flyoutFilterGroupList.check(protobufBufferArray).isFiltered()) {
// Super class handles logging.
return super.isFiltered(identifier, path, protobufBufferArray, matchedGroup, contentType, contentIndex);
}

return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ public class Settings extends BaseSettings {
public static final BooleanSetting HIDE_HELP_MENU = new BooleanSetting("revanced_hide_player_flyout_help", TRUE);
public static final BooleanSetting HIDE_SPEED_MENU = new BooleanSetting("revanced_hide_player_flyout_speed", FALSE);
public static final BooleanSetting HIDE_MORE_INFO_MENU = new BooleanSetting("revanced_hide_player_flyout_more_info", TRUE);
public static final BooleanSetting HIDE_LOCK_SCREEN_MENU = new BooleanSetting("revanced_hide_player_flyout_lock_screen", FALSE);
public static final BooleanSetting HIDE_AUDIO_TRACK_MENU = new BooleanSetting("revanced_hide_player_flyout_audio_track", FALSE);
public static final BooleanSetting HIDE_WATCH_IN_VR_MENU = new BooleanSetting("revanced_hide_player_flyout_watch_in_vr", TRUE);

Expand All @@ -218,7 +219,7 @@ public class Settings extends BaseSettings {
public static final BooleanSetting SPOOF_DEVICE_DIMENSIONS = new BooleanSetting("revanced_spoof_device_dimensions", FALSE, true);
public static final BooleanSetting BYPASS_URL_REDIRECTS = new BooleanSetting("revanced_bypass_url_redirects", TRUE);
public static final BooleanSetting ANNOUNCEMENTS = new BooleanSetting("revanced_announcements", TRUE);
@Deprecated
@Deprecated
public static final StringSetting DEPRECATED_ANNOUNCEMENT_LAST_HASH = new StringSetting("revanced_announcement_last_hash", "");
public static final IntegerSetting ANNOUNCEMENT_LAST_ID = new IntegerSetting("revanced_announcement_last_id", -1);
public static final BooleanSetting REMOVE_TRACKING_QUERY_PARAMETER = new BooleanSetting("revanced_remove_tracking_query_parameter", TRUE);
Expand Down

0 comments on commit b2fe105

Please sign in to comment.