fix: incorrect cast of instruction

This commit is contained in:
oSumAtrIX 2023-05-07 18:34:00 +02:00
parent 4347f88af0
commit fb94a1cb48
No known key found for this signature in database
GPG key ID: A9B3094ACDB604B4

View file

@ -14,6 +14,7 @@ import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.youtube.layout.hide.loadmorebutton.bytecode.fingerprints.HideLoadMoreButtonFingerprint import app.revanced.patches.youtube.layout.hide.loadmorebutton.bytecode.fingerprints.HideLoadMoreButtonFingerprint
import app.revanced.patches.youtube.layout.hide.loadmorebutton.resource.patch.HideLoadMoreButtonResourcePatch import app.revanced.patches.youtube.layout.hide.loadmorebutton.resource.patch.HideLoadMoreButtonResourcePatch
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
import org.jf.dexlib2.iface.instruction.TwoRegisterInstruction import org.jf.dexlib2.iface.instruction.TwoRegisterInstruction
@Patch @Patch
@ -26,7 +27,7 @@ class HideLoadMoreButtonPatch : BytecodePatch(listOf(HideLoadMoreButtonFingerpri
HideLoadMoreButtonFingerprint.result?.let { HideLoadMoreButtonFingerprint.result?.let {
it.mutableMethod.apply { it.mutableMethod.apply {
val moveRegisterIndex = it.scanResult.patternScanResult!!.endIndex val moveRegisterIndex = it.scanResult.patternScanResult!!.endIndex
val viewRegister = instruction<TwoRegisterInstruction>(moveRegisterIndex).registerA val viewRegister = instruction<OneRegisterInstruction>(moveRegisterIndex).registerA
val insertIndex = moveRegisterIndex + 1 val insertIndex = moveRegisterIndex + 1
addInstruction( addInstruction(