0

Let's say I have an List<E>, I want to invoke its add(E object) method, and my list is actually a List<String>, how should i represent this invocation in smali?

Should it be

invoke-interface {v1, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z

or

invoke-interface {v1, v2}, Ljava/util/List;->add(Ljava/lang/String;)Z

or something else?

keyser
  • 18,829
  • 16
  • 59
  • 101
Edwin Lee
  • 3,540
  • 6
  • 29
  • 36

1 Answers1

1

It should be the first.

invoke-interface {v1, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z

When in doubt, you can try what you want in java, compile it, dx it, then baksmali it :)

JesusFreke
  • 19,784
  • 5
  • 65
  • 68