[HD2 Android Themes and Apps] patmorris:
[18 JAN][TUT][Added New % Battery Icons] How to Mod/Change framework-res.apk(NAND&SD)

This thread is mainly intended for those of us using Desire HD based builds but these methods should work for any Android build that is not squashed. I have seen many posts of people stuggling to mod this file and get it to work. I don't really know anything about squashing so I can't be of much help there. It took me a while to figure out how to get the % Battery mod after flashing to a NAND Android build so I thought I'd start a thread to let people know how to do it, beacause I had to reflash my ROM about 20 times before I finally got it right. Using Root Explorer or any other type of file explorer within Android to change the file always gave me a bootloop. Fortunately, with the SD card Android builds its a little easier.

Here is one I've created with some of my own stuff, and some of others:

I've added these custom styles. The custom large digit one has large digits so I can see how much life Android has sucked out of my battery at any given moment. I added a second one with whiter digits as well, cause I had a hard time seeing the gray ones real clearly. I take no credit for the UOT Vertical battery style, it is from UOT Kitchen. All I did was change the border from white to gray. They are stock Desire HD (Base 1.72) framework-res.apk's with only the battery changed. They all have 1% increments.

If you are not using a Desire HD Android build just ignore the Desire HD stuff on here. You should still be able to mod your own framework-res.apk however you like and use it. You can take the battery icons out of the ones I've created and put them in your own. If you post the battery icons I created myself somewhere else please just let me know.

Here is a step by step method for replacing the file on a NAND Build:

1. Backup with titanium backup, clockwork or whatever you like to use. If applying this mod doesn't work, you will get a bootloop and have to reflash your ROM.

2. Droid Explorer is necessary.

It is available here: http://de.codeplex.com/releases/view/50997

To use Droid Explorer one needs the JDK and Android SDK, available here:

http://www.oracle.com/technetwork/java/javase/downloads/index.html

http://developer.android.com/sdk/index.html

The USB Drivers for adb are also necessary, they are attached to this page. One should google how to properly install them as it varies depending on what version of windows you use. I had a hard time finding them which is why I've included them in this post. Android SDK is supposed to come with them but I couldn't find them in the Android SDK. If you are using a windows x64 machine (like me) you may need to edit a few registry keys on your machine to get Droid Explorer working properly. Read the FAQ carefully on the Droid Explorer website, and when you edit the registry file, make sure you properly specify the path to wherever you installed the Android SDK. Droid Explorer will not work otherwise.

3. Connect phone to computer, leave charge only checked (make sure adb is turned on in settings). Start Droid Explorer and connect to your phone. Sometimes I have to connect/reconnect a few times before Droid Explorer works properly.*

4. Navigate to root/system/framework. Scroll down to the F's. Look for the file towards the top of the F section titled "Android System." Delete that file.

5. Copy and paste the new/modded framework-res.apk into the root/system/framework folder.

6. Hit the Reboot button on Droid Explorer and enjoy!!

7. You may need to re-enter your google account and facebook (sense builds) info.

*NOTE:

Droid Explorer has not been treating me well lately and will not properly connect to my phone so I have had to change my method slightly:

1.Instead I delete framework-res.apk with root explorer within android

2.Then I long press the end key to pull up the power menu, which causes a bootloop.

3. While the phone is in bootloop I can connect with Droid Explorer and put framework-res.apk where it belongs

4. The bootloop ends, and I usually need to reboot for real

To replace the file on an SD Card build, just create these folders in your android folder on your SD card: root/system/framework. place framework-res.apk in the framework folder and reboot.

How to Modify your framework-res.apk:

framework-res.apk can be mofidified in a number of different ways, but this is the method I've found easiest for me and seems to work every time. If one is interested in using only UOT Kitchen, then it is a simple task to have your framework-res.apk modded.

UOT Kitchen: http://circle.glx.nl/

To use the UOT Kitchen one must run this script on the .zip UOT Kitchen provides. Although this script is labeled as being only for MDJ Desire HD SD Card builds, it works for NAND Desire HD and I think would work for almost any HD2 Android build, not just Desire HD ones. (Can't promise that though):

http://xdaforums.com/showthread.php?t=856915

Follow the directions for the script, though you may have to specify the path to 7zip (I did). For NAND bulds just grab the framework-res.apk out of the root/system/framework folder the script creates.

To modify the framework-res.apk from UOT Kitchen:

(There are many ways to do this, this is just the method I use)

1. Find a framework-res.apk that has something in it you like, such as certain icons or graphics, even animations, and rename it to framework-res.zip and extract it.

2. Take your flashable .zip from UOT Kitchen and open it with winrar. open the framework folder and framework-res.apk (don't extract anything)

3. Take whatever you want out of the other framework-res.apk that you extracted and paste it in the new one that is still in archive. Close all the windows and run the script. Load the new framework-res.apk the script created on your phone.

For A Non-UOT Kitchen Created framework-res.apk:

Sometimes I don't want to use anything UOT has to offer but I still send my framework-res.apk through the kitchen (If for no other reason than to get the battery .xml's put in there). After that I change it however I want and run the script. I do this because I have yet to mod framework-res.apk in this manner and not have it work. IT ALWAYS WORKS, if I can get it in the framework folder in android properly.

Most images (battery, signal bars, etc) are in the folder called drawable-hdpi

Battery Animations are in drawable

And window transition animations are in anim.

I have been able to take the animations from MDJ Revolution HD, modify some graphics from CoreDroid, use some of UOT Kitchen's stuff and create my own battery Icons all in one file. Personalized just for me.

Here are a few useful links:

Stock Desire HD Battery with %: http://xdaforums.com/showthread.php?t=894837

Battery Theme Mod: http://xdaforums.com/showthread.php?t=838413

Circular % Battery Mod: http://xdaforums.com/showthread.php?t=724778

sopL87's Skins and Frameworks: http://xdaforums.com/showthread.php?t=801928