From 48068cb3d79e283ff1cad9f3f78dc1d0fcd14f83 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sun, 3 Jul 2022 17:41:58 +0200 Subject: [PATCH] fix: `MethodWalker` not accounting for all reference instructions --- .../app/revanced/patcher/util/method/MethodWalker.kt | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/kotlin/app/revanced/patcher/util/method/MethodWalker.kt b/src/main/kotlin/app/revanced/patcher/util/method/MethodWalker.kt index 103841a2..1df794dc 100644 --- a/src/main/kotlin/app/revanced/patcher/util/method/MethodWalker.kt +++ b/src/main/kotlin/app/revanced/patcher/util/method/MethodWalker.kt @@ -4,11 +4,9 @@ import app.revanced.patcher.data.impl.BytecodeData import app.revanced.patcher.data.impl.MethodNotFoundException import app.revanced.patcher.extensions.softCompareTo import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod -import org.jf.dexlib2.Format import org.jf.dexlib2.iface.Method -import org.jf.dexlib2.iface.instruction.formats.Instruction35c +import org.jf.dexlib2.iface.instruction.ReferenceInstruction import org.jf.dexlib2.iface.reference.MethodReference -import org.jf.dexlib2.util.Preconditions /** * Find a method from another method via instruction offsets. @@ -37,9 +35,7 @@ class MethodWalker internal constructor( currentMethod.implementation?.instructions?.let { instructions -> val instruction = instructions.elementAt(offset) - Preconditions.checkFormat(instruction.opcode, Format.Format35c) - - val newMethod = (instruction as Instruction35c).reference as MethodReference + val newMethod = (instruction as ReferenceInstruction).reference as MethodReference val proxy = bytecodeData.findClass(newMethod.definingClass)!! val methods = if (walkMutable) proxy.resolve().methods else proxy.immutableClass.methods