[Samsung Epic 4G Touch] t.burninator:
[BACKGROUND]

Hey guys, if you have been experiencing "phantom keypress" of the menu key, this guide is for you. I bought my SII the first week it came out for Boost and I've been dealing with this defect since the second day I had my phone. It is most definitely a physical problem with the phone, and if you've got it you know it can be extremely frustrating at times. I've never felt like sending back my phone for warranty service so the phantom keypress problem has just never gone away. Until now!

This guide is easier than it is long! It really is easy!

[SUMMARY]

PURPOSE:

You will disable your faulty menu key and turn your search key into your new menu key. You will no longer have a search key, however, you will no longer experience phantom menu keypresses.

STEP 0:

SKIP THIS ENTIRE GUIDE

and send your phone back to Samsung if it's:

a. Still under warranty

b. Non-rooted with stock ROM

c. And you don't mind sending your phone back to Samsung for repair or possible replacement with a refurb.

d. Especially if it's also producing phantom SEARCH keypresses!

STEP 1: Ensure phone is rooted (NOTE: This will probably void your warranty.)

STEP 2: Backup: /system/usr/keylayout/.

STEP 3a: (ICS BUILDS ONLY!) Modify: /system/usr/keylayout/sec_touchkey.kl

STEP 3b: (ICS BUILDS ONLY!) Modify: /system/usr/keylayout/melfas-touchkey.kl

STEP 3c: (JB BUILDS ONLY!) Modify: /system/usr/keylayout/Generic.kl

STEP 4: Revert file permissions to: rw-r--r-- (644)

STEP 5: Reboot!

[STEP 1]

IF YOU ARE RUNNING THE LATEST ANDROID "ICE CREAM SANDWICH" BUILD:

If you do not already have root, try pushing "SuperSU" to your phone using the "Frodo" exploit in Framaroot. The Framaroot APK is available for download below and will root your ICS phone without having to flash any kind of ROM or kernel.

IF YOU ARE RUNNING AN EARLIER ANDROID "ICE CREAM SANDWICH" BUILD:

Framaroot will probably work to root your phone, however, you can definitely root your phone through the "Exynos" exploit in ExynosAbuse. The ExynosAbuse APK is available for download below and will root your (EARLIER BUILD) ICS phone without having to flash any kind of ROM or kernel.

IF YOU ARE RUNNING AN ANDROID "JELLY BEAN" BUILD:

Framaroot probably won't root your phone, but an updated version might. Until then I don't know of an exploit that will root your phone without having to flash some kind of ROM or kernel. If you're running JB then I hope your phone is already rooted, and when I learn of an exploit that works I'll try to update the guide again and post it.

Download: Framaroot APK @ xdaforums.com

Download: ExynosAbuse APK @ xdaforums.com

(Once you install the APK on your phone, run the program, then root. Wait about 10 seconds, and you will have a superuser dialog pop up and you're done! Excellent!!! I recommend downloading Busybox from the Play market sometime afterwards.)

[STEP 2]

This step is optional/recommended. How to backup your current keylayout folder:

I use ES File Explorer for this (ES File Explorer has a built-in text editor and you're going to need one of those for step 3). Now that you have working root, open up ES File Explorer, go into the Settings, then under "Root settings" at the bottom, make sure the 3 checkboxes at the top are checked (including "Mount File System" or you won't be able to change anything). Then, go to /system/usr/ and longpress the keylayout folder, then "Copy to" and select a location on your sdcard or external. After a second or two the folder should be copied successfully.

Of course, if you use a better backup method, do that. If you accidentally render your softkeys useless, the previous backup method might not actually do you too much good. Stick with the guide and your phone should be just fine.

[STEP 3a - (ICS BUILDS ONLY!)]

Now for the fun part! What you're going to do now is disable the current menu key, and replace the function of the search key with that of the menu key. What that means is when you press search, you'll get menu, and when you press menu, nothing will happen. And when menu key phantom presses itself, nothing will happen (huzzah)! Now if you're very fond of the search key you'll have to make a decision - keep the search key AND the phantom keypress defect; or drop search, make search do menu, and eliminate this freaking headache. I personally never use the search key, so getting rid of its function is not a big deal at all. Here's how to patch the first file:

So once keylayout is backed up on your sdcard, open the keylayout folder in ES File Explorer (with root enabled), and long-press sec_touchkey.kl (this is the file that assigns functions to the capacitive keys), then click "Open as" followed by "Text". I recommend opening the file with "ES Note Editor" (which is included with ES File Explorer). Then you should see the following default assignments:

key 158 BACK WAKE
key 139 MENU WAKE
key 102 HOME WAKE
key 217 SEARCH WAKE_DROPPED

Now that you have it open, make the following edits to:

/system/usr/keylayout/sec_touchkey.kl

key 158 BACK
#key 139 MENU
key 102 HOME
key 217 MENU

You MUST use an octothorpe # to comment out the line for key 139 or this fix will NOT work!!!

As you'll see, the menu key was deleted and the search key became the new menu key. Also, the softkeys no longer wake the OS (this is my personal preference). Save the file and you're done with step 3a!

[STEP 3b - (ICS BUILDS ONLY!)]

In FI22 this step appears to be optional - but I do it anyway!! Make the exact same edits to:

/system/usr/keylayout/melfas-touchkey.kl

key 158 BACK
#key 139 MENU
key 102 HOME
key 217 MENU

You MUST use an octothorpe # to comment out the line for key 139 or this fix will NOT work!!!

Save the file and you're almost done! Skip to STEP 4.

[STEP 3c - (JB BUILDS ONLY!)]

If you're running Android "Jelly Bean" then you might have noticed that you don't have the two files listed above. No matter; you can still apply this fix! Go into /system/usr/keylayout/ and, using the exact same method described in step 3a, you're going to modify:

/system/usr/keylayout/Generic.kl

First

, find the line that begins with:

key 139 MENU

and use an octothorpe # to comment it out so it doesn't create this key assignment at boot:

#key 139 MENU

Second

, find the line that says:

key 217 SEARCH

and edit it to read:

key 217 MENU

(NOTE: HiredxGunz at AndroidForums was kind enough to provide a pastebin text dump of the completed modified Generic.kl file, that you can download from his tutorial on implementing this fix in JB.)

Third

, save the file and you're almost done!

[STEP 4]

FOR EVERY FILE THAT YOU HAVE JUST MODIFIED

:

You will need to ensure that the correct permissions have been set. From my experience, in ICS, edited file permissions had been reset to rw-rw-rw- (666), so if this is the case then STEP 4 isn't strictly necessary. HOWEVER, on the JB build I am running, after editing the file its permissions had been reset to rw------- (600). I did not realize this had happened when I did it, and then after I rebooted none of the softkeys worked - I was able to fix the permissions without resetting the phone but it was a big annoyance. A special thanks to HiredxGunz for pointing out the permissions issue.

Here's how to reset the permissions back to rw-r--r-- (644):

a. Long press on the file in ES File Explorer until the context menu for the file appears.

b. Scroll all the way down to the bottom and select "Properties".

c. Next to "Permissions:" will be a button labelled "Change". Click it.

d. To set the file back to default rw-r--r--, make sure all three "read" boxes are ticked, as well as the "write" box for "user".

e. Select "OK" and verify that the file's permissions are rw-r--r-- (644).

f. Repeat substeps a-e on the next file, if applicable.

[STEP 5]

Reboot your phone and kiss your phantom menu keypress defect goodbye!!!

You may still experience a very, very minor issue where the phone hardware continues to register the phantom menu keypresses - even though this key is no longer associated with any action. You will know that this is happening because the other softkeys (home, back, and menu/search) will lock up and stop functioning temporarily, and if you use the touch key lights function they will stay on for as long as the phantom keypress is active. This is a much, much better problem to have than the original phantom keypress issue! If your softkeys do lock up you can either wait it out, or turn the screen off and immediately on again (this always works), or sometimes you can kick the other softkeys back on by simply pressing the original menu key (the one which you disabled using this tutorial).

Please let me know if any part of this guide helps you out, thank you and enjoy!