diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/navigation/NavigationBarComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/general/navigation/NavigationBarComponentsPatch.kt
index cc81f0930..51d27430c 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/general/navigation/NavigationBarComponentsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/general/navigation/NavigationBarComponentsPatch.kt
@@ -8,12 +8,14 @@ import app.revanced.patches.youtube.general.navigation.fingerprints.AutoMotiveFi
import app.revanced.patches.youtube.general.navigation.fingerprints.PivotBarChangedFingerprint
import app.revanced.patches.youtube.general.navigation.fingerprints.PivotBarSetTextFingerprint
import app.revanced.patches.youtube.general.navigation.fingerprints.PivotBarStyleFingerprint
+import app.revanced.patches.youtube.general.navigation.fingerprints.TranslucentNavigationBarFingerprint
import app.revanced.patches.youtube.utils.compatibility.Constants.COMPATIBLE_PACKAGE
import app.revanced.patches.youtube.utils.integrations.Constants.GENERAL_CLASS_DESCRIPTOR
import app.revanced.patches.youtube.utils.navigation.NavigationBarHookPatch
import app.revanced.patches.youtube.utils.settings.SettingsPatch
import app.revanced.util.getStringInstructionIndex
import app.revanced.util.getTargetIndexWithMethodReferenceNameOrThrow
+import app.revanced.util.literalInstructionBooleanHook
import app.revanced.util.patch.BaseBytecodePatch
import app.revanced.util.resultOrThrow
import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
@@ -32,11 +34,30 @@ object NavigationBarComponentsPatch : BaseBytecodePatch(
AutoMotiveFingerprint,
PivotBarChangedFingerprint,
PivotBarSetTextFingerprint,
- PivotBarStyleFingerprint
+ PivotBarStyleFingerprint,
+ TranslucentNavigationBarFingerprint
)
) {
override fun execute(context: BytecodeContext) {
+ var settingArray = arrayOf(
+ "PREFERENCE_SCREEN: GENERAL",
+ "SETTINGS: HIDE_NAVIGATION_COMPONENTS"
+ )
+
+ // region patch for enable translucent navigation bar
+
+ if (SettingsPatch.upward1923) {
+ TranslucentNavigationBarFingerprint.literalInstructionBooleanHook(
+ 45630927,
+ "$GENERAL_CLASS_DESCRIPTOR->enableTranslucentNavigationBar()Z"
+ )
+
+ settingArray += "SETTINGS: TRANSLUCENT_NAVIGATION_BAR"
+ }
+
+ // endregion
+
// region patch for enable narrow navigation buttons
arrayOf(
@@ -101,12 +122,7 @@ object NavigationBarComponentsPatch : BaseBytecodePatch(
/**
* Add settings
*/
- SettingsPatch.addPreference(
- arrayOf(
- "PREFERENCE_SCREEN: GENERAL",
- "SETTINGS: HIDE_NAVIGATION_COMPONENTS"
- )
- )
+ SettingsPatch.addPreference(settingArray)
SettingsPatch.updatePatchStatus(this)
}
diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/navigation/fingerprints/TranslucentNavigationBarFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/general/navigation/fingerprints/TranslucentNavigationBarFingerprint.kt
new file mode 100644
index 000000000..eb917d081
--- /dev/null
+++ b/src/main/kotlin/app/revanced/patches/youtube/general/navigation/fingerprints/TranslucentNavigationBarFingerprint.kt
@@ -0,0 +1,7 @@
+package app.revanced.patches.youtube.general.navigation.fingerprints
+
+import app.revanced.util.fingerprint.LiteralValueFingerprint
+
+internal object TranslucentNavigationBarFingerprint : LiteralValueFingerprint(
+ literalSupplier = { 45630927 }
+)
\ No newline at end of file
diff --git a/src/main/resources/youtube/settings/host/values/strings.xml b/src/main/resources/youtube/settings/host/values/strings.xml
index bdda0ee0e..e1a9470b7 100644
--- a/src/main/resources/youtube/settings/host/values/strings.xml
+++ b/src/main/resources/youtube/settings/host/values/strings.xml
@@ -428,6 +428,10 @@ Some components may not be hidden."
• Disabling this setting loads more ads from the server side.
• You should disable this setting to make video ads visible."
+ Enable translucent navigation bar
+ Navigation bar is translucent.
+ Navigation bar is opaque.
+
Settings menu
Hide elements of the YouTube settings menu.
diff --git a/src/main/resources/youtube/settings/xml/revanced_prefs.xml b/src/main/resources/youtube/settings/xml/revanced_prefs.xml
index 4f251df7a..8334c0b6e 100644
--- a/src/main/resources/youtube/settings/xml/revanced_prefs.xml
+++ b/src/main/resources/youtube/settings/xml/revanced_prefs.xml
@@ -143,7 +143,13 @@
-
+ SETTINGS: HIDE_NAVIGATION_COMPONENTS -->
+
+
+
+