Wednesday, April 15, 2015

Smali onCreate()



.local1 - this method uses one register

.param p1 - the Bundle savedInstanceState passed in as a method parameter (p0 is 'this')

line 25 invoke-super{p0, p1} - pass in 'this' and the parameter to super method

line 28 const v0, 0x7f040016 - the hex number is an int variable referring to a resource file in Android, in this case, it is a Layout.xml file.

line 30 invoke-virtual{p0, v0} - pass in 'this' and layout.xml to the method setContentView(I)V  , V means return void.

=======================================

Hex value of 0x1 is 1.

by putting '0x' in front of the number allows you to enter Hexadecimal numbers into the source code e.g. 0xFF = 255

======================================



.locals 2  - this method is using 2 registers
.param p1, "menu"  - the Menu menu that is passed in as a parameter

line 42 invoke-virtual {p0} - this.getMenuInflater()

move-result-object v0 - Move the result object reference of the previous method invocation into v0.

const/high16 v1, 0x7f0d0000 - Puts the 16 bit number into the the register v1. Used to save the R.menu.menu_main resource Id.

invoke-virtual {v0, v1, p1}, ...->inflate(ILandroid/view/Menu;)V  - this.getMenuInflater().inflate(R.menu.menu_main, menu);


const/4 v0, 0x1  - put 1 into register v0

return true

1 comment: