mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-06-12 13:17:46 +02:00
feat(YouTube/Player components): add Speed overlay value
settings
This commit is contained in:
@ -23,6 +23,7 @@ import app.revanced.patches.youtube.player.components.fingerprints.LayoutVideoFi
|
||||
import app.revanced.patches.youtube.player.components.fingerprints.RestoreSlideToSeekBehaviorFingerprint
|
||||
import app.revanced.patches.youtube.player.components.fingerprints.SeekEduContainerFingerprint
|
||||
import app.revanced.patches.youtube.player.components.fingerprints.SpeedOverlayFingerprint
|
||||
import app.revanced.patches.youtube.player.components.fingerprints.SpeedOverlayValueFingerprint
|
||||
import app.revanced.patches.youtube.player.components.fingerprints.SuggestedActionsFingerprint
|
||||
import app.revanced.patches.youtube.player.components.fingerprints.TouchAreaOnClickListenerFingerprint
|
||||
import app.revanced.patches.youtube.player.components.fingerprints.WatermarkFingerprint
|
||||
@ -77,6 +78,7 @@ object PlayerComponentsPatch : BaseBytecodePatch(
|
||||
RestoreSlideToSeekBehaviorFingerprint,
|
||||
SeekEduContainerFingerprint,
|
||||
SpeedOverlayFingerprint,
|
||||
SpeedOverlayValueFingerprint,
|
||||
SuggestedActionsFingerprint,
|
||||
TouchAreaOnClickListenerFingerprint,
|
||||
WatermarkParentFingerprint,
|
||||
@ -129,7 +131,7 @@ object PlayerComponentsPatch : BaseBytecodePatch(
|
||||
|
||||
// endregion
|
||||
|
||||
// region patch for disable speed overlay
|
||||
// region patch for disable speed overlay and speed overlay value
|
||||
|
||||
mapOf(
|
||||
RestoreSlideToSeekBehaviorFingerprint to 45411329,
|
||||
@ -141,6 +143,20 @@ object PlayerComponentsPatch : BaseBytecodePatch(
|
||||
)
|
||||
}
|
||||
|
||||
SpeedOverlayValueFingerprint.resultOrThrow().let {
|
||||
it.mutableMethod.apply {
|
||||
val index = it.scanResult.patternScanResult!!.startIndex
|
||||
val register = getInstruction<TwoRegisterInstruction>(index).registerA
|
||||
|
||||
addInstructions(
|
||||
index + 1, """
|
||||
invoke-static {v$register}, $PLAYER_CLASS_DESCRIPTOR->speedOverlayValue(F)F
|
||||
move-result v$register
|
||||
"""
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// endregion
|
||||
|
||||
// region patch for hide channel watermark
|
||||
|
@ -0,0 +1,16 @@
|
||||
package app.revanced.patches.youtube.player.components.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.util.fingerprint.LiteralValueFingerprint
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
|
||||
/**
|
||||
* This value is the key for the playback speed overlay value.
|
||||
*/
|
||||
internal object SpeedOverlayValueFingerprint : LiteralValueFingerprint(
|
||||
returnType = "V",
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
|
||||
opcodes = listOf(Opcode.DOUBLE_TO_FLOAT),
|
||||
literalSupplier = { 45411328 }
|
||||
)
|
Reference in New Issue
Block a user