[Galaxy Y GT-S5360 Android Development] bumslayer:
Introduction

The EPM tweak by untermensch (linked here) is admittedly a difficult mod, until evanlocked graciously provided us with a tutorial of his 4-way boot tweak (linked here), originally given to us by kahvitahra (linked here). I have decided to make my own version of the above tweaks by applying the concepts the above developers gave to us, just by modifying framework-res.apk and android.policy.jar.

Scope

This EPM tweak can easily be applied to stock, deodexed versions of the Galaxy Y firmware (latest incarnation of which is now DXLJ1). By this, I mean the power menu is still pristine with no EPM hacks whatsoever. Of course, it might also work with ROMs with EPM/4-way boot hacks already in place, with some modifications to the code which I will not be touching here.

This EPM tweak may also work with stock deodexed versions of other phones. However, I have not personally tested it. You may try this guide but please do so at your own risk.

Liability

I will not be held liable if you should brick your phone after following this guide. Having said so, please proceed at your own risk. As a precaution, please perform a nandroid backup of your phone, in case something goes wrong.

Requirements

Apktool

Framework-res.apk

Android.policy.jar

Notepad++

Winrar/7zip

Common sense and lots of patience.

Preparation

Download the archive needed for this tweak (View attachment 1470794). Extract its contents to any folder of your choice. You should have the following files inside the archive:

GlobalActions$99$1.smali

GlobalActions$99$2.smali

GlobalActions$99.smali

ic_bum_restart.png

Prepare the work folder where you will be reverse-engineering the framework files. I created a C:\temp\epm folder for this purpose.

Pull framework-res.apk and android.policy.jar from the /system/framework/ folder of your phone. You can do this with root explorer. Don’t ask me how.

Copy the files you pulled from step 2 into the folder you prepared in step 1.

Open a command line and issue a “cd \your_work_folder” command to go to your work folder. If you are following my example in step 1, the correct command will be “cd \temp\epm”. Don’t ask me if you should press the enter key at the end of that command.

Reversing framework-res.apk

Decompile framework-res.apk with “apktool d –f framework-res.apk” from the command line.

Open framework-res\res\values\string.xml with notepad++ and insert the following line at the end of the file:

[COLOR="Blue"]<string [/COLOR][COLOR="Red"]name[/COLOR]=[COLOR="Indigo"]"bum_restart"[/COLOR]>Restart[COLOR="Blue"]</string>[/COLOR]

Copy ic_bum_restart.png and place it inside the framework-res\res\drawable-ldpi folder.

Compile framework-res with “apktool b –f framework-res.apk”. Your framework-res folder should now have build and dist folders inside.

Change to the framework-res/dist folder (cd framework-res/dist) and decompile the framework-res.apk.

Open framework-res/dist/framework-res/res/values/public.xml with notepad++. Search for the name of the string you created in step 2 (“bum_restart”). Copy the search result line into a new notepad++ document.

Still in public.xml, search for “ic_bum_restart”. Again, copy the search result line into your notepad++ document. You should then have the following lines:

[COLOR="Blue"]<public [COLOR="Red"]type[/COLOR]=[COLOR="Purple"]"string"[/COLOR] [COLOR="Red"]name[/COLOR]=[COLOR="Purple"]"bum_restart"[/COLOR] [COLOR="Red"]id[/COLOR]=[COLOR="Purple"]"0x010404d3"[/COLOR] />[/COLOR]
[COLOR="Blue"]<public[COLOR="Red"] type[/COLOR]=[COLOR="Purple"]"drawable"[/COLOR] [COLOR="red"]name[/COLOR]=[COLOR="purple"]"ic_bum_restart"[/COLOR] [COLOR="red"]id[/COLOR]=[COLOR="purple"]"0x010803ef"[/COLOR] />[/COLOR]

Make note of the ids of ic_bum_restart and bum_restart. These resource ids will be needed once we modify android.policy.jar.

Open the original framework-res.apk in winrar/7zip.

Drag framework-res/build/apk/resources.arsc to the open framework-res.apk to replace the original file. Make sure the compression rate is set to “store”.

Similarly, drag framework-res/build/res/drawable-ldpi/ic_bum_restart.png to framework-res.apk. Again, compression rate should be set to “store”

That’s it. You now have a modified framework-res.apk with the resources needed by android.policy.jar. Moving on now to reversing android.policy.jar.

Continued on page 2.