Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set a boolean in smali

Tags:

smali

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?

like image 604
bman Avatar asked Aug 29 '13 21:08

bman


2 Answers

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
like image 172
JesusFreke Avatar answered Oct 13 '22 20:10

JesusFreke


const v11, 1

And here is some more info http://androidcracking.blogspot.com/2010/09/examplesmali.html

like image 25
feelinglucky Avatar answered Oct 13 '22 18:10

feelinglucky