mirror of
https://github.com/revanced/revanced-patches
synced 2024-12-03 01:33:20 +01:00
fix(youtube/spoof-signature-verification): fixed subtitles in wrong location (#1833)
This commit is contained in:
parent
0a858ecef3
commit
0dbfa6247e
@ -0,0 +1,11 @@
|
||||
package app.revanced.patches.youtube.misc.fix.playback.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
|
||||
object SubtitleWindowSettingsConstructorFingerprint : MethodFingerprint(
|
||||
parameters = listOf("I", "I", "I", "Z", "Z"),
|
||||
customFingerprint = { methodDef ->
|
||||
methodDef.definingClass == "Lcom/google/android/libraries/youtube/player/subtitles/model/SubtitleWindowSettings;"
|
||||
&& methodDef.name == "<init>"
|
||||
}
|
||||
)
|
@ -19,6 +19,7 @@ import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.youtube.misc.fix.playback.annotation.ProtobufSpoofCompatibility
|
||||
import app.revanced.patches.youtube.misc.fix.playback.fingerprints.OpenCronetDataSourceFingerprint
|
||||
import app.revanced.patches.youtube.misc.fix.playback.fingerprints.ProtobufParameterBuilderFingerprint
|
||||
import app.revanced.patches.youtube.misc.fix.playback.fingerprints.SubtitleWindowSettingsConstructorFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.playertype.patch.PlayerTypeHookPatch
|
||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||
@ -34,6 +35,7 @@ class SpoofSignatureVerificationPatch : BytecodePatch(
|
||||
listOf(
|
||||
ProtobufParameterBuilderFingerprint,
|
||||
OpenCronetDataSourceFingerprint,
|
||||
SubtitleWindowSettingsConstructorFingerprint,
|
||||
)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
@ -83,6 +85,25 @@ class SpoofSignatureVerificationPatch : BytecodePatch(
|
||||
|
||||
} ?: return OpenCronetDataSourceFingerprint.toErrorResult()
|
||||
|
||||
// hook override subtitles
|
||||
SubtitleWindowSettingsConstructorFingerprint.result?.let {
|
||||
it.mutableMethod.apply {
|
||||
addInstructions(
|
||||
0,
|
||||
"""
|
||||
invoke-static {p1, p2, p3, p4, p5}, $INTEGRATIONS_CLASS_DESCRIPTOR->getSubtitleWindowSettingsOverride(IIIZZ)[I
|
||||
move-result-object v0
|
||||
const/4 v1, 0x0
|
||||
aget p1, v0, v1 # ap, anchor configuration
|
||||
const/4 v1, 0x1
|
||||
aget p2, v0, v1 # ah, horizontal anchor
|
||||
const/4 v1, 0x2
|
||||
aget p3, v0, v1 # av, vertical anchor
|
||||
"""
|
||||
)
|
||||
}
|
||||
} ?: return SubtitleWindowSettingsConstructorFingerprint.toErrorResult()
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user