[Guide] Long press menu button to kill app

Neutrino22

Senior Member
Feb 18, 2011
74
7
0
London
No. Use apktool to decompile and then notepad ++ to mod the smalies.
Thanks for your replies. I'm not familiar with 'decompiling' and 'pulling framework to PC' so I'll have to go and research what this is. My ignorance is dissolving the more I learn; but at a rather slow pace. I have the experiential knowhow in pushing mods through adb, rooting, installing custom ROMs, and simple text editing of system files but only locally, on the phone.

Could you suggest a good resource for learning about pulling framework to PC decompile?

Many thanks
 
Last edited:

nokiamodeln91

Senior Member
Jun 6, 2012
7,393
2,637
0
Pulling is rather simple. Connect using adb.
Then use the command
adb pull /system/framework/framework-res.apk
Then /system/framework/twframework-res.apk

Sent from my GT-I9500 using xda premium

---------- Post added at 03:55 AM ---------- Previous post was at 03:54 AM ----------

For decompiling, go to madjinj's thread about nodding and grab the apk tool. It has a small command UI.

Sent from my GT-I9500 using xda premium
 
  • Like
Reactions: Neutrino22

Neutrino22

Senior Member
Feb 18, 2011
74
7
0
London
Is there a way to get this done using magic? I've got an amulet made out of cats teeth, a handful of lambs bones, some random bits of human hair (possibly some pubes too) 5 dried frogs and a small bag of exploding glitter (for the climactic bit)...
 

majdinj

Senior Member
Nov 25, 2006
980
3,437
0
AlAhsa
Is there a way to get this done using magic? I've got an amulet made out of cats teeth, a handful of lambs bones, some random bits of human hair (possibly some pubes too) 5 dried frogs and a small bag of exploding glitter (for the climactic bit)...
Use the searching feature of xda to search for decompiling, compiling, baksmali and smali tutorials,,, There are many excellent tutorials that will make you have the first step..

Example of excellent tutorials (must read thoroughly):
>> [Guide] Decompile with Apk Tool [Easy Way]
>> [TOOL/GUIDE GB/ICS/JB] Decompile/Recompile apk | jar | sign + Basic editing xml/smali
>> [Share Latest Apktool 4.2.2/Guide/Tutorial/] How to Decompile/Compile/Sign Apk/Jar

Some easy tools:
>> [Windows][UTILITY][TOOL] APK Multi-Tool
>> [Utility][Tool][Windows] Backsmali / Smali Manager

No magic... It is only patience, willing of learning and a lot of practicing...!!
 

forest1971

Senior Member
Apr 3, 2012
1,694
2,133
0
Dear OP and friends, can you help create a mod to go to home sceen using long press menu or back button please? Tks a lots.

Sent from my GT-N7000 using Tapatalk 2
 

qmscreatives

Senior Member
Jul 21, 2014
81
5
0
New Delhi
www.qmscreatives.com
thanks
This mod will make you able to instantly kill app activity by long press on menu button



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$[B][COLOR="Red"]9[/COLOR][/B];

    invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$[B][COLOR="Red"]9[/COLOR][/B];-><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$[B][COLOR="Blue"]KillConcept[/COLOR][/B];

    invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$[B][COLOR="Blue"]KillConcept[/COLOR][/B];-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V

    iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mMenuLongPress:Ljava/lang/Runnable;
- Save changes.
- Now add this new file (PhoneWindowManager$KillConcept.smali) to classout/com/android/internal/policy/impl/ folder. You can download it from here.

- 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, [B][COLOR="Red"]0x1f4[/COLOR][/B]

    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


Now you can open any app and then long press the menu button to exit instantly.. :cool: