diff --git a/app/src/main/java/app/revanced/integrations/youtube/patches/feed/FeedPatch.java b/app/src/main/java/app/revanced/integrations/youtube/patches/feed/FeedPatch.java index 7affd13af7..07690ae471 100644 --- a/app/src/main/java/app/revanced/integrations/youtube/patches/feed/FeedPatch.java +++ b/app/src/main/java/app/revanced/integrations/youtube/patches/feed/FeedPatch.java @@ -24,7 +24,7 @@ public static int hideCategoryBarInFeed(final int height) { public static void hideCategoryBarInRelatedVideos(final View chipView) { Utils.hideViewBy0dpUnderCondition( - Settings.HIDE_CATEGORY_BAR_IN_RELATED_VIDEOS.get(), + Settings.HIDE_CATEGORY_BAR_IN_RELATED_VIDEOS.get() || Settings.HIDE_RELATED_VIDEOS.get(), chipView ); } diff --git a/app/src/main/java/app/revanced/integrations/youtube/patches/general/GeneralPatch.java b/app/src/main/java/app/revanced/integrations/youtube/patches/general/GeneralPatch.java index 1f6c595476..2772ebff5c 100644 --- a/app/src/main/java/app/revanced/integrations/youtube/patches/general/GeneralPatch.java +++ b/app/src/main/java/app/revanced/integrations/youtube/patches/general/GeneralPatch.java @@ -290,10 +290,9 @@ public static void confirmDialogAgeVerified(final AlertDialog dialog) { // region [Spoof app version] patch public static String getVersionOverride(String appVersion) { - if (!Settings.SPOOF_APP_VERSION.get()) - return appVersion; - - return Settings.SPOOF_APP_VERSION_TARGET.get(); + return Settings.SPOOF_APP_VERSION.get() + ? Settings.SPOOF_APP_VERSION_TARGET.get() + : appVersion; } // endregion @@ -488,10 +487,12 @@ public static void hideYouTubeDoodles(ImageView imageView, Drawable drawable) { } } - private static final int settingsDrawableId = ResourceUtils.getDrawableIdentifier("yt_outline_gear_black_24"); + private static final int settingsDrawableId = + ResourceUtils.getDrawableIdentifier("yt_outline_gear_black_24"); public static int getCreateButtonDrawableId(int original) { - return Settings.REPLACE_TOOLBAR_CREATE_BUTTON.get() + return Settings.REPLACE_TOOLBAR_CREATE_BUTTON.get() && + settingsDrawableId != 0 ? settingsDrawableId : original; } diff --git a/app/src/main/java/app/revanced/integrations/youtube/patches/utils/ToolBarPatch.java b/app/src/main/java/app/revanced/integrations/youtube/patches/utils/ToolBarPatch.java index d20f0b4895..dc4c610b0d 100644 --- a/app/src/main/java/app/revanced/integrations/youtube/patches/utils/ToolBarPatch.java +++ b/app/src/main/java/app/revanced/integrations/youtube/patches/utils/ToolBarPatch.java @@ -10,8 +10,11 @@ public class ToolBarPatch { public static void hookToolBar(Enum buttonEnum, ImageView imageView) { final String enumString = buttonEnum.name(); - if (enumString.isEmpty() || !(imageView.getParent() instanceof View view)) + if (enumString.isEmpty() || + imageView == null || + !(imageView.getParent() instanceof View view)) { return; + } Logger.printDebug(() -> "enumString: " + enumString);