From 2a0fa0b615606bc78e687917ce8e8fff57ddbee7 Mon Sep 17 00:00:00 2001 From: inotia00 Date: Tue, 14 Mar 2023 10:37:26 +0900 Subject: [PATCH] rollback(default-video-speed): default video speed does not apply when playing live video --- .../fingerprints/LiveLabelFingerprint.kt | 23 ------------------- .../bytecode/patch/VideoSpeedBytecodePatch.kt | 22 ------------------ 2 files changed, 45 deletions(-) delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/video/speed/bytecode/fingerprints/LiveLabelFingerprint.kt diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/speed/bytecode/fingerprints/LiveLabelFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/video/speed/bytecode/fingerprints/LiveLabelFingerprint.kt deleted file mode 100644 index ce97373fe..000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/video/speed/bytecode/fingerprints/LiveLabelFingerprint.kt +++ /dev/null @@ -1,23 +0,0 @@ -package app.revanced.patches.youtube.video.speed.bytecode.fingerprints - -import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint -import app.revanced.patches.youtube.misc.resourceid.patch.SharedResourceIdPatch -import org.jf.dexlib2.iface.instruction.WideLiteralInstruction -import org.jf.dexlib2.Opcode - -object LiveLabelFingerprint : MethodFingerprint( - returnType = "V", - opcodes = listOf( - Opcode.IGET_OBJECT, - Opcode.IF_NEZ, - Opcode.RETURN_VOID, - Opcode.INVOKE_VIRTUAL, - Opcode.RETURN_VOID - ), - customFingerprint = { methodDef -> - methodDef.implementation?.instructions?.any { - it.opcode.ordinal == Opcode.CONST.ordinal && - (it as? WideLiteralInstruction)?.wideLiteral == SharedResourceIdPatch.chapterRepeatOnResourceId - } == true - } -) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/speed/bytecode/patch/VideoSpeedBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/speed/bytecode/patch/VideoSpeedBytecodePatch.kt index 575d9a849..b7347b1b9 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/video/speed/bytecode/patch/VideoSpeedBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/video/speed/bytecode/patch/VideoSpeedBytecodePatch.kt @@ -17,8 +17,6 @@ import app.revanced.patches.youtube.misc.videoid.legacy.patch.LegacyVideoIdPatch import app.revanced.patches.youtube.video.speed.bytecode.fingerprints.* import app.revanced.util.bytecode.BytecodeHelper.updatePatchStatus import app.revanced.util.integrations.Constants.VIDEO_PATH -import org.jf.dexlib2.Opcode -import org.jf.dexlib2.builder.instruction.BuilderInstruction35c import org.jf.dexlib2.iface.instruction.FiveRegisterInstruction @Name("default-video-speed-bytecode-patch") @@ -33,31 +31,11 @@ import org.jf.dexlib2.iface.instruction.FiveRegisterInstruction @Version("0.0.1") class VideoSpeedBytecodePatch : BytecodePatch( listOf( - LiveLabelFingerprint, VideoSpeedSettingsFingerprint ) ) { override fun execute(context: BytecodeContext): PatchResult { - LiveLabelFingerprint.result?.mutableMethod?.let { - with (it.implementation!!.instructions) { - for ((index, instructions) in this.withIndex()) { - if (instructions.opcode != Opcode.INVOKE_VIRTUAL) continue - if ((instructions as BuilderInstruction35c).reference.toString() != - "Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V") continue - - insertIndex = index + 1 - - it.addInstruction( - insertIndex, - "invoke-static {}, $INTEGRATIONS_VIDEO_SPEED_CLASS_DESCRIPTOR->liveVideoStarted()V" - ) - break - } - } - if (insertIndex == 0) return LiveLabelFingerprint.toErrorResult() - } ?: return LiveLabelFingerprint.toErrorResult() - with(OverrideSpeedHookPatch.videoSpeedChangedResult) { val index = scanResult.patternScanResult!!.endIndex val register =