mirror of
https://github.com/revanced/revanced-integrations.git
synced 2024-12-24 03:35:49 +01:00
refactor: fix naming inconsistency
This commit is contained in:
parent
33e3c6b061
commit
7510c0632f
@ -86,7 +86,7 @@ public final class AdsFilter extends Filter {
|
||||
"cta_shelf_card"
|
||||
);
|
||||
|
||||
this.pathFilterGroups.addAll(
|
||||
this.pathFilterGroupList.addAll(
|
||||
generalAds,
|
||||
buttonedAd,
|
||||
merchandise,
|
||||
@ -95,7 +95,7 @@ public final class AdsFilter extends Filter {
|
||||
webLinkPanel,
|
||||
movieAds
|
||||
);
|
||||
this.identifierFilterGroups.addAll(carouselAd);
|
||||
this.identifierFilterGroupList.addAll(carouselAd);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -20,14 +20,14 @@ final class ButtonsFilter extends Filter {
|
||||
null,
|
||||
VIDEO_ACTION_BAR_PATH
|
||||
);
|
||||
identifierFilterGroups.addAll(actionBarGroup);
|
||||
identifierFilterGroupList.addAll(actionBarGroup);
|
||||
|
||||
|
||||
bufferFilterPathGroup = new StringFilterGroup(
|
||||
null,
|
||||
"|CellType|CollectionType|CellType|ContainerType|button.eml|"
|
||||
);
|
||||
pathFilterGroups.addAll(
|
||||
pathFilterGroupList.addAll(
|
||||
new StringFilterGroup(
|
||||
SettingsEnum.HIDE_LIKE_DISLIKE_BUTTON,
|
||||
"|segmented_like_dislike_button"
|
||||
@ -82,7 +82,7 @@ final class ButtonsFilter extends Filter {
|
||||
}
|
||||
|
||||
private boolean isEveryFilterGroupEnabled() {
|
||||
for (var group : pathFilterGroups)
|
||||
for (var group : pathFilterGroupList)
|
||||
if (!group.isEnabled()) return false;
|
||||
|
||||
for (var group : bufferButtonsGroupList)
|
||||
|
@ -18,7 +18,7 @@ final class CommentsFilter extends Filter {
|
||||
"comments_entry_point_simplebox"
|
||||
);
|
||||
|
||||
this.pathFilterGroups.addAll(
|
||||
this.pathFilterGroupList.addAll(
|
||||
comments,
|
||||
previewComment
|
||||
);
|
||||
|
@ -142,7 +142,7 @@ public final class LayoutComponentsFilter extends Filter {
|
||||
"chips_shelf"
|
||||
);
|
||||
|
||||
this.pathFilterGroups.addAll(
|
||||
this.pathFilterGroupList.addAll(
|
||||
channelBar,
|
||||
communityPosts,
|
||||
paidContent,
|
||||
@ -165,7 +165,7 @@ public final class LayoutComponentsFilter extends Filter {
|
||||
custom
|
||||
);
|
||||
|
||||
this.identifierFilterGroups.addAll(
|
||||
this.identifierFilterGroupList.addAll(
|
||||
graySeparator,
|
||||
chipsShelf
|
||||
);
|
||||
|
@ -1,26 +1,16 @@
|
||||
package app.revanced.integrations.patches.components;
|
||||
|
||||
import android.os.Build;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import app.revanced.integrations.settings.SettingsEnum;
|
||||
import app.revanced.integrations.utils.*;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Spliterator;
|
||||
import java.util.*;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import app.revanced.integrations.settings.SettingsEnum;
|
||||
import app.revanced.integrations.utils.ByteTrieSearch;
|
||||
import app.revanced.integrations.utils.LogHelper;
|
||||
import app.revanced.integrations.utils.ReVancedUtils;
|
||||
import app.revanced.integrations.utils.StringTrieSearch;
|
||||
import app.revanced.integrations.utils.TrieSearch;
|
||||
|
||||
abstract class FilterGroup<T> {
|
||||
final static class FilterGroupResult {
|
||||
SettingsEnum setting;
|
||||
@ -283,8 +273,8 @@ abstract class Filter {
|
||||
* will never be called for any matches.
|
||||
*/
|
||||
|
||||
protected final StringFilterGroupList pathFilterGroups = new StringFilterGroupList();
|
||||
protected final StringFilterGroupList identifierFilterGroups = new StringFilterGroupList();
|
||||
protected final StringFilterGroupList pathFilterGroupList = new StringFilterGroupList();
|
||||
protected final StringFilterGroupList identifierFilterGroupList = new StringFilterGroupList();
|
||||
|
||||
/**
|
||||
* Called after an enabled filter has been matched.
|
||||
@ -302,9 +292,9 @@ abstract class Filter {
|
||||
boolean isFiltered(@Nullable String identifier, String path, byte[] protobufBufferArray,
|
||||
FilterGroupList matchedList, FilterGroup matchedGroup, int matchedIndex) {
|
||||
if (SettingsEnum.DEBUG.getBoolean()) {
|
||||
if (pathFilterGroups == matchedList) {
|
||||
if (pathFilterGroupList == matchedList) {
|
||||
LogHelper.printDebug(() -> getClass().getSimpleName() + " Filtered path: " + path);
|
||||
} else if (identifierFilterGroups == matchedList) {
|
||||
} else if (identifierFilterGroupList == matchedList) {
|
||||
LogHelper.printDebug(() -> getClass().getSimpleName() + " Filtered identifier: " + identifier);
|
||||
}
|
||||
}
|
||||
@ -391,8 +381,8 @@ public final class LithoFilterPatch {
|
||||
|
||||
static {
|
||||
for (Filter filter : filters) {
|
||||
filterGroupLists(pathSearchTree, filter, filter.pathFilterGroups);
|
||||
filterGroupLists(identifierSearchTree, filter, filter.identifierFilterGroups);
|
||||
filterGroupLists(pathSearchTree, filter, filter.pathFilterGroupList);
|
||||
filterGroupLists(identifierSearchTree, filter, filter.identifierFilterGroupList);
|
||||
}
|
||||
|
||||
LogHelper.printDebug(() -> "Using: "
|
||||
|
@ -8,7 +8,7 @@ public final class PlaybackSpeedMenuFilterPatch extends Filter {
|
||||
public static volatile boolean isPlaybackSpeedMenuVisible;
|
||||
|
||||
public PlaybackSpeedMenuFilterPatch() {
|
||||
pathFilterGroups.addAll(new StringFilterGroup(
|
||||
pathFilterGroupList.addAll(new StringFilterGroup(
|
||||
null,
|
||||
"playback_speed_sheet_content.eml-js"
|
||||
));
|
||||
|
@ -15,7 +15,7 @@ public class PlayerFlyoutMenuItemsFilter extends Filter {
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.N)
|
||||
public PlayerFlyoutMenuItemsFilter() {
|
||||
identifierFilterGroups.addAll(new StringFilterGroup(null, "overflow_menu_item.eml|"));
|
||||
identifierFilterGroupList.addAll(new StringFilterGroup(null, "overflow_menu_item.eml|"));
|
||||
|
||||
flyoutFilterGroupList.addAll(
|
||||
new ByteArrayAsStringFilterGroup(
|
||||
|
@ -59,8 +59,8 @@ public final class ShortsFilter extends Filter {
|
||||
"shorts_pivot_item"
|
||||
);
|
||||
|
||||
pathFilterGroups.addAll(joinButton, subscribeButton, channelBar, soundButton, infoPanel);
|
||||
identifierFilterGroups.addAll(shorts, thanksButton);
|
||||
pathFilterGroupList.addAll(joinButton, subscribeButton, channelBar, soundButton, infoPanel);
|
||||
identifierFilterGroupList.addAll(shorts, thanksButton);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -69,11 +69,11 @@ public final class ShortsFilter extends Filter {
|
||||
if (matchedGroup == soundButton || matchedGroup == infoPanel || matchedGroup == channelBar) return true;
|
||||
|
||||
// Filter the path only when reelChannelBar is visible.
|
||||
if (pathFilterGroups == matchedList) {
|
||||
if (pathFilterGroupList == matchedList) {
|
||||
return path.contains(REEL_CHANNEL_BAR_PATH);
|
||||
}
|
||||
|
||||
return identifierFilterGroups == matchedList;
|
||||
return identifierFilterGroupList == matchedList;
|
||||
}
|
||||
|
||||
public static void hideShortsShelf(final View shortsShelfView) {
|
||||
|
@ -10,7 +10,7 @@ public final class VideoQualityMenuFilterPatch extends Filter {
|
||||
public static volatile boolean isVideoQualityMenuVisible;
|
||||
|
||||
public VideoQualityMenuFilterPatch() {
|
||||
pathFilterGroups.addAll(new StringFilterGroup(
|
||||
pathFilterGroupList.addAll(new StringFilterGroup(
|
||||
SettingsEnum.SHOW_OLD_VIDEO_QUALITY_MENU,
|
||||
"quick_quality_sheet_content.eml-js"
|
||||
));
|
||||
|
Loading…
Reference in New Issue
Block a user