[Sony Ericsson Xperia Mini, Mini Pro, Xperia Pro, A] havocgb:
How to baksmali SystemUI.apk?

So let us first decode and obtain the smali code from the SystemUI.apk in your phone.

APK Multi-tool: There are many tools out there that can baksmali apks and later recompile them back after you edit the .smali files. I used APK Multi-tool for this purpose and I would say it works really well with SystemUI.apk as the tool handles system apps separately and has a comparatively more decent UI. I used Windows Version v1.0.11

(Don't forget to give thanks to the people who made these tools if these come in handy for you!)

I - Setting up APK Multi-Tool

Download and extract it

Now from your phone copy framework-res.apk from /system/framework and SystemUI.apk from /system/app and paste it in <folder to which you extracted APK-Multitool>\other. Also copy SemcGenericUxpRes.apk from /system/framework. You will need it later. SemcGenericUxpRes.apk is only for Sony stock based ROMs. For ROMs from other OEMs the corresponding file may have different name and/or location

Run Setup.bat (I think it needs to be run as administrator)

Choose option 2. And from there choose the option to install framework-res.apk and SystemUI.apk. After both are installed return to main menu

Choose option 3 to setup directories

Choose 00 to quit

Now that we have APK Multi-Tool setup for use let us do some baksmaling ;)

II - Decompiling and Baksmaling

Run Script.bat (In case you face problems try running it as administrator. But you probably wouldn't need to unless you extracted all this somewhere in your main windows partition)

Place the apk to be modded in 'place-apk-here-for-modding' folder

Choose option 10 in APK Multi-Tool command window

When it asks for the dependee apk as input drag and drop SemcGenericUxpRes.apk you took from your phone earlier at the command input

If all goes well you would return to the main screen. Don't close the script yet. Back at the APK Multi-tool\projects folder you should find a new folder inside which you would find a folder named smali. This folder has all the required smali files

DON'T CLOSE THE SCRIPT YET

The script needs to be open from baksmaling and needs to stay till you smali it again. If you close it in between you will have to start over again​

Trouble? :(

Try running the scripts as administrator if you get errors

Make sure you have java installed (Latest version recommended. I've used APK MultiTool with v1.6 and 1.7). Open command prompt (Type cmd in run to open command prompt) and type in java. If it says something similar to unknown command, that means you either don't have properly working java or you haven't added java to the command line path. Here is how to add it. The method explained for Vista worked in my Windows 7 laptop

If you get an error similar to wrong dependee then try this. Goto %userprofile%/apktool/framework. You must already be having 1.apk there if you successfully installed framework-res.apk in step I.4 above. Just copy and paste it again in that same folder as a copy (don't overwrite the first 1.apk) and rename this copy to 2.apk and try baksmaling again

III - Coding

This is where the actual work happens. As far as I have understood each class in the java source code would make a seperate smali file. Suppose there is a PhoneStatusBar class in the actual SystemUI source code you will find a PhoneStatusBar.smali somewhere in the smali folder APK Multi-Tool just made. If there was one sub class in the PhoneStatusBar class then that would result in a PhoneStatusBar$1.smali and so on. So you need to figure out which file to edit and do it using any text editor. More help on that in the next post

IV - Smaling and Recompiling

After you finished editing all the smali files and xmls and pngs next the whole thing needs to be smalied and then recompiled into the final apk.

From the APK Multi-tool script choose option 11.

When it asks about y/n enter y

You would now find a new folder named keep in the APK Multi-Tool directory. From that folder delete everything that you changed. Obviously you won't find any smali files as they have already been smalied into dex. So if you made changes in any smali file then delete the .dex file in this folder. If you have made changes in any xml then delete the resources.arsc and also the xml file that you changed. Delete any png or any other file you have changed

Go back to the script and press any key to continue

If all goes well you would now have the modded apk waiting for you in the 'place-apk-here-for-modding' folder with its unsigned added to its file name.

Trouble? :(

Try running the scripts as administrator if you get errors

In the main window type in option 23 to check the log. Try to figure out what you messed up from the information in the log. :p