[MOD] Disable low battery, battery temperature pop-ups and full battery notification

InfX

Senior Member
May 1, 2008
885
216
73
The reason for this little hack is the fact those 2 pop-ups can become an extreme double-annoyance while driving in hot weather. Imagine, your battery is below 15%, yet scorching hot, beyond the charging cut-off threshold. Connect a charger and you get bombarded with the "charging paused, battery temperature too high" pop-ups. Disconnect it and you get a low battery ones. This little patch deals with the issue by simply disabling the annoying pop-ups. It also disables the annoying battery full notification.

Please note, this doesn't modify any functionality, it just disables the pop-ups. The battery will not and should not charge when overheated.

Instructions:

  1. Download and unpack "BatteryPatch.zip", you should now have "Patch.js" jscript along with the "utils" directory.
  2. Fetch your "/system/app/SystemUI.apk" from the device, place it in the same directory, along with the "Patch.js".
  3. Apply the patch by launching "Patch.js" and push the patched SystemUI.apk back to the device.

Updates:

  1. Not every ROM seems to have the battery full notification and/or battery overheating popup. Patching those is now optional, the script will show a warning in case it fails to patch those instead of erroring out completely.
  2. There are some ROMs out there with showLowBatteryWarning method looking somewhat different from what i've seen on my S3. In order to try & let the patch work on more ROMs, the showLowBatteryWarning method is now being bypassed entirely. Hopefully, no ROM does anything important inside that method, besides showing the annoying low battery popups. In any case, as usual, you use the patch - you take the risk.

PS: For those willing and able to apply the patch manually, download the second zip and do a 3 way merge.
 

Attachments

Last edited:

_neutron_

Senior Member
Jul 19, 2012
100
32
0
Nice mod...just added it to my rom.. purposely drained the battery...no notification pop up (hopefully won't get the temp warning anyway)

Lovely work

Already given 8 thanks today...I will come back!
 
  • Like
Reactions: InfX

InfX

Senior Member
May 1, 2008
885
216
73
Nice mod...just added it to my rom.. purposely drained the battery...no notification pop up (hopefully won't get the temp warning anyway)

Lovely work

Already given 8 thanks today...I will come back!
Thanks. Temp warning should not be there any longer, too. But the rest of them (bad charger, overcurrent, stuff like that) are still there, i don't think killing those is a good idea.

The reason i did this was primarily the temperature warning. I've been looking all over the forum on how to disable it, but couldn't find any info, so i though, "what the hell, i can find it myself, it's not such a big deal"... during the search i've noticed the low bat one, too, and though "hmm, i hate that one too, lets kill it as well".

Thats about it.
 
  • Like
Reactions: alichiddy and Bsn87

ExTREmE99

Senior Member
Jul 26, 2006
404
79
0
Bay Area, CA
sorry to sound like a total noob, but im completely new to apktool. was reading up on it and trying it, but im slightly confused. what options do you chose exactly when decompiling? i couldnt find the power smali file after decompiling
 

InfX

Senior Member
May 1, 2008
885
216
73
There are plenty of explanations/tutorials on this around the forum. About not having the smali after decompiling... any chance your rom is odexed? In this case you wont be getting any smali files, cause all the code is in the odex file, not the apk. You will have to deodex it in this case and, possibly, reodex it before placing it back on the device (not sure about it, specifically i am unsure how the odex dependecies work).

Sadly, i cannot provide a ready to use apk, there are too many versions being in use, especially considering the 15 toggles mod, the battery icon mod as well as many other visual mods also patch stuff inside this apk, increasing the number of variations even further. So, sorry, no ready to use apk.
 

InfX

Senior Member
May 1, 2008
885
216
73
Is there a flashable file?
Nope, and it is extremely hard to make. In fact, impossible, with the currently available CWM tools, as far as i know. It would be "for ROM version <insert_version_here> with 15 toggles and circle battery", "for ROM version <insert_version_here> without 15 toggles and green battery" etc etc etc kind of variations, and as i already mentioned, i doubt this is a viable option.

Anyone can prove me wrong and provide a way of writing a CWM script that would decompile (deodex if needed) an existing apk, apply a patch, recompile it and than replace it ? Out of all the things needed, i only know how to do the "replacing" part :(
 

_neutron_

Senior Member
Jul 19, 2012
100
32
0
Can i ask a massive favour?

im now havin problems with my systemui in regards to it recording the changes (decompiling & recompiling - i think i have an issue with my pc but i cant figure it out)

Could you apply the changes to the attached file for me?
 

Attachments

ExTREmE99

Senior Member
Jul 26, 2006
404
79
0
Bay Area, CA
There are plenty of explanations/tutorials on this around the forum. About not having the smali after decompiling... any chance your rom is odexed? In this case you wont be getting any smali files, cause all the code is in the odex file, not the apk. You will have to deodex it in this case and, possibly, reodex it before placing it back on the device (not sure about it, specifically i am unsure how the odex dependecies work).

Sadly, i cannot provide a ready to use apk, there are too many versions being in use, especially considering the 15 toggles mod, the battery icon mod as well as many other visual mods also patch stuff inside this apk, increasing the number of variations even further. So, sorry, no ready to use apk.
ah that explains why there is no smali file. thanks for the help!
 

GalaxyS3man

Member
Aug 4, 2012
39
4
0
I also cannot get this mod to work, wishing easier method coming soon, like one zip file thru recovery or similar... i dont have patience to this sorta things.

Sent from my GT-I9300 using xda app-developers app
 

InfX

Senior Member
May 1, 2008
885
216
73
I also cannot get this mod to work, wishing easier method coming soon, like one zip file thru recovery or similar... i dont have patience to this sorta things.

Sent from my GT-I9300 using xda app-developers app
Well, if you know of someone that could have possibly coded an infrastructure for doing this kind of patches onboard, automatically, i would be glad to get pointed to the right direction, and will integrate it there. Currently, i don't know of any.

Seriously, though... is it possible to baksmali in recovery mode somehow ? Can one run patch, sed and similar utilities there ? If yes, can i see an example ? Cause if that's possible, it can make a "flashable zip" for stuff like that possible.
 
  • Like
Reactions: _neutron_

InfX

Senior Member
May 1, 2008
885
216
73
hmm, so if i have these files in my app folder:
systemui.apk
systemui.odex

I cannot just add/replace the code as described?
You can deodex, patch the smali while having it handy during deodexing, and, possibly, reodex it back into an odex file and replace just the odex. Never did it myself, though. I find odexed roms to be too much of a hassle while modding stuff to use those.
 

GalaxyS3man

Member
Aug 4, 2012
39
4
0
Is it ok if i ask help too?

You can deodex, patch the smali while having it handy during deodexing, and, possibly, reodex it back into an odex file and replace just the odex. Never did it myself, though. I find odexed roms to be too much of a hassle while modding stuff to use those.
I been trying for days...help, i go crazy with those popups :(
 

Attachments

InfX

Senior Member
May 1, 2008
885
216
73
GalaxyS3man, your apk is NOT odexed. Took me barely 2 minutes to apply the patch. Here we go...

PS: TBH, i've been under impression people on XDA are perfectly familiar applying and/or finding out this kind of stuff, really :)
 

Attachments

  • Like
Reactions: GalaxyS3man