fix(YouTube - Shorts components): When Shorts repeat state is AutoPlay, HUD is hidden (YouTube 19.34+) https://github.com/ReVanced/revanced-patches/issues/4426

This commit is contained in:
inotia00 2025-02-10 17:52:11 +09:00
parent 0ece1b9aea
commit 57dda609de
2 changed files with 24 additions and 1 deletions

View File

@ -71,6 +71,19 @@ internal val reelEnumStaticFingerprint = legacyFingerprint(
returnType = "L"
)
internal const val SHORTS_HUD_FEATURE_FLAG = 45644023L
/**
* Fix [HUD is hidden](https://github.com/ReVanced/revanced-patches/issues/4426)
*/
internal val shortsHUDFeatureFingerprint = legacyFingerprint(
name = "shortsHUDFeatureFingerprint",
returnType = "Z",
parameters = emptyList(),
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
literals = listOf(SHORTS_HUD_FEATURE_FLAG),
)
internal val reelFeedbackFingerprint = legacyFingerprint(
name = "reelFeedbackFingerprint",
returnType = "V",

View File

@ -393,7 +393,10 @@ private val shortsRepeatPatch = bytecodePatch(
description = "shortsRepeatPatch"
) {
execute {
dependsOn(mainActivityResolvePatch)
dependsOn(
mainActivityResolvePatch,
versionCheckPatch,
)
injectOnCreateMethodCall(
EXTENSION_REPEAT_STATE_CLASS_DESCRIPTOR,
@ -462,6 +465,13 @@ private val shortsRepeatPatch = bytecodePatch(
}
}
}
if (is_19_34_or_greater) {
shortsHUDFeatureFingerprint.injectLiteralInstructionBooleanCall(
SHORTS_HUD_FEATURE_FLAG,
"0x0"
)
}
}
}