mirror of
https://github.com/revanced/revanced-integrations.git
synced 2024-06-02 11:26:18 +02:00
30 lines
1023 B
Java
30 lines
1023 B
Java
package app.revanced.integrations.youtube.patches.components;
|
|
|
|
import androidx.annotation.Nullable;
|
|
|
|
import app.revanced.integrations.youtube.patches.playback.speed.CustomPlaybackSpeedPatch;
|
|
|
|
/**
|
|
* Abuse LithoFilter for {@link CustomPlaybackSpeedPatch}.
|
|
*/
|
|
@SuppressWarnings("unused")
|
|
public final class PlaybackSpeedMenuFilterPatch extends Filter {
|
|
// Must be volatile or synchronized, as litho filtering runs off main thread and this field is then access from the main thread.
|
|
public static volatile boolean isPlaybackSpeedMenuVisible;
|
|
|
|
public PlaybackSpeedMenuFilterPatch() {
|
|
addPathCallbacks(new StringFilterGroup(
|
|
null,
|
|
"playback_speed_sheet_content.eml-js"
|
|
));
|
|
}
|
|
|
|
@Override
|
|
boolean isFiltered(@Nullable String identifier, String path, byte[] protobufBufferArray,
|
|
StringFilterGroup matchedGroup, FilterContentType contentType, int contentIndex) {
|
|
isPlaybackSpeedMenuVisible = true;
|
|
|
|
return false;
|
|
}
|
|
}
|