Any way to make battery icon image update every 10% rather than every 20%?

GeLopez

Member
Joined
Nov 29, 2009
Messages
683
Reaction score
6
Location
Dallas TX
One of the pitfalls with this approach is that if you want to apply a theme after applying this hack, the new custom framework-res.apk (containing the 10% battery) will be overwritten with the themed framework-res.apk -- hence losing the 10% battery effect. Essential for this hack to work is both the stat_sys_battery.xml file along with the resources.arsc file. The actual png icons can be added later at any time.

I wish there was a way to distribute a framework-res.apk file that made it possible only to update changes (call it a partial framework-res.apk update), rather than distribution of the entire framework-res.apk. That way only the updated portions of the framework could be updated, leaving any themed parts behind. The problem however arises if the theme creator modified the resources.arsc in any way.

Possibly the best way to distribute these two files would be either individually (which could then be applied using ninjamorph) or as a metamorph file. I'm not the biggest fan of either approach, however they would allow others to install this hack over a themed ROM (possibly).

The sure fire method would be to ask theme creators to create their themes with the ability to have custom 10% icons. That would probably be the best way (or have cvpcs add this in when the entire ROM is compiled -- which I'm betting has virtually no chance.).

if you need more ideas "nex thang" theme already comes in 10% intervals, i have been using it since sapphire 1.0 came out.
90 80 70 60 50 40 30 20 15 10
 

GodfatherIP

Member
Joined
Feb 22, 2010
Messages
248
Reaction score
0
Hey, I know this is an old thread but I wanted to set up the 10% battery images on my current rom and was wondering what files I need to copy over to get it to work. So far I took Chevy's SS rom and decompiled it with APK manager. I found the stat_sys_battery.xml file in /res/drawable/ and I copied it over. I then tried to use metamorph to replace the xml and the pngs in my current rom (CM 6.1.2) with new pngs and the xml file with 10% increments. The metamorph operation appeared to work and I was prompted to reboot for changes to take effect. I rebooted and the phone started up fine but now I have no battery images at all (a quick nandroid restore fixed that of course but now back where I started). So I have read this whole thread and am trying to figure out what I did wrong and I think it is either that I didn't copy everything I needed to or that metamorph isn't suitable for the job.

Are there more files I need to copy over? Somebody mentioned the public.xml file. I found this file but I read one post that said it wasn't necessary to copy it over. Someone else mentioned resources.arsc. Where is resources.arsc and can I just copy it over from Chevy's rom as well or will that create some kind of conflicts with my current rom and theme?

My second thought is that maybe metamorph isn't suitable for this? Do I need to actually compile framework-res.apk with APK manager and ADB push it to system to get it to work properly.

Also if anyone is looking for alternate themed 10% battery icons this is the set I'm trying to use: Liquid Battery Icons.

Any help would be appreciated. Thanks!
 

GodfatherIP

Member
Joined
Feb 22, 2010
Messages
248
Reaction score
0
So I tried to recompile with APK Manager but I got a ton of errors (I guess because my framework-res.apk is themed) and a basically empty framework-res.apk. I can recompile with the stock CM framework-res.apk but not the Nextheme version. Is there any way to make this work with a themed framework-res.apk?
 

ACalcutt

Member
Joined
Nov 27, 2009
Messages
209
Reaction score
0
This is how I add 10% increments to the smoked glass theme

start with the stock framework-res.apk
1.) Decompile framework-res.apk with apk manager 4.9 (option 9)
2.) Edit
drawable\stat_sys_battery.xml
3.) Add new battery icons
res\drawable-hdpi\stat_sys_battery_0.png
res\drawable-hdpi\stat_sys_battery_5.png
res\drawable-hdpi\stat_sys_battery_10.png
res\drawable-hdpi\stat_sys_battery_15.png
res\drawable-hdpi\stat_sys_battery_20.png
res\drawable-hdpi\stat_sys_battery_30.png
res\drawable-hdpi\stat_sys_battery_40.png
res\drawable-hdpi\stat_sys_battery_50.png
res\drawable-hdpi\stat_sys_battery_60.png
res\drawable-hdpi\stat_sys_battery_70.png
res\drawable-hdpi\stat_sys_battery_80.png
res\drawable-hdpi\stat_sys_battery_90.png
res\drawable-hdpi\stat_sys_battery_100.png
4.)Compile APK (option 11). I usually do the keep old files option (though i'm not sure its needed)
5.) At this pont the 10% increments are done, then I add the rest of my theme images into unsignedframework-res.apk. (if i add them before compiling i seem to get an error compiling)
6.)Sign APK (option 12)

Attached is the decompiled stat_sys_battery.xml file and the icons I made. feel free to use them.
 

XDRDX

Member
Joined
Nov 4, 2010
Messages
134
Reaction score
0
You may be able to get rid of the error when recompiling if you increase your heap size. I adjust mine to 512 and I have been able to decompile and recompile now without getting errors.
 

Lock-N-Load

Member
Joined
Feb 7, 2010
Messages
69
Reaction score
0
Location
Westsiiide
Update.zip can be installed the same way a rom is... Note that this replaces your services.jar with a modified one to allow transparent images.
Download update.zip

Let me know if you have any problems installing..

necropost...

just FWI... your update.zip will not unzip and expand on the desktop (just to peep the png files) and trying to install it from recovery causes a boot loop on my D1. I tried 3 times.
 

Lock-N-Load

Member
Joined
Feb 7, 2010
Messages
69
Reaction score
0
Location
Westsiiide
This is how I add 10% increments to the smoked glass theme

start with the stock framework-res.apk
1.) Decompile framework-res.apk with apk manager 4.9 (option 9)
2.) Edit
drawable\stat_sys_battery.xml
3.) Add new battery icons
res\drawable-hdpi\stat_sys_battery_0.png
res\drawable-hdpi\stat_sys_battery_5.png
res\drawable-hdpi\stat_sys_battery_10.png
res\drawable-hdpi\stat_sys_battery_15.png
res\drawable-hdpi\stat_sys_battery_20.png
res\drawable-hdpi\stat_sys_battery_30.png
res\drawable-hdpi\stat_sys_battery_40.png
res\drawable-hdpi\stat_sys_battery_50.png
res\drawable-hdpi\stat_sys_battery_60.png
res\drawable-hdpi\stat_sys_battery_70.png
res\drawable-hdpi\stat_sys_battery_80.png
res\drawable-hdpi\stat_sys_battery_90.png
res\drawable-hdpi\stat_sys_battery_100.png
4.)Compile APK (option 11). I usually do the keep old files option (though i'm not sure its needed)
5.) At this pont the 10% increments are done, then I add the rest of my theme images into unsignedframework-res.apk. (if i add them before compiling i seem to get an error compiling)
6.)Sign APK (option 12)

Attached is the decompiled stat_sys_battery.xml file and the icons I made. feel free to use them.

do you just install this from recovery as an update.zip?

nope, I guess not :) can you provide a compiled version of all of this that can be just installed as an update.zip in recovery? I do not have the ability to do steps 1-6 on my mac.
 
Last edited:

R-1 Rider

New Member
Joined
Dec 8, 2009
Messages
8
Reaction score
0
This is how I add 10% increments to the smoked glass theme

start with the stock framework-res.apk
1.) Decompile framework-res.apk with apk manager 4.9 (option 9)
2.) Edit
drawable\stat_sys_battery.xml
3.) Add new battery icons
res\drawable-hdpi\stat_sys_battery_0.png
res\drawable-hdpi\stat_sys_battery_5.png
res\drawable-hdpi\stat_sys_battery_10.png
res\drawable-hdpi\stat_sys_battery_15.png
res\drawable-hdpi\stat_sys_battery_20.png
res\drawable-hdpi\stat_sys_battery_30.png
res\drawable-hdpi\stat_sys_battery_40.png
res\drawable-hdpi\stat_sys_battery_50.png
res\drawable-hdpi\stat_sys_battery_60.png
res\drawable-hdpi\stat_sys_battery_70.png
res\drawable-hdpi\stat_sys_battery_80.png
res\drawable-hdpi\stat_sys_battery_90.png
res\drawable-hdpi\stat_sys_battery_100.png
4.)Compile APK (option 11). I usually do the keep old files option (though i'm not sure its needed)
5.) At this pont the 10% increments are done, then I add the rest of my theme images into unsignedframework-res.apk. (if i add them before compiling i seem to get an error compiling)
6.)Sign APK (option 12)

Attached is the decompiled stat_sys_battery.xml file and the icons I made. feel free to use them.

I don't use Saphire, but I am using a deodexed FRG83G and this method worked perfectly. Thanks for the tutorial.
 
Top