# [Tutorial] Customize your battery mod!



## roman

It's impossible to please everyone and everyone has their personal preferences. This tutorial is for when rom devs don't make what you want! As the title says it's just for battery mods but you can apply this to almost anything to get what you want. I'm going to try and make this as easy as possible. From start to finish. Please read the whole post! I hope this helps at least someone~

First things first. You need to go and download 7zip. Ok.

Now you need to go and find which battery icon images you'd like. For this example, we're going to download the Trigger theme kit. Click here to download. In the kit, I have 3 sets of battery images you can choose from. Let's do it with the semi-accurate batteries.









Conveniently, I have already named them properly for you! These names are pretty consistent throughout all the Vibrant ROMs I believe, but just be aware that it depends on the framework and the accurate battery mod built into the framework.

Next we need the framework to place these in. I'm going to use Trigger as an example. But you can use any ROM or framework. So if you are using it from a ROM, you need to first open it. 









I'd suggest you familiarize yourself with this structure if you already don't know it! Just poke around and see what's where.

Next navigate to the _system _directory, then _framework_. Here's what you should see. 









The images for the batteries (along with most other system related images) are in framework-res.apk. Pull it out to a new directory. I've got it in the same directory as my theme kit.

After that, you need to right click on the APK and go to the 7-zip option and click open archive.









Many of you probably already know this, but too much information never hurts! APKs are basically renamed zip files. When they are compiled all the files inside are compiled into binary format so you cannot edit them unless you decompile the framework. The exception are images. This is why we can do this and edit them without having to make a new file. We can just open it and replace what we want and replace it back!

Ok so next, after you open it you'll see a couple directories. You need to go to the _res _directory. In here are more folders! You want to find one that is named _drawable-hdpi_ or _drawable-hdpi-v4_. In here is the jackpot. You will find the battery images in there, too. 









Now here's the magic! Select all the images from the _batt_semi-accurate batteries_ folder and drag them into the opened zip archive (into the res/drawable-hdpi folder)!










7zip will pop up a dialog asking if you want to overwrite or something. Click yes.

Now your framework is ready to be put on your phone!

You can do this one of two ways. Either make a flashable for your phone. Or transfer it via adb in recovery. I like doing method b but I'll briefly go over both.

method A:
I've attached a flash.zip. It contains the new framework I've gone over how to make in this tutorial. Only it is flashable. You can either use it (but replacing the framework-res.apk with the one you're working with) or you can take some time to learn how it's made! 
*I made this flashable zip with my ACS tool (link in sig). You can do the same! Open the tool, go to options, make sure you click the checkbox next to system, close options. Click generate zip. You now have an empty flashable zip. You needed to click the systme checkmark because now it knows to transfer anything in the system directory in the zip file to the system directory on your phone. So basically you need to replicate the directory structure. If you open my zip you can see I've done so.

method B:
You need to know how to use adb and command line somewhat to do this. This isn't an ADB guide so please google one to brush up. 
Boot your phone into clockwork recovery. And open up a new command line. You need to get into the same folder where your new framework-res.apk is. 









commands are pretty basic, cd to change directory.
next you need to run the command to push the file onto the right place on your phone


Code:


adb push framework-res.apk /system/framework/

that should do the trick. it should say transferred in x seconds blah blah. once that's done. reboot. done.

NOTE: In order to make your battery mod more complete, you will have to copy framework.res/drawable/stat_sys_battery.xml & stat_sys_battery_charge.xml from your desired framework. These files tell the framework about your images, etc. Please ask if this step is unclear


----------



## Kwes1020

Thank you very much for this. Have read several guides over this but this is by far the best one I have seen. Gonna have to mess with it once I get a new power supply for my pc. This should be generic for pretty much all versions of android right?


----------



## roman

Yep! Should be almost identical


----------



## 60lpsdf250

roman said:


> Yep! Should be almost identical


Excellent tutorial... You mentioned that images in framework-res.apk can be modded with out messing with the binary. Would this apply to the "3G" text and signal bars, clock/date colors, wifi, alarm clock, etc. images? Just curious... I would like to change these on my current ROM, just like the battery symbol.

Any information is greatly appreciated.


----------



## roman

Yep! As long as it doesn't end with a .9.png you can modify it without any repercussions and drop it back in the zip


----------



## 60lpsdf250

roman said:


> Yep! As long as it doesn't end with a .9.png you can modify it without any repercussions and drop it back in the zip


Awesome, thanks...


----------



## Zach

Thanks so much for this!!! I like to change my battery appearance a lot!!


----------



## 60lpsdf250

[quote name='NOTE: In order to make your battery mod more complete, you will have to copy framework.res/drawable/stat_sys_battery.xml & stat_sys_battery_charge.xml from your desired framework. These files tell the framework about your images, etc. Please ask if this step is unclear [/QUOTE']

Hey roman,
i've googled till my fingers are bloody... i'm wondering how to change these xmls... can't figure it out. i have followed your tutorial and not been able to copy these file from the Trigger theme (they aren't there, afaikt). any insight would be greatly appreciated.

EDIT: I fingered it out!


----------



## ro6666lt

nice guide, but not a rom/kernel/etc... moved.


----------



## knam316

thank you! ive been looking for a tutorial on this!


----------

