mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-25 11:22:12 +02:00
refactor(force-vp9-codec): integrate lift-vertical-video-restriction
patch https://github.com/inotia00/ReVanced_Extended/issues/883
This commit is contained in:
parent
be0bb9f948
commit
0448b8aea0
@ -0,0 +1,15 @@
|
|||||||
|
package app.revanced.patches.youtube.misc.forcevp9.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
|
object VideoCapabilitiesFingerprint : MethodFingerprint(
|
||||||
|
returnType = "V",
|
||||||
|
opcodes = listOf(
|
||||||
|
Opcode.IPUT,
|
||||||
|
Opcode.IPUT,
|
||||||
|
Opcode.IPUT,
|
||||||
|
Opcode.IPUT
|
||||||
|
),
|
||||||
|
customFingerprint = { it.name == "<init>" }
|
||||||
|
)
|
@ -0,0 +1,8 @@
|
|||||||
|
package app.revanced.patches.youtube.misc.forcevp9.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
|
||||||
|
object VideoCapabilitiesParentFingerprint : MethodFingerprint(
|
||||||
|
returnType = "L",
|
||||||
|
strings = listOf("minh.", ";maxh.")
|
||||||
|
)
|
@ -35,6 +35,7 @@ import org.jf.dexlib2.iface.instruction.ReferenceInstruction
|
|||||||
class ForceVP9CodecPatch : BytecodePatch(
|
class ForceVP9CodecPatch : BytecodePatch(
|
||||||
listOf(
|
listOf(
|
||||||
LayoutSwitchFingerprint,
|
LayoutSwitchFingerprint,
|
||||||
|
VideoCapabilitiesParentFingerprint,
|
||||||
Vp9PropsParentFingerprint
|
Vp9PropsParentFingerprint
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
@ -61,6 +62,26 @@ class ForceVP9CodecPatch : BytecodePatch(
|
|||||||
} ?: return Vp9PropsFingerprint.toErrorResult()
|
} ?: return Vp9PropsFingerprint.toErrorResult()
|
||||||
} ?: return Vp9PropsParentFingerprint.toErrorResult()
|
} ?: return Vp9PropsParentFingerprint.toErrorResult()
|
||||||
|
|
||||||
|
VideoCapabilitiesParentFingerprint.result?.let { parentResult ->
|
||||||
|
VideoCapabilitiesFingerprint.also { it.resolve(context, parentResult.classDef) }.result?.let {
|
||||||
|
with (it.mutableMethod) {
|
||||||
|
val insertIndex = it.scanResult.patternScanResult!!.startIndex
|
||||||
|
addInstructions(
|
||||||
|
insertIndex, """
|
||||||
|
invoke-static {p1}, $INTEGRATIONS_CLASS_DESCRIPTOR->overrideMinHeight(I)I
|
||||||
|
move-result p1
|
||||||
|
invoke-static {p2}, $INTEGRATIONS_CLASS_DESCRIPTOR->overrideMaxHeight(I)I
|
||||||
|
move-result p2
|
||||||
|
invoke-static {p3}, $INTEGRATIONS_CLASS_DESCRIPTOR->overrideMinWidth(I)I
|
||||||
|
move-result p3
|
||||||
|
invoke-static {p4}, $INTEGRATIONS_CLASS_DESCRIPTOR->overrideMaxWidth(I)I
|
||||||
|
move-result p4
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
}
|
||||||
|
} ?: return VideoCapabilitiesFingerprint.toErrorResult()
|
||||||
|
} ?: return VideoCapabilitiesParentFingerprint.toErrorResult()
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Add settings
|
* Add settings
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user