mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-22 09:17:17 +02:00
rollback(YouTube/VideoInformation): changes the video time to be invoked every 1000ms instead of 100ms
This commit is contained in:
parent
01795e0fb4
commit
1a0d125734
@ -22,13 +22,13 @@ import app.revanced.patches.youtube.video.information.fingerprints.ChannelNameFi
|
||||
import app.revanced.patches.youtube.video.information.fingerprints.OnPlaybackSpeedItemClickFingerprint
|
||||
import app.revanced.patches.youtube.video.information.fingerprints.PlaybackInitializationFingerprint
|
||||
import app.revanced.patches.youtube.video.information.fingerprints.PlaybackSpeedClassFingerprint
|
||||
import app.revanced.patches.youtube.video.information.fingerprints.PlayerControllerSetTimeReferenceFingerprint
|
||||
import app.revanced.patches.youtube.video.information.fingerprints.VideoIdFingerprint
|
||||
import app.revanced.patches.youtube.video.information.fingerprints.VideoIdFingerprintBackgroundPlay
|
||||
import app.revanced.patches.youtube.video.information.fingerprints.VideoIdFingerprintShorts
|
||||
import app.revanced.patches.youtube.video.information.fingerprints.VideoLengthFingerprint
|
||||
import app.revanced.patches.youtube.video.information.fingerprints.VideoQualityListFingerprint
|
||||
import app.revanced.patches.youtube.video.information.fingerprints.VideoQualityTextFingerprint
|
||||
import app.revanced.patches.youtube.video.information.fingerprints.VideoTimeFingerprint
|
||||
import app.revanced.patches.youtube.video.information.fingerprints.VideoTitleFingerprint
|
||||
import app.revanced.patches.youtube.video.playerresponse.PlayerResponseMethodHookPatch
|
||||
import app.revanced.patches.youtube.video.videoid.VideoIdPatch
|
||||
@ -68,6 +68,7 @@ object VideoInformationPatch : BytecodePatch(
|
||||
OrganicPlaybackContextModelFingerprint,
|
||||
PlaybackInitializationFingerprint,
|
||||
PlaybackSpeedClassFingerprint,
|
||||
PlayerControllerSetTimeReferenceFingerprint,
|
||||
VideoEndFingerprint,
|
||||
VideoIdFingerprint,
|
||||
VideoIdFingerprintBackgroundPlay,
|
||||
@ -109,6 +110,9 @@ object VideoInformationPatch : BytecodePatch(
|
||||
private lateinit var playerConstructorMethod: MutableMethod
|
||||
private var playerConstructorInsertIndex = 4
|
||||
|
||||
private lateinit var videoTimeConstructorMethod: MutableMethod
|
||||
private var videoTimeConstructorInsertIndex = 2
|
||||
|
||||
private lateinit var videoTimeMethod: MutableMethod
|
||||
private var videoTimeIndex = 1
|
||||
|
||||
@ -121,9 +125,6 @@ object VideoInformationPatch : BytecodePatch(
|
||||
|
||||
VideoEndFingerprint.resultOrThrow().let {
|
||||
|
||||
// resolve video time fingerprint
|
||||
VideoTimeFingerprint.resolve(context, it.classDef)
|
||||
|
||||
playerConstructorMethod =
|
||||
it.mutableClass.methods.first { method -> MethodUtil.isConstructor(method) }
|
||||
|
||||
@ -251,12 +252,9 @@ object VideoInformationPatch : BytecodePatch(
|
||||
/**
|
||||
* Set current video time method
|
||||
*/
|
||||
VideoTimeFingerprint.resultOrThrow().mutableMethod.apply {
|
||||
videoTimeMethod = this
|
||||
addInstruction(
|
||||
0,
|
||||
"move-wide/from16 v0, p5"
|
||||
)
|
||||
PlayerControllerSetTimeReferenceFingerprint.resultOrThrow().let {
|
||||
videoTimeConstructorMethod =
|
||||
it.getWalkerMethod(context, it.scanResult.patternScanResult!!.startIndex)
|
||||
}
|
||||
|
||||
/**
|
||||
@ -446,9 +444,9 @@ object VideoInformationPatch : BytecodePatch(
|
||||
* @param targetMethodName The name of the static method to invoke when the player controller is created.
|
||||
*/
|
||||
internal fun videoTimeHook(targetMethodClass: String, targetMethodName: String) =
|
||||
videoTimeMethod.addInstruction(
|
||||
videoTimeIndex++,
|
||||
"invoke-static { v0, v1 }, $targetMethodClass->$targetMethodName(J)V"
|
||||
videoTimeConstructorMethod.addInstruction(
|
||||
videoTimeConstructorInsertIndex++,
|
||||
"invoke-static { p1, p2 }, $targetMethodClass->$targetMethodName(J)V"
|
||||
)
|
||||
|
||||
private fun MethodFingerprint.getMethodName(returnType : String) :String {
|
||||
|
@ -0,0 +1,12 @@
|
||||
package app.revanced.patches.youtube.video.information.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
|
||||
object PlayerControllerSetTimeReferenceFingerprint : MethodFingerprint(
|
||||
opcodes = listOf(
|
||||
Opcode.INVOKE_DIRECT_RANGE,
|
||||
Opcode.IGET_OBJECT
|
||||
),
|
||||
strings = listOf("Media progress reported outside media playback: ")
|
||||
)
|
@ -1,11 +0,0 @@
|
||||
package app.revanced.patches.youtube.video.information.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
|
||||
internal object VideoTimeFingerprint : MethodFingerprint(
|
||||
returnType = "V",
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
parameters = listOf("L", "I", "J", "J", "J", "J")
|
||||
)
|
Loading…
x
Reference in New Issue
Block a user