JesusFreke / smali

smali/baksmali
6.29k stars 1.07k forks source link

How to know parameters register id of method when BuilderInstruction? #702

Closed hluwa closed 5 years ago

hluwa commented 5 years ago

i want use 'this' or p0, p1,... register, but i don't know how to get register id.. code like:

  private def modifyMethod(method: Method): MethodImplementation = {
    val mutableImplementation = new MutableMethodImplementation(5)
    mutableImplementation.addInstruction(
      new BuilderInstruction35c(Opcode.INVOKE_STATIC, 5, this, p1, p2, p3, p4,
        new ImmutableMethodReference("Lclass;", "method",
          Lists.newArrayList("Ljava/lang/String;"), "I")))
    mutableImplementation
  }
sriteja777 commented 3 years ago

Hey, did you solve this issue, I also have same use case.