[Sony Xperia P, U, Sola, Go] p3001ee:
short tutorial how I ported the ARC/S QuickPanel to Xperia S

Because some of you has ask me (PM), how did the port. So - I think it could be interesting for other developers, themers and modders ;)

So - here we go!

Following files I have used:

deodexed framwork-res.apk for LT26i

deodexed SystemUI.apk for LT26i

(all above from here)

SemcGenericUxpRes.apk for LT26i (from my own phone)

Modded SystemUI.apk with QuickPanel from LT18i (see xda)

APK-Manager from this post [EDIT:] Link is dead, so download here!

And now my installed programs:

Java 1.7 SDK

Android SDK

Eclipse with ADT-Plugin

KDiff3 (http://kdiff3.sourceforge.net/)

python 2.6

- Install Eclipse and ADT-Plugin

- Install Android SDK from eclipse

(All above is not really necessary, but I'am using eclipse DDMS View for debugging purpose of the phone; for that, you need to USB-Debugging enabled on your Xperis S)

- Install Apk-Manager-ICS to C:\Apk-Manager-ICS

First Step

- Open DOS-Box and go to folder C:\Apk-Manager-ICS\other

- Install deodexed framework-res.apk file with:

apktool if <path>\framework-res.apk​

- Move deodexed LT26i (Xperia S) SystemUI.apk to C:\Apk_Manager_ICS\place-apk-here-for-modding\StockSystemUI.apk

- Move LT15/18i (ARC/S) modded SystemUI.apk (with QuickPanel) to C:\Apk_Manager_ICS\place-apk-here-for-modding\ModSystemUI.apk

- Start APK-Manager:

- Select Option 22and choose "StockSystemUI.apk"

- Select Option 10 (Decompile with Dependencies)

- when ask for "dependee apk": Drop the "SemcGenericUxpRes.apk" to APK-Manager DOS Box and pressed <ENTER>

- project folder for decompiled StockSystemUI is C:\Apk_Manager_ICS\projects\StockSystemUI.apk\

- Do the same steps for ModSystemUI.apk

- Modded SystemUI is decompiled in C:\Apk_Manager_ICS\projects\ModSystemUI.apk\

Second Step

- open another DOS box and go to folder C:\Apk_Manager_ICS\projects\ModSystemUI.apk\

- start python script (attached zip file) to find all QuickPanel related resources

and create a Change-Report:

python <path>\getChangeReport.py smali\com\lidroid\systemui\quickpanel res\values\public.xml > C:\Apk_Manager_ICS\ChangeReport.txt​

- Open C:\Apk_Manager_ICS\ChangeReport.txt in your favorite Editor (e.x. Notepad++) and have a look

- integrate all found resources to LT26i Stock SystemUI project folder tree and add these

resources to the relevant XML files (but do not touch "res/values/public.xml"!!!!

(This file will be re-generated by apk-manager!)

- compile Stock SystemUI (with the new resources)

- Say "Y" for question, if this is an system apk

- Say "y" for when ask for "copy over additional files"

- When waining for pressing a key:

- Delete "resources.arsc" and any resources you have added in "C:\Apk_Manager_ICS\keep"

- Press any key to finalize apk building

(Now all resources has been added and a new public.xml with valid IDs has been integrated)

- First step APK is saved by APK-Manager as C:\Apk_Manager_ICS\place-apk-here-for-modding\unsignedStockSystemUI.apk

- rename it to C:\Apk_Manager_ICS\place-apk-here-for-modding\Step1StockSystemUI.apk

- Decompile it in the same way as described above!

- After decompile, new project folder exists now: C:\Apk_Manager_ICS\projects\Step1StockSystemUI.apk\

- have a look in res\values\public.xml: all new resources are listed and got an ID

- copy C:\Apk_Manager_ICS\projects\ModSystemUI.apk\smali\lidroid to C:\Apk_Manager_ICS\projects\Step1StockSystemUI.apk\smali\lidroid

- copy C:\Apk_Manager_ICS\projects\ModSystemUI.apk\smali\com\lidroid to C:\Apk_Manager_ICS\projects\Step1StockSystemUI.apk\smali\com\lidroid

- adapting all IDs in all smali files (C:\Apk_Manager_ICS\projects\Step1StockSystemUI.apk\smali\com\lidroid\systemui\quickpanel)

to the new ID from res\values\public.xml (The prev. generated ChangeReport will help!!)

- use kdiff3 to compare

1: C:\Apk_Manager_ICS\projects\StockSystemUI.apk\smali\com\android\systemui\statusbar\phone\PhoneStatusBar.smali

2: C:\Apk_Manager_ICS\projects\Step1StockSystemUI.apk\smali\com\android\systemui\statusbar\phone\PhoneStatusBar.smali​

- using kdiff3 to integrate changes in method "makeStatusBarView" (main diff block at the end of the method)! Not more!

- check ID in method "makeStatusBarView":

...

invoke-virtual {v0, v9, v2}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter; )Landroid/content/Intent;

const v6, 0x7f03001c

invoke-static {v0, v6, v11}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup; )Landroid/view/View;

...​

- change ID (0x7???????) to the ID for "power_widget_layout" (look in res/values/public.xml)

- when all changes has been made, choose Option 11 in APK-Manager to compile apk

- Say "y" for question, if this is an system apk

- Say "y" for when ask for "copy over additional files"

- If apk-manager is waiting to press any key, delete "classes.dex" from the "keep" folder" and press enter in APK-Manager

- The final SystemUI.apk is saved as "C:\Apk_Manager_ICS\place-apk-here-for-modding\unsignedStep1StockSystemUI.apk"

- rename it to "SystemUI.apk".

Et-Vola! All done! SystemUI.apk is ready for installation! ;)