Battery Fix 2.3.x

Search This thread

jug6ernaut

Inactive Recognized Developer
Jun 7, 2006
2,560
467
San Antonio, Tx
First thanks to kamma and his thread HERE. This fixed was 100% inspired by his attempt, i only had the benefit of having access to some files he didnt. This thread is based off his, but with the files from 2.3.3 which did not have the jumping issue.

I have NOT tested extensively, but in my limited experience(and that of a few others) this does fix the problem.

Code:
[color=#FF0000]USE THIS SCRIPT AT YOUR OWN RISK[/color]

This is just a proof-of-concept fix. I dont guarantee any improvement, because i have not much time to test it.
I simply replace battery libs and apps extracted from [color=#FF0000]ATT 2.2.3*[/color].

How to:
1. Download [color=#FF0000]CMW_Jug6_batfix.zip*[/color] (bellow in Attached Files)
2. Copy it to sdcard or sdcard-ext
3. Reboot into CWM recovery
5. Click "install zip from sdcard"
6. Choose zip from sdcard
7. Pick the [color=#FF0000]CMW_Jug6_batfix.zip*[/color]
8. Install
9. Reboot

V2 - Removed BatteryManager.apk & BatteryReport.apk as they are not needed
 

Attachments

  • CMW_Jug6_FIXv2.zip
    231 KB · Views: 16,791
Last edited:

jug6ernaut

Inactive Recognized Developer
Jun 7, 2006
2,560
467
San Antonio, Tx
  • Like
Reactions: poeticdecision

sublimejosh2000

Senior Member
Dec 14, 2010
925
350
Atlanta
Its not as easy as just removing the odex files.... lol... it has to be actually "deodexed" there is a difference. I will do this if you don't know how...
Yes as you go between roms you would need to reapply, that is until(if its working 100%) its added to the roms themeselves.



it has both, but if you want u can remove the 2 .odex files from the zip.



Sent from my Cyanbreaded Gingered Atrix!
 

OSNPA

Senior Member
Apr 13, 2011
603
62
Google Pixel 6 Pro
Installed at 85% battery life, was thinking it was actually closer to 95% at the time I ran this as I hadn't done much since it was fully charged. Didn't wipe battery stats or anything, it started back up at 84%. Did a few things to see how quickly it would drop, when it came down to 81%, I rebooted and wiped battery stats and davlk cache. Took a while on reboot after those wipes, started up at 80%. Still think it should have been higher than the 85% it started at, so I'm charging up to 100% and running Battery Calibration app. Will edit this post when I get the results, but it's not bouncing around like it was before. Awesome work Jug6!

Edit: Charged it to full charge, wouldn't charge past 98%, so I ran the battery calibration app, restarted, and on restart is said 99% and full charged. It was recommended in the app to fully discharge battery and then fully recharge without interruption. Will try to drain it quickly -> Pandora! :cool:
 
Last edited:

jug6ernaut

Inactive Recognized Developer
Jun 7, 2006
2,560
467
San Antonio, Tx
Its not as easy as just removing the odex files.... lol... it has to be actually "deodexed" there is a difference. I will do this if you don't know how...



Sent from my Cyanbreaded Gingered Atrix!

I would appreciate it, I won't b able to until around 4cst. Granted I'm running this on an deobexed rom.

/me admits his knowledge of compatibility between deobexed/obexed is very lacking lol

Sent from my MB860 using Tapatalk
 

sublimejosh2000

Senior Member
Dec 14, 2010
925
350
Atlanta
Deodexing... From what I understand so far

I would appreciate it, I won't b able to until around 4cst. Granted I'm running this on an deobexed rom.

/me admits his knowledge of compatibility between deobexed/obexed is very lacking lol

Sent from my MB860 using Tapatalk

I think I would need some of the 2.3.3 framework to do it though..

Basically,
Each .apk has a "classes.dex" file in it.. when a .apk or .jar for that matter has an .odex file associated with it. whish is the case with the Atrix and other phones too... what has happened is that the "Classes.dex" file has been taken out of the .apk/.jar file and placed in a .odex form. this way it is device spacific and cannot be moddified or replaced using generic .apk/.jar files .. i.e. customized ...

he reason it is "working" for you, is because your phone is the spacific device these files were made for... so it isn't crapping out. At least, i think this is the reason...

In order to run a deodex on these file though, I would need some of the reference files that they are dependant on in order to run the script to do so. hat is the "Boot class file paths" that you see below...

I am glad to see these are seeming to fix the problem though. I will see what I can do, but I am getting errors running the script:

Code:
D:\Atrix\Baksmali>java -jar baksmali-1.2.6.jar -x Ba


Error occured while loading boot class path files. A
org.jf.dexlib.Util.ExceptionWithContext: Cannot loca
.odex
        at org.jf.dexlib.Code.Analysis.ClassPath.loa
a:237)
        at org.jf.dexlib.Code.Analysis.ClassPath.ini
5)
        at org.jf.dexlib.Code.Analysis.ClassPath.Ini
ssPath.java:110)
        at org.jf.baksmali.baksmali.disassembleDexFi
        at org.jf.baksmali.main.main(main.java:278)
 

undisputedfb

Senior Member
Feb 24, 2009
300
31
Samsung Galaxy S21+
Google Pixel 6
ok tried this out on kens gb rom, started at 96, played a game got it down to 93, rebooted into cwm, wiped dav and batt stats, rebooted, was still at 93. so im letting it get down to 85 or so and see if it keeps. this may be the fix for this. i thank you so much for it working this good jug, and hope it is implemented soon.
i just have one thing to say to jug::
: " ooooh ITS THE JUGGANAUT *****" :p
 

aleve1983

Senior Member
Oct 29, 2010
322
20
Viterbo
i have cherry 0.5b, i go in recovery with 83%, i flash this zip, no wipecache no wipe stats no wipe and when i reboot i have 83%, it's work well, and it work with deodex
 
  • Like
Reactions: andrx

humjaba

Senior Member
Mar 9, 2011
143
19
Clemson, SC
I just did the following
- Phone was at 70%, restarted
- Phone then read 90%
- Installed this
- Phone still reads 90%, I will restart at lunch time in a few hours to see if it jumps at all

I am running Kenneth's stock 2.3.4 ROM

Thanks!
 

josuetenista

Senior Member
May 25, 2010
266
67
Toronto
Did the following:
-phone was showing 96% (about 3 hours ago)
-installed this (didn't wipe dalvik cache or battery stats)
-restarted and was showing 96%
-been using the phone for the last Hour
-phone showed 76%
-restarted
-phone is still showing 76%

Great finally with have a working solution

PS:why should I wipe dalvik cache?

Enviado desde mi MB860 usando XDA Premium App
 

Top Liked Posts

  • There are no posts matching your filters.
  • 44
    First thanks to kamma and his thread HERE. This fixed was 100% inspired by his attempt, i only had the benefit of having access to some files he didnt. This thread is based off his, but with the files from 2.3.3 which did not have the jumping issue.

    I have NOT tested extensively, but in my limited experience(and that of a few others) this does fix the problem.

    Code:
    [color=#FF0000]USE THIS SCRIPT AT YOUR OWN RISK[/color]
    
    This is just a proof-of-concept fix. I dont guarantee any improvement, because i have not much time to test it.
    I simply replace battery libs and apps extracted from [color=#FF0000]ATT 2.2.3*[/color].
    
    How to:
    1. Download [color=#FF0000]CMW_Jug6_batfix.zip*[/color] (bellow in Attached Files)
    2. Copy it to sdcard or sdcard-ext
    3. Reboot into CWM recovery
    5. Click "install zip from sdcard"
    6. Choose zip from sdcard
    7. Pick the [color=#FF0000]CMW_Jug6_batfix.zip*[/color]
    8. Install
    9. Reboot

    V2 - Removed BatteryManager.apk & BatteryReport.apk as they are not needed
    3
    Deodexed

    Here are the files from OP deodexed. Untested, but should work fine :p

    Example installation:

    Code:
    adb remount
    adb root
    adb shell rm /data/dalvik-cache/*Battery*
    adb shell rm /system/app/BatteryManager.odex
    adb shell rm /system/app/BatteryReport.odex
    adb push BatteryManager.apk /system/app/BatteryManager.apk
    adb push BatteryReport.apk /system/app/BatteryReport.apk
    adb reboot
    2
    Using root explorer ... change permissions to match the other Apk's

    (RW-R--R--):

    USER - READ, WRITE,
    GROUP - READ
    OTHERS - READ

    make sure you mount "/system" as read/write....


    Can you touch on these permissions with a little more detail? I see the permissions area of the file, but not sure what should be checked. Sorry...still getting the FC after replacing the files from v1 with the stock .apk's posted after the fix. Thanks for all of your help.



    Sent from my Cyanbreaded Gingered Atrix!
    1
    Brilliant, will try immediately! Does it matter if you switch between roms, do you have to re-apply then?

    Yes as you go between roms you would need to reapply, that is until(if its working 100%) its added to the roms themeselves.

    Will test, thanks Jug.

    Guess I would need to deodex it for a deodexrom?

    it has both, but if you want u can remove the 2 .odex files from the zip.
    1
    Thanks for the explanation. Really, the MB865 devs do a really good job, but sometimes there are issues with inaccurate battery reporting, which can be alleviated by wiping battery stats and with a recalibration. Thanks for your replies!

    Recalibration is best achieved by draining until phone dies and then charging to full. Once full keep charging and power off. Allow phone to charge in the unbooted state. I have had little success with wiping battery stats and I believe that the official word is that those files that gets deleted by the wipe procedure are recreated upon every charge so it is a bit of a fallacy. Of course, if the battery daemon has bad code, you'd be looking at a thread like this for a replacement piece of code to fix the problem.

    Sent from my MB860 using Tapatalk 2