fix(YouTube/Hide player flyout menu): Sleep timer menu always hidden in YouTube 19.34.42

This commit is contained in:
inotia00
2024-12-15 14:21:40 +09:00
parent 9a962e441e
commit 969e845a87
6 changed files with 44 additions and 3 deletions

View File

@ -61,6 +61,23 @@ internal val pipModeConfigFingerprint = legacyFingerprint(
literals = listOf(45427407L),
)
internal const val SLEEP_TIMER_CONSTRUCTOR_FEATURE_FLAG = 45640654L
internal val sleepTimerConstructorFingerprint = legacyFingerprint(
name = "sleepTimerConstructorFingerprint",
returnType = "V",
accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
literals = listOf(SLEEP_TIMER_CONSTRUCTOR_FEATURE_FLAG),
)
internal const val SLEEP_TIMER_FEATURE_FLAG = 45630421L
internal val sleepTimerFingerprint = legacyFingerprint(
name = "sleepTimerConstructorFingerprint",
returnType = "Z",
literals = listOf(SLEEP_TIMER_FEATURE_FLAG),
)
internal val videoQualityArrayFingerprint = legacyFingerprint(
name = "videoQualityArrayFingerprint",
returnType = "[Lcom/google/android/libraries/youtube/innertube/model/media/VideoQuality;",

View File

@ -13,6 +13,7 @@ import app.revanced.patches.youtube.utils.extension.Constants.PLAYER_CLASS_DESCR
import app.revanced.patches.youtube.utils.patch.PatchList.HIDE_PLAYER_FLYOUT_MENU
import app.revanced.patches.youtube.utils.playertype.playerTypeHookPatch
import app.revanced.patches.youtube.utils.playservice.is_18_39_or_greater
import app.revanced.patches.youtube.utils.playservice.is_19_30_or_greater
import app.revanced.patches.youtube.utils.playservice.versionCheckPatch
import app.revanced.patches.youtube.utils.qualityMenuViewInflateFingerprint
import app.revanced.patches.youtube.utils.resourceid.bottomSheetFooterText
@ -125,6 +126,25 @@ val playerFlyoutMenuPatch = bytecodePatch(
// endregion
// region patch for hide sleep timer menu
if (is_19_30_or_greater) {
// Sleep timer menu in Additional settings (deprecated)
// TODO: A patch will be implemented to assign this deprecated menu to another action.
// mapOf(
// sleepTimerConstructorFingerprint to SLEEP_TIMER_CONSTRUCTOR_FEATURE_FLAG,
// sleepTimerFingerprint to SLEEP_TIMER_FEATURE_FLAG
// ).forEach { (fingerprint, literal) ->
// fingerprint.injectLiteralInstructionBooleanCall(
// literal,
// "$PLAYER_CLASS_DESCRIPTOR->hideDeprecatedSleepTimerMenu(Z)Z"
// )
// }
settingArray += "SETTINGS: HIDE_SLEEP_TIMER_MENU"
}
// endregion
addLithoFilter(PANELS_FILTER_CLASS_DESCRIPTOR)
// region add settings

View File

@ -29,6 +29,8 @@ var is_19_28_or_greater = false
private set
var is_19_29_or_greater = false
private set
var is_19_30_or_greater = false
private set
var is_19_32_or_greater = false
private set
var is_19_34_or_greater = false
@ -68,6 +70,7 @@ val versionCheckPatch = resourcePatch(
is_19_26_or_greater = 242705000 <= playStoreServicesVersion
is_19_28_or_greater = 242905000 <= playStoreServicesVersion
is_19_29_or_greater = 243005000 <= playStoreServicesVersion
is_19_30_or_greater = 243105000 <= playStoreServicesVersion
is_19_32_or_greater = 243305000 <= playStoreServicesVersion
is_19_34_or_greater = 243499000 <= playStoreServicesVersion
is_19_36_or_greater = 243705000 <= playStoreServicesVersion