mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-06-12 05:07:41 +02:00
feat(YouTube - Navigation bar components): Separate Enable translucent navigation bar
setting into Disable light translucent bar
and Disable dark translucent bar
settings
This commit is contained in:
@ -74,7 +74,23 @@ internal val setEnumMapFingerprint = legacyFingerprint(
|
||||
literals = listOf(ytFillBell),
|
||||
)
|
||||
|
||||
internal val translucentNavigationBarFingerprint = legacyFingerprint(
|
||||
name = "translucentNavigationBarFingerprint",
|
||||
literals = listOf(45630927L),
|
||||
internal const val TRANSLUCENT_NAVIGATION_BUTTONS_FEATURE_FLAG = 45630927L
|
||||
|
||||
internal val translucentNavigationButtonsFeatureFlagFingerprint = legacyFingerprint(
|
||||
name = "translucentNavigationButtonsFeatureFlagFingerprint",
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
returnType = "V",
|
||||
literals = listOf(TRANSLUCENT_NAVIGATION_BUTTONS_FEATURE_FLAG)
|
||||
)
|
||||
|
||||
/**
|
||||
* The device on screen back/home/recent buttons.
|
||||
*/
|
||||
internal const val TRANSLUCENT_NAVIGATION_BUTTONS_SYSTEM_FEATURE_FLAG = 45632194L
|
||||
|
||||
internal val translucentNavigationButtonsSystemFeatureFlagFingerprint = legacyFingerprint(
|
||||
name = "translucentNavigationButtonsSystemFeatureFlagFingerprint",
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
returnType = "Z",
|
||||
literals = listOf(TRANSLUCENT_NAVIGATION_BUTTONS_SYSTEM_FEATURE_FLAG)
|
||||
)
|
@ -11,7 +11,7 @@ import app.revanced.patches.youtube.utils.navigation.addBottomBarContainerHook
|
||||
import app.revanced.patches.youtube.utils.navigation.hookNavigationButtonCreated
|
||||
import app.revanced.patches.youtube.utils.navigation.navigationBarHookPatch
|
||||
import app.revanced.patches.youtube.utils.patch.PatchList.NAVIGATION_BAR_COMPONENTS
|
||||
import app.revanced.patches.youtube.utils.playservice.is_19_23_or_greater
|
||||
import app.revanced.patches.youtube.utils.playservice.is_19_25_or_greater
|
||||
import app.revanced.patches.youtube.utils.playservice.is_19_28_or_greater
|
||||
import app.revanced.patches.youtube.utils.playservice.versionCheckPatch
|
||||
import app.revanced.patches.youtube.utils.resourceid.sharedResourceIdPatch
|
||||
@ -84,11 +84,24 @@ val navigationBarComponentsPatch = bytecodePatch(
|
||||
|
||||
// region patch for enable translucent navigation bar
|
||||
|
||||
if (is_19_23_or_greater) {
|
||||
translucentNavigationBarFingerprint.injectLiteralInstructionBooleanCall(
|
||||
45630927L,
|
||||
"$GENERAL_CLASS_DESCRIPTOR->enableTranslucentNavigationBar()Z"
|
||||
)
|
||||
if (is_19_25_or_greater) {
|
||||
arrayOf(
|
||||
Triple(
|
||||
translucentNavigationButtonsFeatureFlagFingerprint,
|
||||
TRANSLUCENT_NAVIGATION_BUTTONS_FEATURE_FLAG,
|
||||
"useTranslucentNavigationButtons"
|
||||
),
|
||||
Triple(
|
||||
translucentNavigationButtonsSystemFeatureFlagFingerprint,
|
||||
TRANSLUCENT_NAVIGATION_BUTTONS_SYSTEM_FEATURE_FLAG,
|
||||
"useTranslucentNavigationButtons"
|
||||
)
|
||||
).forEach {
|
||||
it.first.injectLiteralInstructionBooleanCall(
|
||||
it.second,
|
||||
"$GENERAL_CLASS_DESCRIPTOR->${it.third}(Z)Z"
|
||||
)
|
||||
}
|
||||
|
||||
settingArray += "SETTINGS: TRANSLUCENT_NAVIGATION_BAR"
|
||||
}
|
||||
|
Reference in New Issue
Block a user