[WORKAROUND][SamPWND] Charge to 100% Snapdragon Root

Status
Not open for further replies.

nm1557

Member
Mar 13, 2013
42
29
0
Boston, MA
I was able to find a workaround for the battery percentage:

1. FIRST Get your battery capacity!!!
$ adb shell cat /sys/class/power_supply/battery/batt_capacity_max
800


2. Calculate your 100%
800 * 1.2 = 960

3a. Charge battery fully (UI will say 80%):
Use your new 100% value in place of my 960!!
adb shell
$ su
# echo 960 > /sys/class/power_supply/battery/batt_capacity_max


3b. To revert back (and see actual %):
put your old value in place of my 800 here
adb shell
$ su
# echo 800 > /sys/class/power_supply/battery/batt_capacity_max


Warning:
  1. This is not persistent across reboots (but could be implemented as such)
  2. This does not change the fact that your battery meter will say 80%
  3. This confuses your phone into thinking the 80% limit is higher than it actually is
  4. This could be harmful to your battery life, battery condition, and battery operation
  5. The Control Chip on the battery itself should prevent any unnecessary charging from occurring
  6. I'm just a guy on the internet, don't mess with your phone unless your are willing to pay for any mistakes.

How this works:
  1. The Kernel reads the battery percentage from /sys/class/power_supply/battery/capacity
  2. We make the maximum battery capacity increase by 20% /sys/class/power_supply/battery/batt_capacity_max (the commands above)
  3. Kernel reads the battery percentage from /sys/class/power_supply/battery/capacity again and its now 20% lower because of capacity calculations (percentage = used capacity / batt_capacity_max)
  4. Kernel lets the charging continue to 80% which is in actuality 100%

FAQ
  1. Does this work?
    Yes this works. The explanation is above. Succinctly, these commands trick your kernel into thinking the 80% limit is at 100% of the battery.​
  2. Shouldn't we be adding 25% to reach 100% of the battery?
    While this is correct, I tested a few percentages and noted that 20% increase will reach 99% battery on my phone. This does not mean it will for everyone. PLEASE BE COGNIZANT OF OVERCHARGING
  3. This isn't working for me, why do the values change?
    You must be a superuser in the terminal for these commands to stick. They do not stick across reboots.​
  4. This still doesn't work, wah wah wah. I wan't 100%...
    I am trying to help the community. If you don't want help you can keep the 80% charge. Multiple people have said it works. If you don't want to try it don't. Blindly saying it doesn't work is only poisoning the well.​

Video Guide:

Setting Battery Maximum Past 80%
https://youtu.be/dEdmIDEKYtA

Setting Battery Maximum Back to Original
https://youtu.be/TDirEoSsSkk
 
Last edited:

nm1557

Member
Mar 13, 2013
42
29
0
Boston, MA
If you do step 3b after you charge to 80% it will change to say 100%.

Steps 1,2,3a will bring you to 100% charge physically; almost as if the battery meter was designed to go 0-80

Note: this charges to your battery maximum (regardless of what percentage it says)
 

fever308

Member
Jan 28, 2014
25
6
0
If you do step 3b after you charge to 80% it will change to say 100%.

Steps 1,2,3a will bring you to 100% charge physically; almost as if the battery meter was designed to go 0-80

Note: this charges to your battery maximum (regardless of what percentage it says)
interesting, anyway to keep it persistent?
 

nm1557

Member
Mar 13, 2013
42
29
0
Boston, MA
Yes but you're multiplying 20% of 80 which is incorrect, that only gives you 96% not 100%.
If you subtract 20% from 1000 you get 800, but when you add 20% to 800 its 960, get it?
That's the thing, The 800 value has nothing to do with percentage. It's variable across devices and its coincidence thats its 800.
 

TyPhyter

Member
Aug 19, 2017
11
2
0
i bit the bullet on this and went for it. everything seems to be fine so far. my max_batt_capacity value was 885, so 100% would be 1062, however, i backed it off to 1000, just to be safe. will update after tomorrow.
 

MrBriggs

Member
Aug 21, 2011
28
1
0
Toronto, ON
If A is the number we want the phone to charge the battery to, and the phone stops charging at 80% of A, the number we need to set A to is A * 1.25 , not A * 1.2

So, if the original number is 800, we need to set it to 1000, since the phone will calculate 80% of 1000 to allow it to be charged until 800.

Does that make sense?
 
  • Like
Reactions: TyPhyter

tommyg562000

Senior Member
Feb 6, 2010
56
16
0
So you are effectively increasing the battery capacity of an s8 by 600 mah and s8+ by 700 mah? Am I understanding this thread correctly? If so this seems like a huge problem waiting to happen.
 
  • Like
Reactions: DissonantAI

TyPhyter

Member
Aug 19, 2017
11
2
0
So you are effectively increasing the battery capacity of an s8 by 600 mah and s8+ by 700 mah? Am I understanding this thread correctly? If so this seems like a huge problem waiting to happen.
no, this is a work around after using the SAMpwned root method, which caps the battery life at 80% of max.
 
Last edited:

elliwigy

Forum Moderator / Recognized Developer
Staff member
Mar 16, 2011
12,953
8,823
253
Phoenix
www.sampwnd.com
great find! i figured it had something to do with that file but wasnt sure how it was calculated as mine says 1000 but others was different lol..

but our idea was if this was in fact the case that you create an init.d script that runs on each boot that will automagically correct it each time you reboot the phone

---------- Post added at 07:35 AM ---------- Previous post was at 07:34 AM ----------

to add, this is also why we releaeed it as is, we figured someone in the community would figure it out!

thanks again!

---------- Post added at 08:26 AM ---------- Previous post was at 07:35 AM ----------

actually, changing that file instantly changes back to its original setting for me
 

MrBriggs

Member
Aug 21, 2011
28
1
0
Toronto, ON
One thing that I didn't get.

Okay, the phone will think the maximum is 1000 and will try to charge the battery up to 800, which is the real target. Great.

The screenshot, though, shows the indicator on the notification bar close to 100%, in the rooted phone.

So, the routine that checks the phone charge and limits it to 80% is independent from the check embedded on the indicator charge, right? Otherwise the indicator would never reach 100% even on the rooted phone, and even though the battery was actually 100% charged.
 
Status
Not open for further replies.