mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-06-12 05:07:41 +02:00
feat(YouTube - Hide layout components): Add Disable translucent status bar
setting
This commit is contained in:
@ -134,3 +134,12 @@ internal val tooltipContentViewFingerprint = legacyFingerprint(
|
||||
literals = listOf(toolTipContentView),
|
||||
)
|
||||
|
||||
internal const val TRANSLUCENT_STATUS_BAR_FEATURE_FLAG = 45400535L
|
||||
|
||||
internal val translucentStatusBarFeatureFlagFingerprint = legacyFingerprint(
|
||||
name = "translucentStatusBarFeatureFlagFingerprint",
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
returnType = "Z",
|
||||
literals = listOf(TRANSLUCENT_STATUS_BAR_FEATURE_FLAG)
|
||||
)
|
||||
|
||||
|
@ -17,10 +17,13 @@ import app.revanced.patches.youtube.utils.extension.Constants.COMPONENTS_PATH
|
||||
import app.revanced.patches.youtube.utils.extension.Constants.GENERAL_CLASS_DESCRIPTOR
|
||||
import app.revanced.patches.youtube.utils.extension.Constants.GENERAL_PATH
|
||||
import app.revanced.patches.youtube.utils.patch.PatchList.HIDE_LAYOUT_COMPONENTS
|
||||
import app.revanced.patches.youtube.utils.playservice.is_19_25_or_greater
|
||||
import app.revanced.patches.youtube.utils.playservice.versionCheckPatch
|
||||
import app.revanced.patches.youtube.utils.resourceid.accountSwitcherAccessibility
|
||||
import app.revanced.patches.youtube.utils.resourceid.sharedResourceIdPatch
|
||||
import app.revanced.patches.youtube.utils.settings.ResourceUtils.addPreference
|
||||
import app.revanced.patches.youtube.utils.settings.settingsPatch
|
||||
import app.revanced.util.fingerprint.injectLiteralInstructionBooleanCall
|
||||
import app.revanced.util.fingerprint.matchOrThrow
|
||||
import app.revanced.util.fingerprint.methodOrThrow
|
||||
import app.revanced.util.fingerprint.mutableClassOrThrow
|
||||
@ -55,10 +58,16 @@ val layoutComponentsPatch = bytecodePatch(
|
||||
sharedResourceIdPatch,
|
||||
settingsMenuPatch,
|
||||
viewGroupMarginLayoutParamsHookPatch,
|
||||
versionCheckPatch,
|
||||
)
|
||||
|
||||
execute {
|
||||
|
||||
var settingArray = arrayOf(
|
||||
"PREFERENCE_SCREEN: GENERAL",
|
||||
"SETTINGS: HIDE_LAYOUT_COMPONENTS"
|
||||
)
|
||||
|
||||
// region patch for disable pip notification
|
||||
|
||||
pipNotificationFingerprint.matchOrThrow().let {
|
||||
@ -86,6 +95,19 @@ val layoutComponentsPatch = bytecodePatch(
|
||||
|
||||
// endregion
|
||||
|
||||
// region patch for disable translucent status bar
|
||||
|
||||
if (is_19_25_or_greater) {
|
||||
translucentStatusBarFeatureFlagFingerprint.injectLiteralInstructionBooleanCall(
|
||||
TRANSLUCENT_STATUS_BAR_FEATURE_FLAG,
|
||||
"$GENERAL_CLASS_DESCRIPTOR->disableTranslucentStatusBar(Z)Z"
|
||||
)
|
||||
|
||||
settingArray += "SETTINGS: DISABLE_TRANSLUCENT_STATUS_BAR"
|
||||
}
|
||||
|
||||
// endregion
|
||||
|
||||
// region patch for disable update screen
|
||||
|
||||
appBlockingCheckResultToStringFingerprint.mutableClassOrThrow().methods.first { method ->
|
||||
@ -234,10 +256,7 @@ val layoutComponentsPatch = bytecodePatch(
|
||||
// region add settings
|
||||
|
||||
addPreference(
|
||||
arrayOf(
|
||||
"PREFERENCE_SCREEN: GENERAL",
|
||||
"SETTINGS: HIDE_LAYOUT_COMPONENTS"
|
||||
),
|
||||
settingArray,
|
||||
HIDE_LAYOUT_COMPONENTS
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user