Skip to content

Commit

Permalink
fix(YouTube): Patched app crashes after first launch or clearing data i…
Browse files Browse the repository at this point in the history
  • Loading branch information
inotia00 committed Dec 22, 2024
1 parent 89d038f commit bbd121c
Showing 1 changed file with 24 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,12 @@ public static void hideNavigationBar(View view) {
}

public static boolean useTranslucentNavigationStatusBar(boolean original) {
if (Settings.DISABLE_TRANSLUCENT_STATUS_BAR.get()) {
return false;
try {
if (Settings.DISABLE_TRANSLUCENT_STATUS_BAR.get()) {
return false;
}
} catch (Exception ex) {
Logger.printException(() -> "Failed to load useTranslucentNavigationStatusBar", ex);
}

return original;
Expand All @@ -260,22 +264,27 @@ public static boolean useTranslucentNavigationStatusBar(boolean original) {
= Settings.DISABLE_TRANSLUCENT_NAVIGATION_BAR_DARK.get();

public static boolean useTranslucentNavigationButtons(boolean original) {
// Feature requires Android 13+
if (!isSDKAbove(33)) {
return original;
}
try {
// Feature requires Android 13+
if (!isSDKAbove(33)) {
return original;
}

if (!DISABLE_TRANSLUCENT_NAVIGATION_BAR_DARK && !DISABLE_TRANSLUCENT_NAVIGATION_BAR_LIGHT) {
return original;
}
if (!DISABLE_TRANSLUCENT_NAVIGATION_BAR_DARK && !DISABLE_TRANSLUCENT_NAVIGATION_BAR_LIGHT) {
return original;
}

if (DISABLE_TRANSLUCENT_NAVIGATION_BAR_DARK && DISABLE_TRANSLUCENT_NAVIGATION_BAR_LIGHT) {
return false;
}
if (DISABLE_TRANSLUCENT_NAVIGATION_BAR_DARK && DISABLE_TRANSLUCENT_NAVIGATION_BAR_LIGHT) {
return false;
}

return Utils.isDarkModeEnabled()
? !DISABLE_TRANSLUCENT_NAVIGATION_BAR_DARK
: !DISABLE_TRANSLUCENT_NAVIGATION_BAR_LIGHT;
return Utils.isDarkModeEnabled()
? !DISABLE_TRANSLUCENT_NAVIGATION_BAR_DARK
: !DISABLE_TRANSLUCENT_NAVIGATION_BAR_LIGHT;
} catch (Exception ex) {
Logger.printException(() -> "Failed to load useTranslucentNavigationButtons", ex);
}
return original;
}

// endregion
Expand Down

0 comments on commit bbd121c

Please sign in to comment.