[MOD] Enable Xperia S on-screen buttons (Stock ICS)
Hi, all!
It's my first mod and first thread on XDA, so forgive my mistakes.
I really don't like the Xperia S capacitive buttons. After
ask a question about the matter on XDA, I decided to try to do it myself. And after a few hours eating some bits, I could finish my work:
Native ICS on-screen buttons on Xperia S!!!
(See screenshots attached)
Short story:
I started reading
this post, that led me to
this other post that led me to try to use a tool called
apktool. Sadly, apktool seems a little buggy and I decided to modify the framework-res.apk without decompile and recompile it. How? Binary diff. I can't say it was easy, but after a few hours I could modify the apk. In the Long story, on the second post, I'll tell how.
Things you need:
1. Root your device (see
this post to learn how to unlock and root)
2. adb installed (or a working recovery)
Things I don't need to say (but I will):
YOU are responsible for any damage this mod could cause in your phone. I did exactly what I described below and it worked for me, but only God can make sure it will work for you. I don't think it's a big deal since you can flash you ROM again in case of any problem.
How to backup:
If you really want to backup your original framework-res.apk, run it before installing:
Code:
brunojcm@brunojcm-desktop:~/Android/LT26i$ adb pull /system/framework/framework-res.apk framework-res.apk.bkp
And save the file framework-res.apk.bkp.
It's not very important because you can get this file from the ROM package or from
here (link from
optik19918).
How to install:
Install this mod is as simple as replace the file /system/framework/framework-res.apk by the modified framework-res.apk. Here follow some options to accomplish that:
Option 1 (via adb):
1. Choose a folder on your computer
2. Download framework-res.apk.
For firmware 6.1.A.0.452:
mediafire
my home (slow link)
For firmware 6.1.A.1.58:
my home (slow link)
For firmware 6.1.A.2.45:
my home (slow link)
3. Run the following steps (I did on Ubuntu Linux, but they are easily translatable to Windows):
Code:
brunojcm@brunojcm-desktop:~/Android/LT26i$ adb shell
shell@android:/ $ su
shell@android:/ # mount -o remount,rw /system
shell@android:/ # mkdir /system/tmp
shell@android:/ # ^D
shell@android:/ $ ^D
brunojcm@brunojcm-desktop:~/Android/LT26i$ adb push framework-res.apk /system/tmp/framework-res.apk
4765 KB/s (15874684 bytes in 3.253s)
brunojcm@brunojcm-desktop:~/Android/LT26i$ adb shell
shell@android:/ $ su
shell@android:/ $ mv /system/tmp/framework-res.apk /system/framework/framework-res.apk
shell@android:/ # ls -l /system/framework/framework-res.apk
-rw-rw-rw- shell shell 15874684 2012-06-28 03:58 framework-res.apk
shell@android:/ # rmdir /system/tmp
shell@android:/ # mount -o remount,ro /system
shell@android:/ # ^D
shell@android:/ $ ^D
brunojcm@brunojcm-desktop:~/Android/LT26i$ adb reboot
4. Wait your phone to restart
5. Thanks me by clicking 'Thanks' button below

6. Say some bad words to the physical buttons!!!
Option 2 (via recovery):
1. Download the
on-screen-buttons.zip
2. Reboot on recovery
3. Apply this zip
4. Restart the phone
5. Thanks me by clicking 'Thanks' button below

(and also
Soheil_rf for the zip version)
6. Say some bad words to the physical buttons!!!
Option 3 (via file manager):
1. Download the same file of option 1, step 2 (above)
2. Use your favorite file manager to copy the downloaded file to /system/framework/framework-res.apk
3. Restart the phone
4. Thanks me by clicking 'Thanks' button below

5. Say some bad words to the physical buttons!!!
How to uninstall:
Just repeat Option 1 or 3 above, but using the framework-res.apk.bkp you backed up or
this one (link from
optik19918).
----------------------
Some points:
1. The file is really smaller than the original, and it must be caused by the linux archive app when I copied the patched 'resources.arsc' to the original apk. It worked for me up to now, but I will try to figure out why it happened.
2. I will explain how I patched the 'resources.arsc' and changed the boolean value in the first reply of the thread. It was a pain in the ass, but worth sharing (edit: explained here:
http://forum.xda-developers.com/show....php?t=1823223).