Search code examples
androiddexsmali

Smali .local format


I disassembled an Android application with baksmali, and studied the produced smali code. One of the classes contains the following line:

.local v1, "future":Lcom/android/volley/toolbox/RequestFuture;, "Lcom/android/volley/toolbox/RequestFuture<Ljava/lang/Void;>;"

I'm not sure about the meaning of this line of code.

Does v1 contain a RequestFuture<Void>, that corresponds to variable future in original code? (i.e. is the original code: RequestFuture<Void> future;?) Or is it something different?


Solution

  • Yes, that is part of the debugging information that can optionally be present. It is used when debugging to be able to, e.g. evaluate the value of a local variable.

    The .local you mention means exactly what you said. The v1 register holds the value of the future variable from the original source, and its type is RequestFuture<Void>

    A .local directive is equivalent to a DBG_START_LOCAL or DBG_START_LOCAL_EXTENDED instruction in the debug info for that method, as defined by the dex format