Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

Lightbulb [Guide] Long press menu button to kill app

OP majdinj

31st May 2013, 02:12 AM   |  #1  
majdinj's Avatar
OP Recognized Contributor / Themer
Flag AlAhsa
Thanks Meter: 3,021
 
980 posts
Join Date:Joined: Nov 2006
More
This mod will make you able to instantly kill app activity by long press on menu button

Quote:

The original mod is done by maskerwsk, who modifies Mirko_ddd method

Needed tools:
1) Backsmali/Smali program from here
2) Notepad++ program from here
3) WinRAR or 7-zip archiver

The procedure:
- Backsmali android.policy.jar
- Navigate to classout/com/android/internal/policy/impl/ folder and open PhoneWindowManager.smali file
- Locate the following code by tracking "mMenuLongPress" and do the following changes:
before:
Code:
    .line 1674
    new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$9;

    invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$9;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V

    iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mMenuLongPress:Ljava/lang/Runnable;
after:
Code:
    .line 1674
    new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$KillConcept;

    invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$KillConcept;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V

    iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mMenuLongPress:Ljava/lang/Runnable;
Quote:

N.B: $9 might be differ according to ROM, but track "mMenuLongPress" to locate the wanted code portion

- Save changes.
- Now add this new file (PhoneWindowManager$KillConcept.smali) to classout/com/android/internal/policy/impl/ folder. You can download it from here.
Quote:

You should make sure that the id in PhoneWindowManager$KillConcept.smali is linked to "permlab_forceBack" id in framework-res.apk public.xml. See post #15 to know exactly how it is done.

- Now recompile (smali) the classout folder and open android.policy.jar by WinRAR or 7-zip and substitute classes.dex inside android.policy.jar with the new classes.dex file.. now push the modified android.policy.jar to your device and fix permissions to chmod 644.

Extra step:
To adjust timeout delay, backsmali framework.jar and navigate to classout/android/view/ folder and open ViewConfiguration.smali and search for this method and change RED text value:
Code:
.method public static getGlobalActionKeyTimeout()J
    .registers 2

    .prologue
    .line 669
    const-wide/16 v0, 0x1f4

    return-wide v0
.end method
As you can see, this hex value means 500; i.e, 0.5 second.. So we will change it to which delay we want:
0x1f4 = 0.5 second (default value)
0x2ee = 0.75 second
0x3e8 = 1 second
0x4e2 = 1.25 second
0x5dc = 1.5 second
0x6d6 = 1.75 second
0x7d0 = 2 second
Quote:

N.B: applying this change, will affect the timeout delay across OS!!

Now you can open any app and then long press the menu button to exit instantly..
Last edited by majdinj; 11th September 2013 at 01:47 PM.
The Following 18 Users Say Thank You to majdinj For This Useful Post: [ View ]
31st May 2013, 11:32 AM   |  #2  
ocujos's Avatar
Senior Member
Flag Sydney
Thanks Meter: 142
 
490 posts
Join Date:Joined: Feb 2010
More
Is it possible to control delay before an app gets killed?

Sent from my GT-N7000 using Tapatalk HD
31st May 2013, 01:07 PM   |  #3  
majdinj's Avatar
OP Recognized Contributor / Themer
Flag AlAhsa
Thanks Meter: 3,021
 
980 posts
Join Date:Joined: Nov 2006
More
Quote:
Originally Posted by ocujos

Is it possible to control delay before an app gets killed?

Sent from my GT-N7000 using Tapatalk HD

No in the meantime,,, but may be in future, since it involves complicated coding and decompiling other system app..
1st June 2013, 02:02 PM   |  #4  
majdinj's Avatar
OP Recognized Contributor / Themer
Flag AlAhsa
Thanks Meter: 3,021
 
980 posts
Join Date:Joined: Nov 2006
More
Quote:
Originally Posted by ocujos

Is it possible to control delay before an app gets killed?

Sent from my GT-N7000 using Tapatalk HD

Quote:
Originally Posted by majdinj

No in the meantime,,, but may be in future, since it involves complicated coding and decompiling other system app..

I have found a short way to do that,,, I will update OP soon after I come back home

Edit:
Added extra step
Last edited by majdinj; 1st June 2013 at 07:34 PM.
The Following 3 Users Say Thank You to majdinj For This Useful Post: [ View ]
7th June 2013, 10:12 PM   |  #5  
Senior Member
Thanks Meter: 14
 
341 posts
Join Date:Joined: Sep 2007
More
Quote:
Originally Posted by majdinj

I have found a short way to do that,,, I will update OP soon after I come back home

Edit:
Added extra step

hi guys this mod is fantastic...

is there something same for the Galaxy note II?

thank's to all for the ansewers!
9th June 2013, 06:42 PM   |  #6  
Senior Member
Thanks Meter: 14
 
341 posts
Join Date:Joined: Sep 2007
More
Quote:
Originally Posted by mikempower

hi guys this mod is fantastic...

is there something same for the Galaxy note II?

thank's to all for the ansewers!

nobody?

Inviato dal mio GT-N7100 con Tapatalk 2
11th June 2013, 07:56 PM   |  #7  
majdinj's Avatar
OP Recognized Contributor / Themer
Flag AlAhsa
Thanks Meter: 3,021
 
980 posts
Join Date:Joined: Nov 2006
More
Quote:
Originally Posted by mikempower

nobody?

Inviato dal mio GT-N7100 con Tapatalk 2

I think it is the same buddy
11th June 2013, 10:30 PM   |  #8  
Senior Member
Thanks Meter: 14
 
341 posts
Join Date:Joined: Sep 2007
More
for galaxy note i flashed a zip wich made all in one step.
where a can i find it for note II? (if it exists?)

Inviato dal mio GT-N7100 con Tapatalk 2
12th June 2013, 07:59 PM   |  #9  
Senior Member
Flag Boituva - SP
Thanks Meter: 590
 
1,575 posts
Join Date:Joined: Apr 2011
Donate to Me
More
Quote:
Originally Posted by mikempower

for galaxy note i flashed a zip wich made all in one step.
where a can i find it for note II? (if it exists?)

Inviato dal mio GT-N7100 con Tapatalk 2

Google

(But only if it exists)
12th June 2013, 10:58 PM   |  #10  
Senior Member
Thanks Meter: 14
 
341 posts
Join Date:Joined: Sep 2007
More
Quote:
Originally Posted by projeto56

Google

(But only if it exists)

very funny!
but if i could find it on google,i would have not asked for it.

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes