diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/information/patch/VideoInformationPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/information/patch/VideoInformationPatch.kt index e73f0d246..1df612641 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/video/information/patch/VideoInformationPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/video/information/patch/VideoInformationPatch.kt @@ -28,7 +28,6 @@ import org.jf.dexlib2.Opcode import org.jf.dexlib2.builder.BuilderInstruction import org.jf.dexlib2.builder.MutableMethodImplementation import org.jf.dexlib2.iface.instruction.FiveRegisterInstruction -import org.jf.dexlib2.iface.instruction.Instruction import org.jf.dexlib2.iface.instruction.OneRegisterInstruction import org.jf.dexlib2.iface.instruction.ReferenceInstruction import org.jf.dexlib2.immutable.ImmutableMethod @@ -218,9 +217,8 @@ class VideoInformationPatch : BytecodePatch( ) private fun getReference(instructions: List, offset: Int, opcode: Opcode) = - instructions[instructions.indexOfFirst { it.opcode == opcode } + offset].reference - - val Instruction.reference get() = (this as ReferenceInstruction).reference.toString() + (instructions[instructions.indexOfFirst { it.opcode == opcode } + offset] as ReferenceInstruction) + .reference.toString() private lateinit var speedSelectionInsertMethod: MutableMethod private var speedSelectionInsertIndex = 0 diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/speed/remember/patch/RememberPlaybackSpeedPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/speed/remember/patch/RememberPlaybackSpeedPatch.kt index 96e678dea..625d773df 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/video/speed/remember/patch/RememberPlaybackSpeedPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/video/speed/remember/patch/RememberPlaybackSpeedPatch.kt @@ -19,9 +19,9 @@ import app.revanced.patches.shared.settings.preference.impl.SwitchPreference import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch import app.revanced.patches.youtube.video.information.patch.VideoInformationPatch -import app.revanced.patches.youtube.video.information.patch.VideoInformationPatch.Companion.reference import app.revanced.patches.youtube.video.speed.custom.patch.CustomVideoSpeedPatch import app.revanced.patches.youtube.video.speed.remember.fingerprint.InitializePlaybackSpeedValuesFingerprint +import org.jf.dexlib2.iface.instruction.ReferenceInstruction @Name("remember-playback-speed") @Description("Adds the ability to remember the playback speed you chose in the video playback speed flyout.") @@ -78,7 +78,8 @@ class RememberPlaybackSpeedPatch : BytecodePatch( */ InitializePlaybackSpeedValuesFingerprint.result?.apply { // Infer everything necessary for calling the method setPlaybackSpeed(). - val onItemClickListenerClassFieldReference = mutableMethod.instruction(0).reference + val onItemClickListenerClassFieldReference = + mutableMethod.instruction(0).reference // Registers are not used at index 0, so they can be freely used. mutableMethod.addInstructions(