[Experimental] Battery-Mod-Automator [Updated]

Chris3D

Well-known member
Sep 21, 2010
646
179
0
Visit site
[Update] I've started to test this on themes, and some are causing problems. When decompiling theme frameworks, I'm finding some have missing images, others have corrupt images that can't be extracted or opened, some have out-of-range resource ID's that were manually added in, etc. It's a bit of a mess.

I added in a prompt at the end of my program asking if you want to proceed to push the new framework back to your phone. If along the way, you saw a big list of errors scroll up the screen, choose no. If everything looked clean, go ahead and choose yes.

I'm going to leave my program up because it seems to work perfectly on stock and properly assembled frameworks, but not so much on ones that have been hacked to hell and back. As I have time, I'll try to figure out how to work around the issues giving it trouble.



Ok, if any brave souls want to play Guinea Pig, here's what I've come up with...

The problem: With the plethora of different roms and themes, each with their own features, each being updated constantly, it's impossible to provide individual frameworks with my battery mod for each possible combination. Well, technically, it's not impossible, but I do have a life! :p

The solution: A simple program that will automate adding my icons to your current framework, whatever it may be. Whatever rom and/or theme you have, this will pull your current framework-res.apk file off your phone, decompile it, add my icons, recompile it and push it back to your phone. Since this is applied on top of your current framework, it should avoid conflicts where some things get reverted back to stock.

The issues: On some roms, I've noticed the wallpaper gets reverted to that beach scene, and sometimes the current Google account is lost. In both cases, it's pretty simple to reset your wallpaper and re-add your Google account. Not sure why these things happen, but again, they're easy to fix.

So far, I've tested this on stock EB01, EB01 SuperClean versions 2.2, 2.3 and 2.4 and Blackhole 4.1... and it works perfectly with the exception of the above issues. Shutdown menus don't break, everything seems to work. Will it work on other roms and/or with other themes? It should, but you'll just have to give it a try.

Is this dangerous? Of course it is! Not really, the first thing this does is make a backup of your existing framework-res.apk that can be restored should it ultimately not work. If it doesn't work, just run the program again, choose the option for restoring your framework and it'll send the backup back to your phone. That said, I would still highly recommend having a full nandroid backup at the ready.

What do I need? Since this is a DOS bat program, you'll obviously need to be running Windows. XP, Vista, Win7, it shouldn't matter. And since some of the tools the bat file calls are Java programs, you'll need the Java Runtime Environment which you can download here. (You only need the Runtime Environment (JRE), not the full JDK). To check if you might already have Java, just open up a command prompt and type "java". If you get a screen of usage details, chances are you're good to go. You'll also need the Samsung drivers loaded up and working, but you probably already have them.

The bonus: If you don't like my icons, just replace them with your own, re-run the program and it'll add them to your framework. Just put your icons in /modfiles/png and make sure they're properly referenced in the xml files located in /modfiles/xml. If you just replace all of my icons with your own, you won't need to touch the xml files, but if you want to change the animations, the xml files will need to be updated accordingly. Just take a look at what's there, it should be fairly obvious how these xml's work.

So how does it work? Unzip the attached file (make sure directory structure remains intact) and run ModMyBattery.bat. Make sure your phone is rebooted into Clockwork Recovery and that your /system is mounted. To check, go into "mounts and storage" and make sure the first option reads "unmount /system" (indicating that it's currently mounted). The menu in my program should be self explanatory.

So, cross your fingers and give it a whirl. Again, it seems to work on the roms I've used it on, but there's no guarantees something in some other rom or theme might cause problems. I've had to make certain assumptions about the configuration of the framework and while I think I covered the bases, I have no way of knowing until it's tested more broadly. If it doesn't work, let me know what rom and theme you're using and I'll see if I can update the program to work with them.

So again, this is highly experimental and I'll honestly be amazed if it works without a hitch on a majority of roms, but it's worth a shot. Also, while I haven't tried it on other versions beside EB01, I don't see why it would have any problems with DL30 or even older versions. Keep in mind, however, something was broken in pre-FroYo that prevented the display of charging icons in 1% increments.

And just to say it again, a current, full nandroid backup is highly recommended! If it doesn't work, restore your backup (either your backup framework with this program or your full nandroid backup), try to let me know where it went wrong, but I make no guarantees I'll be able to get it to work in all cases.

Did I mention this was highly experimental? No? Well it is! ;)

Here's the program:
BatteryModder
 
Last edited:

clifto

Member
Dec 10, 2010
14
1
0
Visit site
Going to try this for sure!...later today when I wake up. will let you know. It will be on 2.4 SC voodoo. Excited!

Sent from my SCH-I500 using Tapatalk
 

clifto

Member
Dec 10, 2010
14
1
0
Visit site
Welp I tried it out on my Voodoo 2.4 SC. It went through all that script then restarted my phone into a loop of the galaxy S logo loading over and over. I am doing a nandoid restore right now. Anything else i can try for you on this?

** Also does voodoo need to be on or off?
 

Chris3D

Well-known member
Sep 21, 2010
646
179
0
Visit site
Welp I tried it out on my Voodoo 2.4 SC. It went through all that script then restarted my phone into a loop of the galaxy S logo loading over and over. I am doing a nandoid restore right now. Anything else i can try for you on this?

** Also does voodoo need to be on or off?

Off to a rough start! :eek:

Did you have a theme applied?

Voodoo on/off shouldn't matter.

After it's run, I've noticed it takes a while for the phone to boot up for the first time. I tried it on a fresh SuperClean 2.4 and it worked fine...
 

clifto

Member
Dec 10, 2010
14
1
0
Visit site
No theme just 2.4 SC. Voodoo was on. I really wish i could have copy/pasted you the info that was showing on the script. After it was done it all went away and showed the start of the script again. Said something about java not initiating or something. Ill do it again here in a bit and give you better details. Although after the "java" message it seemed to pick up and load everything. But again ill give you better details soon. Thanks
 

clifto

Member
Dec 10, 2010
14
1
0
Visit site
This is what i get. Afterwards it goes to Samsung logo then in a normal amount of time starts the "S" logo but gives the vibrations for force close and loops the boot. Took out battery and am going to try a wipe data/cach reload 2.4 SC fresh and try again.
Untitled.jpg
 

Chris3D

Well-known member
Sep 21, 2010
646
179
0
Visit site
This is what i get. Afterwards it goes to Samsung logo then in a normal amount of time starts the "S" logo but gives the vibrations for force close and loops the boot. Took out battery and am going to try a wipe data/cach reload 2.4 SC fresh and try again.
Untitled.jpg

Ahhh, it doesn't appear you have the Java Runtime Environment installed. Download it here: Java SE Downloads

What was happening is that the tools to decompile and recompile the framework weren't working (because they're Java apps and the JRE to run them wasn't installed on your computer).

You should be able to re-run my program and choose the option to restore your framework.
 

clifto

Member
Dec 10, 2010
14
1
0
Visit site
Ahhh, it doesn't appear you have the Java Runtime Environment installed. Download it here: Java SE Downloads

What was happening is that the tools to decompile and recompile the framework weren't working (because they're Java apps and the JRE to run them wasn't installed on your computer).

You should be able to re-run my program and choose the option to restore your framework.

Indeed i did not. I installed JRE and then went to a nandroid restore...in the process of fidiling with all this I must of click nandroid back and backed up a fresh copy of one of the Super Cleans..:-[ Thank god for TI back-ups!! Anyways from a fresh install i tried the batt mod and it worked great! Now we know that JRE is a pre-req for this to function. Great work!
 
  • Like
Reactions: Chris3D

Chris3D

Well-known member
Sep 21, 2010
646
179
0
Visit site
finally at home and about to give this a try, thanks again Chris

Make sure you download the latest version (same link) and follow the recommendation to not push the modified framework to your phone if you see a string of errors scroll up the screen while it's uploading.

I've been testing theme after theme and it seems to be having trouble with most, unfortunately. When I examine a theme's framework-res.apk, most of them are really hacked together pretty badly, which makes adding in this battery mod in an automated fashion difficult to impossible.

It still works on stock and properly assembled frameworks (like the ones that come with ROMs like SuperClean and BlackHole), but applying this over a hacked theme isn't working. I had hoped this would be possible, but it's not looking good.

Just please make sure you have a backup ready...
 

tnez21

Well-known member
Sep 27, 2010
286
35
0
Visit site
Thanks for the pointers Chris. Not expecting any issues tho (fingers crossed lol) Not running any themes just add-ons, all that are also in Sc 2.4 Actually i yanked them from from 2.4 lol ( android policy, framework, and framework-res)

Sent from my SCH-I500 using Tapatalk
 

Brettdacosta

Well-known member
Dec 8, 2010
325
7
0
Visit site
I have VA clean green flashed, but I'm wanting to try this. Did the nandroid, but when I got to run the program it says can't find the drive - make sure you're mounted (which I did) and have the drivers installed. What drivers is it talking about (I've had in connected to a computer numerous times already). Thanks in advance. I'd really like to run this! One of my most favorite add-ons! Great work!
 

Brettdacosta

Well-known member
Dec 8, 2010
325
7
0
Visit site
Mike - I'm not sure what you mean. I'm running 2.9.1 with VA Green over it. I don't have a % with my charging icon. I'd really like that. Not sure if there's a way I could get it to work? Thanks, man.
 

Chris3D

Well-known member
Sep 21, 2010
646
179
0
Visit site
The idea of this was to be able to add battery percent to an existing theme, but it hasn't worked out. Almost every theme I tried it on failed, because almost every theme is hacked pretty badly - the frameworks work fine, but can't be decompiled without all kinds of errors, missing and/or broken files. So, this little program can't automate the adding of the accurate battery mod. I left it up because it will work with properly assembled framework like the ones that come with the stock SuperClean and Black Hole roms.
 

Trending Posts

Forum statistics

Threads
943,181
Messages
6,917,670
Members
3,158,868
Latest member
drkrleitch