fix(YouTube/Return YouTube Dislike): RYD prefetching home feed Shorts

This commit is contained in:
inotia00 2023-10-27 14:10:17 +09:00
parent bd19a48106
commit 2253ed321a
3 changed files with 7 additions and 4 deletions

View File

@ -19,7 +19,7 @@ object PlayerParameterBuilderFingerprint : MethodFingerprint(
"Ljava/lang/String;",
"Ljava/lang/String;",
"L",
"Z",
"Z", // Appears to indicate if the video id is being opened or is currently playing.
"Z",
"Z"
),

View File

@ -10,6 +10,9 @@ import app.revanced.patches.youtube.utils.fingerprints.PlayerParameterBuilderFin
object PlayerResponsePatch : BytecodePatch(
setOf(PlayerParameterBuilderFingerprint)
) {
private const val VIDEO_ID_PARAMETER = 1
private const val VIDEO_IS_OPENING_OR_PLAYING_PARAMETER = 11
private lateinit var insertMethod: MutableMethod
/**
@ -21,7 +24,7 @@ object PlayerResponsePatch : BytecodePatch(
) {
insertMethod.addInstructions(
0, // move-result-object offset
"invoke-static {p1}, $methodDescriptor"
"invoke-static {p$VIDEO_ID_PARAMETER, p$VIDEO_IS_OPENING_OR_PLAYING_PARAMETER}, $methodDescriptor"
)
}

View File

@ -191,10 +191,10 @@ object ReturnYouTubeDislikePatch : BytecodePatch(
if (SettingsPatch.upward1834) {
LithoFilterPatch.addFilter(FILTER_CLASS_DESCRIPTOR)
PlayerResponsePatch.injectCall("$FILTER_CLASS_DESCRIPTOR->newPlayerResponseVideoId(Ljava/lang/String;Z)V")
}
PlayerResponsePatch.injectCall("$FILTER_CLASS_DESCRIPTOR->newPlayerResponseVideoId(Ljava/lang/String;)V")
PlayerResponsePatch.injectCall("$INTEGRATIONS_RYD_CLASS_DESCRIPTOR->preloadVideoId(Ljava/lang/String;)V")
PlayerResponsePatch.injectCall("$INTEGRATIONS_RYD_CLASS_DESCRIPTOR->preloadVideoId(Ljava/lang/String;Z)V")
VideoIdPatch.injectCall("$INTEGRATIONS_RYD_CLASS_DESCRIPTOR->newVideoLoaded(Ljava/lang/String;)V")
/**