How to set a boolean in smali

bman picture bman · Aug 29, 2013 · Viewed 18.6k times · Source

I have this line of code in smali

:cond_2
sput-boolean v11, Lcom/geo/main/MainActivity;->mLARGE:Z

I want to directly assigned a True value to v11

How do I do this?

Answer

JesusFreke picture JesusFreke · Aug 30, 2013

You can use const or one of its variants to assign a constant value to a register. In this case, you can use either the boolean literal true, or the numeric literal 1.

const v11, true

OR

const v11, 1