[Nexus S Themes and Apps] fergie716:
Theming ICS

**If you use these guides for your device all I ask is you link back to this thread so more people can theme ICS for their devices**

I use apktool to for all my decompiling/recompiling purposes. Just a note, this is not a guide on how to set up SDK or apktool. There are tons of guides for that, this is guide on how to set up apktool so you can decompile, recompile, modify and theme ICS apks

I have a Windows 7 laptop, YMMV

Make sure you have latest version of apktool. I have this version and it works fine

So first, you need to update your SDK to the latest version. Open up your SDK Manager and install the latest update. Make sure you update latest Platform tools. After you are done updating, navigate to your SDK path (mine is C:\android-sdk-windows\) and go to platform-tools.

Copy the aapt.exe and paste it in your apktool working folder (my path is C:\apktool)

Now extract the ICS Rom your planning on working on and grab the framework-res.apk from it and put it in your apktool folder

Open up cmd and cd your apktool folder. Next, install ICS resources by

apktool if framework-res.apk

Now your set.

How to Change Battery in ICS ROM

After you got apktool all set up with ICS resources installed get the SystemUI.apk from your ICS ROM, put it in your apktool folder and decompile it.

Make sure you have installed framework-res.apk in apktool prior to decompiling ICS apks

Navigate to your decompiled SystemUI folder, go to /res/drawable-hdpi/

This is where the battery png's are in ICS. Copy/paste your battery png's. To make it more easy, make sure your png's follow the pattern (stat_sys_battery_1.png, etc)

If you plan on changing the png's for charging animation make sure you have the correct png's named stat_sys_battery_charge_anim0.png etc

Delete leftover battery png's, if any, from stock ICS

Once all your png's are in place, you need to modify the corresponding xml's

Those are found in SystemUI/res/drawable/stat_sys_battery.xml and stat_sys_battery_charge.xml

If your using battery png's from a Theme you can grab their corresponding xml's from the /res/drawable folder from the theme, just open up the xml's and make sure the xml is calling upon the correct png's

Now that you have your png's and xml's in place, go back to cmd and recompile

apktool b SystemUI SystemUI-battery.apk

Now, if you have used apktool to recompile you need to sign the apk. ONLY SIGN IT IF YOU USED APKTOOL! I don't know what the process is using Apk Manager

Rename to just SystemUI.apk and make a flashable zip out of it or push with adb and change permissions to rw-r--r--

How to Enable Lockscreen Rotation (ICS)

This one is pretty easy

-decompile framework-res.apk using apktool

-navigate to decompiled folder, go to /res/values/bools.xml

-change "config_enableLockScreenRotation" to "true"

-recompile framework-res.apk

-If you used apktool, sign it, and make a flashable zip to push it to /system/framework/

HOW TO CENTER CLOCK

-decompile your SystemUI.apk

-navigate to your decompiled folder and go to res>layout>status_bar.xml

-look for this line:

<com.android.systemui.statusbar.policy.Clock

-delete the stock clock line, delete the entire line

-next go to the top of your status_bar.xml and place your cursor at the end of this line:

xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">

-press "enter" to create an empty line

-place your cursor at the beginning of that empty line and paste this line of code:

<LinearLayout android:gravity="center" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent">
<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="center" android:paddingTop="3.0px" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:layout_weight="1.0" />
</LinearLayout>

-make sure everything lines up (see my xml below)

-lastly, find this line:

<LinearLayout android:orientation="horizontal" android:id="@id/ticker"

-right after "@id/ticker" add this drawable:

android:background="@drawable/status_bar_bg_tile"

That's it for the Center Clock. Recompile and if you used apktool sign your new SystemUI.apk using apkmanager (option 16)

Here is an example of how your status_bar.xml should look like

<?xml version="1.0" encoding="utf-8"?>
<com.android.systemui.statusbar.phone.PhoneStatusBarView android:orientation="vertical" android:background="@drawable/status_bar_background" android:focusable="true" android:descendantFocusability="afterDescendants"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
<LinearLayout android:gravity="center" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent">
<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="center" android:paddingTop="3.0px" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:layout_weight="1.0" />
</LinearLayout>
<LinearLayout android:orientation="horizontal" android:id="@id/icons" android:paddingLeft="6.0dip" android:paddingRight="6.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent">
<LinearLayout android:orientation="horizontal" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
<com.android.systemui.statusbar.StatusBarIconView android:id="@id/moreIcon" android:visibility="gone" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="fill_parent" android:src="@drawable/stat_notify_more" />
<com.android.systemui.statusbar.phone.IconMerger android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/notificationIcons" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentLeft="true" />
</LinearLayout>
<LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/statusIcons" android:layout_width="wrap_content" android:layout_height="fill_parent" />
<LinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/signal_battery_cluster" android:paddingLeft="2.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent">
<include android:id="@id/signal_cluster" android:layout_width="wrap_content" android:layout_height="wrap_content" layout="@layout/signal_cluster_view" />
<ImageView android:id="@id/battery" android:paddingLeft="4.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
<LinearLayout android:orientation="horizontal" android:id="@id/ticker" android:background="@drawable/status_bar_bg_tile" android:paddingLeft="6.0dip" android:animationCache="false" android:layout_width="fill_parent" android:layout_height="fill_parent">
<ImageSwitcher android:id="@id/tickerIcon" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:layout_marginRight="4.0dip">
<com.android.systemui.statusbar.AnimatedImageView android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:scaleType="center" />
<com.android.systemui.statusbar.AnimatedImageView android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:scaleType="center" />
</ImageSwitcher>
<com.android.systemui.statusbar.phone.TickerView android:id="@id/tickerText" android:paddingTop="2.0dip" android:paddingRight="10.0dip" android:layout_width="0.0dip" android:layout_height="wrap_content" android:layout_weight="1.0">
<TextView android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" />
<TextView android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" />
</com.android.systemui.statusbar.phone.TickerView>
</LinearLayout>
</com.android.systemui.statusbar.phone.PhoneStatusBarView>

HOW TO PUT CUSTOM CARRIER LOGO IN STATUSBAR

-Decompile your SystemUI.apk from whatever ROM your using

-Navigate to your decompiled folder and go to /res/layouts/status_bar.xml

-Look for the line of code that starts with this

<com.android.systemui.statusbar.StatusBarIconView

-Place your cursor at the beginning of that line and press "ENTER" to create an empty line right above it

-In that empty line, copy/paste this line of code

<com.android.systemui.statusbar.phone.CarrierLabel android:textAppearance="@android:style/TextAppearance.StatusBar.Icon" android:textColor="@android:color/transparent" android:background="@drawable/carrier_logo" android:gravity="center_vertical" android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:layout_alignParentLeft="true" />

-Make sure everything "lines up" in your xml (no odd spacing or empty lines)

-Next, you need to select an image you want displayed in your statusbar. I usually stick to one no greater than 100 pixels wide and 45 pixels in height

-Whatever image you decide to use make sure it's in ".png" format and name it "carrier_logo" (with out the quotes)

-Place your carrier_logo.png in the /res/drawable-hdpi/ folder

-Now you can build your new SystemUI, if you used apktool to do all of this don't forget to sign your apk

Here's what mine looks like

HOW TO MAKE A FLASHABLE ZIP FOR YOUR MODIFIED APK

-Download this zip here

-Extract it

-navigate to the /system/app/ folder

-place your modified apk's in that folder

-if your flashing a modified framework-res.apk or anything from /system/framework/ simply create a folder within the system folder and name it "framework" without the quotes and place the apk (framework-res.apk) or jar in there.

-navigate back until you only see the META-INF folder and the system folder

-if you want, you can edit the updater-script found in /META-INF/com/google/android/. Using a text editor open up the updater-script and change some of the UI Print (Mine all say "Flashing some Mod by fergie716" so you can change it to whatever). BUT IF YOUR NEW OR UNSURE DO NOT MESS WITH ANYTHING ELSE IN THE UPDATER SCRIPT, JUST THE UI PRINT

-select both the META-INF and system folders and zip them up (I use 7-zip with default zip settings)

-place your newly created zip on your SD and flash in recovery

-**Just a note, this was made especially for the NS/NS4G so IDK if it'll work for other devices. My updater-script also cleans dalvik-cache before installing. This is also for system apps/framework ONLY! I will post one for data (user) apps if needed

RESOURCES

HOW TO INSTALL SDK

-This is a great guide on how to install ADB with Android SDK. PAY SPECIAL ATTENTION TO THE PICTURES ON HOW TO SET UP CORRECT ENVIRONMENT VARIABLES, ESPECIALLY THE SDK AND JAVA FILES

DOWNLOADS AND HOW TO (OFFICIAL)

-This is the official page for SDK downloads and a "How to" on setting up requirements.. MAKE SURE YOU MEET REQUIREMENTS (JAVA, ETC)

APKTOOL

-Official page for apktool. Get the downloads

ANDROID COMMANDER

-Very useful tool! Can pull data/system apps extremely easily, run a live log, run DDMS, push/pull files with a handy GUI. One of my favorite, and most useful, apps

APK MANAGER

-This is what I use to sign apps. To make it compatible for ICS you need to replace the aapt.exe and apktool.jar (both found in APK Manage's "other folder") with the aapt.exe from latest SDK update (found in platform-tools folder) and the apktool.jar is found in your main apktool directory

DSIXDA'S KITCHEN

-Very useful. Deodex stock ROMs, unpack/repack boot.img, add different functionality to a ROM. Just tons of tools and options

**I WILL ADD MORE LINKS LATER**