# smali question.



## zathus (Jan 2, 2012)

Can smali be directed to an image or drawable resource? Like, in XML how something might say @drawable/imagexxx

Sent from my Galaxy Nexus using RootzWiki


----------



## yarly (Jun 22, 2011)

wrong forum. moved to development questions


----------



## solongthemer (Jan 17, 2012)

Edit... sorry i totally misread your question

Sent from my Galaxy Nexus using Tapatalk 2


----------



## jocelyn (Jul 22, 2011)

Hi,

I'm not entirely sure what exactly you want to do, so this post might be worthless, but well, that's the story of my life really.

Anyway, so since smali is just java/dalvik bytecode, if you can access/use a drawable resource directly with java, you can do it with smali.

Some helpful links:

http://code.google.com/p/smali/w/list
http://pallergabor.u...ik_opcodes.html

So warning now, Its been at least a year since I've looked at any smali files, and I'm not a programmer at all really either, but I remember changing smali calls to drawable files all the time just by changing resource ids. So, in something like this:

```
<br />
.line 57<br />
const v2, 0x7f02008a<br />
<br />
iput v2, p0, Lcom/android/systemui/statusbar/policy/BatteryController;->mBatteryIcon:I<br />
```
the const v2 line is setting the 'v2' variable (register) to the resource with id 0x7f02008a

now jump back into public.xml, and we see:

```
<br />
<public type="drawable" name="stat_sys_battery" id="0x7f02008a" /><br />
```
Anyway, not sure what else to add, again, I'm not a programmer, and the real smali master is roman









Cheers


----------

