Pie Faced
Pie Faced

Reputation: 3580

smali: Handling Parameterised Classes

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?

Upvotes: 0

Views: 173

Answers (1)

JesusFreke
JesusFreke

Reputation: 20282

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 :)

Upvotes: 1

Related Questions