IMPORTANT!!! If you have already installed my other fashion:
"Fat House", "4-level taskkiller", "Torch" or "player management / FM-radio volume button"
is inserted in the paragraph calling code "Switch tasks" should be placed before the call codes of these mods! The method to accurately determine the insertion point call our method.
We have to find not far from the beginning of the method, code like this (especially left an excessive amount thereof):
.line 2891
.local v13, "StkIntent": Landroid / content / Intent;
move-object / from16 v0, p0
iget-object v4, v0, Lcom / android / server / policy / PhoneWindowManager; ->mContext: Landroid / content / Context;
invoke-virtual {v4, v13}, Landroid / content / Context; ->sendBroadcast (Landroid / content / Intent;) V
.line 2892
const-string / jumbo v4, "gsm.stk.event.useractivity"
const-string / jumbo v6, "0"
invoke-static {v4, v6}, Landroid / os / SystemProperties; ->set (Ljava / lang / String; Ljava / lang / String;) V
.line 2899
.end local v13 # "StkIntent": Landroid / content / Intent;
: cond_0
move-object / from16 v0, p0
iget-boolean v4, v0, Lcom / android / server / policy / PhoneWindowManager; ->mScreenshotChordEnabled: Z
if-eqz v4,: cond_9
move / from16 v0, v25
and-int / lit16 v4, v0, 0x400
And something like this (in bold), it inserts a call to our method:
.line 2891
.local v13, "StkIntent": Landroid / content / Intent;
move-object / from16 v0, p0
iget-object v4, v0, Lcom / android / server / policy / PhoneWindowManager; ->mContext: Landroid / content / Context;
invoke-virtual {v4, v13}, Landroid / content / Context; ->sendBroadcast (Landroid / content / Intent;) V
.line 2892
const-string / jumbo v4, "gsm.stk.event.useractivity"
const-string / jumbo v6, "0"
invoke-static {v4, v6}, Landroid / os / SystemProperties; ->set (Ljava / lang / String; Ljava / lang / String;) V
.line 2899
.end local v13 # "StkIntent": Landroid / content / Intent;
: cond_0
# taskswitch
if-nez v36,: cond_aa
move-object / from16 v0, p0
iget-object v4, v0, Lcom / android / server / policy / PhoneWindowManager; ->mTaskSwitch: Lfreeflax / framework / taskswitch / TaskSwitch $ Main;
move / from16 v0, v28
invoke-virtual {v4, v0}, Lfreeflax / framework / taskswitch / TaskSwitch $ Main; ->FFgetTaskSwitchState (I) I
move-result v4
if-nez v4,: cond_3 # before return
: cond_aa
move-object / from16 v0, p0
iget-boolean v4, v0, Lcom / android / server / policy / PhoneWindowManager; ->mScreenshotChordEnabled: Z
if-eqz v4,: cond_9
move / from16 v0, v25
and-int / lit16 v4, v0, 0x400
In the inserted code is necessary to pay attention to the following registers and tag numbers that you have most likely to change:
v4 - should be free register which can be used (refer to such method in the code registers, the contents of which are further repeatedly changes in the method).
v28 - in this case at the beginning of the method I have entered key-code method
getKeyCode () I :
invoke-virtual / range {p2 .. p2}, Landroid / view / KeyEvent; ->getKeyCode () I
move-result v28
.local v28, "keyCode": I
v36 - in this case at the beginning of the method I have entered a sign of repeated keystrokes by
getRepeatCount () I :
invoke-virtual / range {p2 .. p2}, Landroid / view / KeyEvent; ->getRepeatCount () I
move-result v36
.local v36, "repeatCount": I
: cond_3 - should make the transition to the output of the method, but with assignment of values.
I have the transition of
cond_3 : This code:
: cond_3
const-wide / 16 v6, -0x1
return-wide v6