mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-06-12 21:27:43 +02:00
add Disable default video speed in live stream
settings https://github.com/inotia00/ReVanced_Extended/issues/626
This commit is contained in:
@ -0,0 +1,8 @@
|
||||
package app.revanced.patches.youtube.video.livestream.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
|
||||
object OrganicPlaybackContextModelFingerprint : MethodFingerprint(
|
||||
returnType = "V",
|
||||
strings = listOf("Null contentCpn")
|
||||
)
|
@ -0,0 +1,38 @@
|
||||
package app.revanced.patches.youtube.video.livestream.patch
|
||||
|
||||
import app.revanced.extensions.toErrorResult
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.addInstruction
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patches.shared.annotation.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.video.livestream.fingerprints.OrganicPlaybackContextModelFingerprint
|
||||
import app.revanced.util.integrations.Constants.VIDEO_PATH
|
||||
|
||||
@Name("live-stream-speed")
|
||||
@YouTubeCompatibility
|
||||
@Version("0.0.1")
|
||||
class LiveStreamPatch : BytecodePatch(
|
||||
listOf(
|
||||
OrganicPlaybackContextModelFingerprint
|
||||
)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
|
||||
OrganicPlaybackContextModelFingerprint.result?.mutableMethod?.addInstruction(
|
||||
2,
|
||||
"invoke-static { p2 }, $INTEGRATIONS_VIDEO_SPEED_CLASS_DESCRIPTOR->liveStreamObserver(Z)V"
|
||||
) ?: return OrganicPlaybackContextModelFingerprint.toErrorResult()
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
|
||||
private companion object {
|
||||
const val INTEGRATIONS_VIDEO_SPEED_CLASS_DESCRIPTOR =
|
||||
"$VIDEO_PATH/VideoSpeedPatch;"
|
||||
}
|
||||
|
||||
}
|
@ -14,6 +14,7 @@ import app.revanced.patches.youtube.misc.overridespeed.bytecode.fingerprints.Vid
|
||||
import app.revanced.patches.youtube.misc.overridespeed.bytecode.patch.OverrideSpeedHookPatch
|
||||
import app.revanced.patches.youtube.misc.resourceid.patch.SharedResourceIdPatch
|
||||
import app.revanced.patches.youtube.misc.videoid.legacy.patch.LegacyVideoIdPatch
|
||||
import app.revanced.patches.youtube.video.livestream.patch.LiveStreamPatch
|
||||
import app.revanced.patches.youtube.video.speed.bytecode.fingerprints.*
|
||||
import app.revanced.util.bytecode.BytecodeHelper.updatePatchStatus
|
||||
import app.revanced.util.integrations.Constants.VIDEO_PATH
|
||||
@ -23,6 +24,7 @@ import org.jf.dexlib2.iface.instruction.FiveRegisterInstruction
|
||||
@DependsOn(
|
||||
[
|
||||
LegacyVideoIdPatch::class,
|
||||
LiveStreamPatch::class,
|
||||
OverrideSpeedHookPatch::class,
|
||||
SharedResourceIdPatch::class
|
||||
]
|
||||
@ -64,6 +66,5 @@ class VideoSpeedBytecodePatch : BytecodePatch(
|
||||
private companion object {
|
||||
const val INTEGRATIONS_VIDEO_SPEED_CLASS_DESCRIPTOR =
|
||||
"$VIDEO_PATH/VideoSpeedPatch;"
|
||||
var insertIndex: Int = 0
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user