mirror of
https://github.com/revanced/revanced-integrations.git
synced 2025-02-01 06:37:32 +01:00
fix(YouTube - Hide layout components): Prevent app from crashing on startup
The application crashes sporadically when a field is not initialized yet in a static context.
This commit is contained in:
parent
6520499a27
commit
c2112e066a
@ -12,8 +12,10 @@ import app.revanced.integrations.utils.StringTrieSearch;
|
|||||||
public final class LayoutComponentsFilter extends Filter {
|
public final class LayoutComponentsFilter extends Filter {
|
||||||
private final StringTrieSearch exceptions = new StringTrieSearch();
|
private final StringTrieSearch exceptions = new StringTrieSearch();
|
||||||
private static final StringTrieSearch mixPlaylistsExceptions = new StringTrieSearch();
|
private static final StringTrieSearch mixPlaylistsExceptions = new StringTrieSearch();
|
||||||
private static ByteArrayAsStringFilterGroup mixPlaylistsExceptions2;
|
private static final ByteArrayAsStringFilterGroup mixPlaylistsExceptions2 = new ByteArrayAsStringFilterGroup(
|
||||||
|
null,
|
||||||
|
"cell_description_body"
|
||||||
|
);
|
||||||
private final CustomFilterGroup custom;
|
private final CustomFilterGroup custom;
|
||||||
|
|
||||||
private static final ByteArrayAsStringFilterGroup mixPlaylists = new ByteArrayAsStringFilterGroup(
|
private static final ByteArrayAsStringFilterGroup mixPlaylists = new ByteArrayAsStringFilterGroup(
|
||||||
@ -25,6 +27,13 @@ public final class LayoutComponentsFilter extends Filter {
|
|||||||
private final StringFilterGroup notifyMe;
|
private final StringFilterGroup notifyMe;
|
||||||
private final StringFilterGroup expandableMetadata;
|
private final StringFilterGroup expandableMetadata;
|
||||||
|
|
||||||
|
static {
|
||||||
|
mixPlaylistsExceptions.addPatterns(
|
||||||
|
"V.ED", // Playlist browse id.
|
||||||
|
"java.lang.ref.WeakReference"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
@RequiresApi(api = Build.VERSION_CODES.N)
|
@RequiresApi(api = Build.VERSION_CODES.N)
|
||||||
public LayoutComponentsFilter() {
|
public LayoutComponentsFilter() {
|
||||||
exceptions.addPatterns(
|
exceptions.addPatterns(
|
||||||
@ -35,16 +44,6 @@ public final class LayoutComponentsFilter extends Filter {
|
|||||||
"library_recent_shelf"
|
"library_recent_shelf"
|
||||||
);
|
);
|
||||||
|
|
||||||
mixPlaylistsExceptions.addPatterns(
|
|
||||||
"V.ED", // Playlist browse id.
|
|
||||||
"java.lang.ref.WeakReference"
|
|
||||||
);
|
|
||||||
|
|
||||||
mixPlaylistsExceptions2 = new ByteArrayAsStringFilterGroup(
|
|
||||||
null,
|
|
||||||
"cell_description_body"
|
|
||||||
);
|
|
||||||
|
|
||||||
custom = new CustomFilterGroup(
|
custom = new CustomFilterGroup(
|
||||||
SettingsEnum.CUSTOM_FILTER,
|
SettingsEnum.CUSTOM_FILTER,
|
||||||
SettingsEnum.CUSTOM_FILTER_STRINGS
|
SettingsEnum.CUSTOM_FILTER_STRINGS
|
||||||
@ -272,7 +271,6 @@ public final class LayoutComponentsFilter extends Filter {
|
|||||||
|
|
||||||
LogHelper.printDebug(() -> "Filtered mix playlist");
|
LogHelper.printDebug(() -> "Filtered mix playlist");
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean showWatermark() {
|
public static boolean showWatermark() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user