Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Smali function: Return an Integer

Tags:

android

apk

smali

I know how to return a TRUE boolean from a function:

.locals 1
const/4 v0, 0x1
return v0

Now I need to return an integer (10000 value). How?

like image 825
runs Avatar asked Sep 15 '25 15:09

runs


1 Answers

The following method

public int return1000() {
    int i = 1000;
    return i;
}

Looks like this in smali

.method public return1000()I
    .locals 1

    .prologue
    .line 278
    const/16 v0, 0x3e8

    .line 279
    .local v0, "i":I
    return v0
.end method
like image 114
pelotasplus Avatar answered Sep 17 '25 04:09

pelotasplus