Advanced Charging Controller
ACC is an Android software mainly intended for extending battery service life. In a nutshell, this is achieved through limiting charging current, temperature and voltage. Any root solution is supported. Regardless of whether the system is rooted with KernelSU/Magisk, the installation is always “systemless”.
LICENSE
Copyright 2017-2024, VR25
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.
DISCLAIMER
Always read/reread this reference prior to installing/upgrading this software.
While no cats have been harmed, the author assumes no responsibility for anything that might break due to the use/misuse of it.
To prevent fraud, do NOT mirror any link associated with this project. Do NOT share builds (tarballs/zips)! Share official links instead.
WARNINGS
ACC manipulates Android low level (kernel) parameters which control the charging circuitry. The author assumes no responsibility under anything that might break due to the use/misuse of this software. By choosing to use/misuse it, you agree to do so at your own risk!
Some devices, notably from Xiaomi (e.g., Poco X3 Pro), have a faulty PMIC (Power Management Integrated Circuit) that can be triggered by acc. The issue blocks charging. Ensure the battery does not discharge too low. Using acc’s auto shutdown feature is highly recommended (default shutdown_capacity is 5).
Refer to this XDA post for additional details.
lybxlpsv suggests booting into bootloader/fastboot and then back into system to reset the PMIC.
DONATIONS
Please, support the project with donations (links at the bottom). As the project gets bigger and more popular, the need for coffee goes up as well.
PREREQUISITES
- Must read - how to prolong lithium ion batteries lifespan
- Android or KaiOS
- Any root solution (e.g., KernelSU, Magisk, SuperSU, etc)
- Busybox* (only if not rooted with KernelSU or Magisk)
- Non KernelSU/Magisk installs require a way of running
/data/adb/vr25/acc/service.sh
on boot to initialize acc. - Terminal emulator
- Root text editor (optional)
* A busybox binary can simply be placed in /data/adb/vr25/bin/
.
Permissions (0755
) are set automatically, as needed.
Precedence: /data/adb/vr25/bin/busybox > KernelSu’s or Magisk’s busybox > system’s busybox
Other executables or static binaries can also be placed in /data/adb/vr25/bin/
(with proper permissions) instead of being installed system-wide.
QUICK START GUIDE
All commands/actions require root.
Install/upgrade: flash* the zip or use a front-end app. There are two additional ways of upgrading:
acc --upgrade
(online) andacc --flash
(zip flasher). Rebooting after installation/removal is generally unnecessary. Manual uninstall before upgrade is unnecessary.[Optional] run
acc
(wizard). That’s the main command to remember.[Optional] run
acc pause_capacity resume_capacity
(default75 70
) to set the battery levels at which charging should pause and resume, respectively.If you come across any issues, refer to the troubleshooting, tips and FAQ sections below. Read as much as you can, prior to reporting issues and/or asking questions. Oftentimes, solutions/answers will be right before your eyes.
Notes
Steps 2
and 3
are optional because there are default settings.
For details, refer to the default configuration section below.
Users are encouraged to try step 2
- to familiarize themselves with the available options.
Settings can be overwhelming. Start with what you understand. The default configuration has you covered. Don’t ever feel like you have to configure everything. You probably shouldn’t anyway - unless you really know what you’re doing.
Uninstall: run acc --uninstall
or flash* /data/adb/vr25/acc-data/acc-uninstaller.zip
.
ACC runs in some recovery environments as well.
Unless the zip is flashed again, manual initialization is required.
The initialization script is /data/adb/vr25/acc/service.sh
.
BUILDING AND/OR INSTALLING FROM SOURCE
Dependencies (Build)
- git, wget, or curl (pick one)
- zip
Build Tarballs and Flashable Zips
Download and extract the source code:
git clone https://github.com/VR-25/acc.git
orwget https://github.com/VR-25/acc/archive/master.tar.gz -O - | tar -xz
orcurl -L# https://github.com/VR-25/acc/archive/master.tar.gz | tar -xz
cd acc*
sh build.sh
(or double-clickbuild.bat
on Windows 10+, if you have Windows subsystem for Linux (with zip) installed)
Notes
build.sh
automatically sets/correctsid=*
in*.sh
andupdate-binary
files. To skip generating archives, run the build script with a random argument (e.g.sh build.sh h
).To update the local source code, run
git pull --force
or re-download it (withwget
/curl
) as described above.
Install from Local Source or GitHub
[export installDir=<parent install dir>] sh install.sh
installs acc from the extracted source.sh install-online.sh [-c|--changelog] [-f|--force] [-k|--insecure] [-n|--non-interactive] [%parent install dir%] [commit]
downloads and installs acc from GitHub - e.g.,sh install-online.sh dev
. The order of arguments doesn’t matter. For upgrades, if%parent install dir%
is not supplied, the original/current is used.sh install-tarball.sh [module id, default: acc] [parent install dir (e.g., /data/data/mattecarra.accapp/files)]
installs the tarball (acc*gz
) from the script’s location. The archive must be in the same directory as this script - and obtained from GitHub: https://github.com/VR-25/acc/archive/$commit.tar.gz ($commit
examples:master
,dev
,v2020.5.20-rc
).One can also use a single command to download and install acc:
curl -sSL https://raw.githubusercontent.com/VR-25/acc/dev/install-online.sh | /system/bin/sh -s dev
wget -qO- https://raw.githubusercontent.com/VR-25/acc/dev/install-online.sh | /system/bin/sh -s dev
Notes
install-online.sh
is theacc --upgrade
back-end.The default parent installation directories, in order of priority, are:
/data/data/mattecarra.accapp/files/
(ACC App, but only for non KernelSU/Magisk installs),/data/adb/modules/
(KernelSU/Magisk) and/data/adb/vr25/
(other root solutions).No argument/option is strictly mandatory. The exception is
--non-interactive
for front-end apps.The
--force
option toinstall-online.sh
is meant for re-installation and downgrading.sh install-online.sh --changelog --non-interactive
prints the version code (integer) and changelog URL (string) when an update is available. In interactive mode, it also asks the user whether they want to download and install the update.You may also want to read Terminal Commands >
Exit Codes
below.
SETUP/USAGE
As the default configuration (above) suggests, ACC is designed to run out of the box, with little to no customization/intervention.
The only command you have to remember is acc
.
It’s a wizard you’ll either love or hate.
If you feel uncomfortable with the command line, skip this section and use a front-end app instead.
Alternatively, you can use a text editor
to modify /data/adb/vr25/acc-data/config.txt
.
The config file itself has configuration instructions.
Those are the same found in the default configuration section, above.
Terminal Commands
PLUGINS
Those are scripts that override functions and some global variables.
They should be placed in /data/adb/vr25/acc-data/plugins/
.
Files are sorted and sourced.
Filenames shall not contain spaces.
Hidden files and those without the .sh
extension are ignored.
There are also volatile plugins (gone on reboot, useful for debugging): /dev/.vr25/acc/plugins/
.
Those override the permanent.
A daemon restart is required to load new/modified plugins.
An alternative to plugins are one-line scripts. Refer to the default configuration section above.
NOTES/TIPS FOR FRONT-END DEVELOPERS
Basics
ACC does not require KernelSU/Magisk. Any root solution works, as long as busybox is installed.
Use /dev/acca
instead of regular acc
.
It’s optimized for front-ends, guaranteed to be readily available after installation/upgrades and significantly faster than its acc
counterpart.
Additionally, /dev/acca --set prop1=bla prop2="bla bla" ...
runs asynchronously (non-blocking mode) - meaning, multiple instances of it work in parallel.
It may be best to use long options over short equivalents - e.g., --set charging_switch=
instead of -s s=
.
This makes code more readable (less cryptic).
Include provided descriptions of ACC features/settings in your front-end. Provide additional information (trusted) where appropriate. Explain settings/concepts as clearly and as concisely as possible.
Take advantage of acc exit codes.
Refer back to SETUP/USAGE > [Terminal Commands](#terminal-commands) > Exit Codes
.
Installing/Upgrading ACC
This should be trivial. The simplest way is flashing acc from KernelSU/Magisk module manager.
Alternatively, install.sh
, install-online.sh
or install-tarball.sh
can be used.
For details, refer back to install from local source or GitHub.
Developers can also use the updateJSON API. The front-end downloads and parses this JSON file. The format is as follows:
Uninstalling ACC
Either run /data/adb/vr25/acc/uninstall.sh
(no reboot required) or uninstall from KernelSU/Magisk module manager and reboot.
Initializing ACC
On boot_completed
receiver and main activity
, run:
test -f /dev/acca || /data/adb/vr25/acc/service.sh
Explanation:
ACC’s working environment must be initialized - i.e., by updating the stock charging config (for restoring without a reboot) and pre-processing data for greater efficiency. This is done exactly once after boot. If it were done only after installation/upgrade, one would have to reinstall/upgrade acc after every kernel update. That’s because kernel updates often change the default power supply drivers’ settings.
Since acc’s core executables are dynamic ([expected to] change regularly), those are linked to /dev/
to preserve the APIs.
The links must be recreated once after boot (since /dev/
is volatile).
accd
is a symbolic link to service.sh
.
If service.sh is executed every time the main activity
is launched, accd will be repeatedly restarted for no reason.
Thus, we run test -f /dev/acca || /data/adb/vr25/acc/service.sh
, as opposed to just /data/adb/vr25/acc/service.sh
Notes
- This “manual” initialization is only strictly required for non KernelSU/Magisk installs – and only once per boot session. In other words, KernelSU and Magisk already run
service.sh
shortly after boot. - ACC’s installer always initializes it.
Managing ACC
As already stated, front-ends shall use the executable /dev/acca
.
Refer to the default configuration and terminal commands sections above.
The default config reference has a section entitled “aliases”.
Use ONLY those with /dev/acca --set
!
i.e., /dev/acca --set chargingSwitch=...
is not supported!
Use either s
or charging_switch
.
chargingSwitch
and all the other “camelcase” style variables are for internal use only (i.e., private APIs).
Do not parse the config file directly.
Use --set --print ['regex']
and --set --print-default ['regex']
.
Refer back to terminal commands for details.
TROUBLESHOOTING
acc -t Results Are Inconsistent
Refer to “default config > batt_status_workaround”.
Charging Switch
By default, ACC uses whichever charging switch works (“automatic” mode). However, things don’t always go well.
Some switches are unreliable under certain conditions (e.g., while the screen is off).
Others hold a wakelock. This causes fast battery drain when charging is paused and the device remains plugged.
Charging keeps being re-enabled by the system, seconds after acc daemon disables it. As a result, the battery eventually charges to 100% capacity, regardless of pause_capacity. Refer to config > force_off.
High CPU load (drains battery) was also reported.
In the worst case scenario, the battery status is reported as
discharging
, while it’s actuallycharging
.
In such situations, one has to enforce a switch that works as expected. Here’s how to do it:
- Run
acc -t
to see which switches work. - Run
acc -ss
to enforce a working switch. - Test the reliability of the set switch. If it doesn’t work properly, try another.
Since not everyone is tech savvy, ACC daemon automatically applies settings for certain devices for greater compatibility.
These are in acc/oem-custom.sh
.
Custom Max Charging Voltage And Current Limits
Unfortunately, not all kernels support these features. While custom current limits are supported by most (at least to some degree), voltage tweaking support is exceptionally rare.
That said, the existence of potential voltage/current control file doesn’t necessarily mean these are writable* or the features, supported.
* Root is not enough. Kernel level permissions forbid write access to certain interfaces.
Sometimes, restoring the default current may not work without a system reboot. A workaround is setting the default max current value or any arbitrary high number (e.g., 9000 mA). Don’t worry about frying things. The device will only draw the max it can take.
WARNING: limiting voltage causes battery state of charge (SoC) deviation on some devices. The battery management system self-calibrates constantly, though. Thus, as soon as the default voltage limit is restored, it’ll start “fixing” itself.
Limiting current, on the other hand, has been found to be universally safe. Some devices do not support just any current value, though. That’s not to say out-of-range values cause issues. These are simply ignored.
If low current values don’t work, try setting current_workaround=true
.
Refer to the default configuration section for details.
One can override the default lists of max charging current/voltage control files by copying acc/ctrl-files.sh
to /data/adb/vr25/acc-data/plugins/
and modifying it accordingly.
Note that default limits must be restored prior to that to avoid the need for a system reboot.
Reminder: A daemon restart is required to load new/modified plugins.
Diagnostics/Logs
Volatile logs (gone on reboot) are stored in /dev/.vr25/acc/
(.log
files only).
Persistent logs reside in /data/adb/vr25/acc-data/logs/
.
acc -le
exports all acc logs, plus Magisk’s and extras to /data/adb/acc-data/logs/acc-$device_codename.tgz
.
The logs do not contain any personal information and are never automatically sent to the developer.
Automatic exporting (local) happens under specific conditions (refer back to SETUP/USAGE > Terminal Commands > Exit Codes
).
Install, Upgrade, Stop and Restart Processes Seem to Take Too Long
The daemon stop process implies complete reversal of changes made to the charging management system.
Sometimes, this requires the charger to be plugged.
That’s because some devices have kernel bugs and/or bad charging driver implementations.
That said, accd is always stopped gracefully to ensure the restoration takes place.
One who knows what they’re doing, can force-stop accd by running pkill -9 -f accd
.
Kernel Panic and Spontaneous Reboots
Control files that trigger these are automatically backlisted (commented out in /data/adb/acc-data/logs/write.log
).
Restore Default Config
This can potentially save a lot of time and grief.
acc --set --reset
, acc -sr
or rm /data/adb/vr25/acc-data/config.txt
(failsafe)
Samsung, Charging Always Stops at 70% Capacity
This is a device-specific issue (by design?). It’s caused by the store_mode charging control file. Switch to batt_slate_mode to prevent it. Refer back to charging switch above for details on that.
Slow Charging
At least one of the following may be the cause:
- Charging current and/or voltage limits
- Cooldown cycle (non optimal charge/pause ratio, try 50/10 or 50/5)
- Troublesome charging switch (refer back to
TROUBLESHOOTING > Charging Switch
) - Weak adapter and/or power cord
Unable to Charge
Refer back to the warnings section above.
Unexpected Reboots
Wrong/troublesome charging control files may trigger unwanted reboots.
ACC blacklist [some of] these automatically (registered in /data/adb/vr25/acc-data/logs/write.log
, with a leading hashtag).
Sometimes, there may be false positives in there - i.e., due to unexpected reboots caused by something else. Thus, if a control file that used to work, suddenly does not, see if it was blacklisted (acc -t
also reveals blacklisted switches).
Send write.log
to the developer once the reboots have stopped.
WARP, VOOC and Other Fast Charging Tech
Charging switches may not work reliably with the original power adapter. This has nothing to do with acc. It’s bad design by the OEMs themselves. If you face issues, either try a different charging switch or a regular power brick (a.k.a., slow charger). You may also want to try stopping charging by limiting current/voltage.
Why Did accd Stop?
Run acc -l tail
to find out.
This will print the last 10 lines of the daemon log file.
A relatively common exit code is 7
- meaning all charging switches failed to disable charging.
It usually happens due to kernel issues (refer to the previous subsection - charging switch).
The daemon only stops due to this if acc is set to automatically determine the switches to use (default behavior).
Manually setting a working switch with acc -ss
or acc -s s="SWITCHES GO HERE --"
disables auto mode and prevents accd from stopping if the set the charging switches fail.
POWER SUPPLY LOGS (HELP NEEDED)
Please run acc -le
and upload /data/adb/vr25/acc-data/logs/power_supply-*.log
to my dropbox (no account/sign-up required).
This file contains invaluable power supply information, such as battery details and available charging control files.
A public database is being built for mutual benefit.
Your cooperation is greatly appreciated.
Privacy Notes
- Name: random/fake
- Email: random/fake
See current submissions here.
LOCALIZATION
Currently Supported Languages and Translation Levels (default, full, good, fair, minimal)
- Chinese, simplified (zh-rCN): minimal
- Chinese, traditional (zh-rTW): minimal
- English (en): default
- French (fr): good
- German (de_DE): fair
- Indonesia (id): minimal
- Portuguese, Portugal (pt-PT): minimal
- Turkish (tr): good
Translation Notes
Start with copies of acc/strings.sh and, optionally, README.md.
Modify the header of strings.sh to reflect the translation (e.g., # Español (es)).
Anyone is free and encouraged to open translation pull requests. Alternatively, a compressed archive of translated
strings.sh
andREADME.md
files can be sent to the developer via Telegram (link below).Use
acc -sl
(–set –lang): language switching wizard oracc -s l=<lang_string>
to set a language.
TIPS
Always Limit the Charging Current If Your Battery is Old and/or Tends to Discharge Too Fast
This extends the battery’s lifespan and may even reduce its discharge rate.
750-1000mA is a good range for regular use.
500mA is a comfortable minimum - and also very compatible.
If your device does not support custom current limits, use a dedicated (“slow”) power adapter.
Generic
Force fast charge: appy_on_boot="/sys/kernel/fast_charge/force_fast_charge::1::0 usb/boost_current::1::0 charger/boost_current::1::0"
Google Pixel Devices
Force fast wireless charging with third party wireless chargers that are supposed to charge the battery faster: apply_on_plug=wireless/voltage_max::9000000
.
This may not work on all Pixel devices. There are no negative consequences when it doesn’t.
Export/import Config
Export: acc -s > /sdcard/Download/config.txt
Import: acc -s /sdcard/Download/config.txt
Partial import is supported - meaning, users can share just a portion of the config (e.g., acc -sp curr,volt > file
); whoever imports this, gets just those changes.
Override Battery mAh Capacity
An “extended” battery won’t charge fully if the kernel still has the stock charge_full_design
value.
Some devices allow that to be modified. If that’s the case for you, use apply_on_boot
to set the desired value(s) in /sys/class/power_supply/*/charge_full_design
.
Override Broken Temperature Sensor
If your battery’s thermistor always reports a negative value, and charging is very slow or even off, see if the following helps (paste and run):
acc -c d temp_cool; acc -c a ':; for i in */temp_cool */temp_cold; do [ -f $i ] || continue; chown 0:0 $i && chmod 0644 $i && echo "-999" > $i && chown 0444 $i || :; done'
FREQUENTLY ASKED QUESTIONS (FAQ)
How do I report issues?
Open issues on GitHub or contact the developer on Telegram (preferred) or XDA (links below).
Always provide as much information as possible.
Attach /sdcard/Download/acc-logs-*.tgz
- generated by acc -le
right after the problem occurs.
Refer back to TROUBLESHOOTING > Diagnostics/Logs
for additional details.
Why won’t you support my device? I’ve been waiting for ages!
Firstly, have some extra patience!
Secondly, several systems don’t have intuitive charging control files; I have to dig deeper - and oftentimes, improvise; this takes time and effort.
Lastly, some systems don’t support custom charging control at all; in such cases, you have to keep trying different kernels and uploading the respective power supply logs.
Refer back to POWER SUPPLY LOGS (HELP NEEDED)
.
Why, when and how should I calibrate the battery manager?
With modern battery management systems, that’s generally unnecessary.
However, if your battery is underperforming, you may want to try the procedure described at https://batteryuniversity.com/article/bu-603-how-to-calibrate-a-smart-battery .
I set voltage to 4080 mV and that corresponds to just about 75% charge. But is it typically safer to let charging keep running, or to have the circuits turn on and shut off between defined percentage levels repeatedly?
It’s not much about which method is safer. It’s specifically about electron stability: optimizing the pressure (voltage) and current flow.
As long as you don’t set a voltage limit higher than 4200 mV, and don’t leave the device plugged in for extended periods of time, you’re good with that limitation alone. Otherwise, the other option is actually more beneficial - since it mitigates high pressure (voltage) exposure/time to a greater extent. If you use both, simultaneously - you get the best of both worlds. On top of that, if you enable the cooldown cycle, it’ll give you even more benefits.
Ever wondered why lithium ion batteries aren’t sold fully charged? They’re usually ~40-60% charged. Why is that? Keeping a battery fully drained, almost fully drained or 70%+ charged for a long times, leads to significant (permanent) capacity loss
Putting it all together in practice…
Night/heavy-duty/forever-plugged profile: keep capacity within 40-60% (e.g., acc 50 45) and/or voltage around ~3900 mV
Day/regular profile: max capacity: 75-80% and/or voltage no higher than 4100 mV
Travel profile: capacity up to 95% and/or voltage no higher than 4200 mV
* https://batteryuniversity.com/article/bu-808-how-to-prolong-lithium-based-batteries/
I don’t really understand what the “-f|–force|–full [capacity]” is meant for.
Consider the following situation:
You’re almost late for an important event. You recall that I stole your power bank and sold it on Ebay. You need your device and a good battery backup. The event will take the whole day and you won’t have access to an external power supply in the middle of nowhere. You need your battery charged fast and as much as possible. However, you don’t want to modify ACC config nor manually stop/restart the daemon.
Do I have to install/upgrade both ACC and AccA?
To really get out of this dilemma, you have to understand what ACC and AccA essentially are.
ACC is a Android program that controls charging. It can be installed as an app (e.g., AccA) module, Magisk module or standalone software. Its installer determines the installation path/variant. The user is given the power to override that.
A plain text file holds the program’s configuration. It can be edited with any root text editor. ACC has a command line interface (CLI) - which in essence is a set of Application Programing Interfaces (APIs). The main purpose of a CLI/API is making difficult tasks ordinary.
AccA is a graphical user interface (GUI) for the ACC command line. The main purpose of a GUI is making ordinary tasks simpler. AccA ships with a version of ACC that is automatically installed when the app is first launched.
That said, it should be pretty obvious that ACC is like a fully autonomous car that also happens to have a steering wheel and other controls for a regular driver to hit a tree. Think of AccA as a robotic driver that often prefers hitting people over trees. Due to extenuating circumstances, that robot may not be upgraded as frequently as the car. Upgrading the car regularly makes the driver happier - even though I doubt it has any emotion to speak of. The back-end can be upgraded by flashing the latest ACC zip. However, unless you have a good reason to do so, don’t fix what’s not broken.
Does acc work also when Android is off?
No, but this possibility is being explored. Currently, it does work in recovery mode, though.
I have this wakelock as soon as charging is disabled. How do I deal with it?
The best solution is enforcing a charging switch that doesn’t trigger a wakelock.
Refer back to TROUBLESHOOTING > Charging Switch
.
A common workaround is having resume_capacity = pause_capacity - 1
. e.g., resume_capacity=74, pause_capacity=75.
What’s idle mode, and how do I set it up?
It’s the ability of running off the charger. The battery behaves as if it were physically disconnected from the device. The primary indicator of idle mode is charging current around 0 mA. One can customize idleThreshold (absolute value).
Idle mode is great for extended device use (e.g., GPS navigation, gaming, server). Use it when the charger must be plugged for a long time (or permanently).
IMPORTANT: lithium batteries have the longest lifespan when kept about 40-60% charged (about 3.7-3.9ish Volts). That said, try not to use idle mode above 60% too often.
Not all devices support the “native” idle mode. Hence, variants of “emulated” idle mode are available:
- Limit the charging voltage (requires kernel support) to a value that gets you close to the desired battery level. To avoid false positives, determine the value only after the device has been unplugged for a minute or so.
- Pause/resume charging based on voltage thresholds (e.g., acc 3900 keeps voltage within 3850 and 3900 millivolts).
- Set resume_capacity to (pause_capacity - 1), e.g., acc 50 49.
Notes
- In idle mode, the battery does discharge, although very slowly. The same happens to a battery that is sitting on a shelf.
- In emulated idle mode, the battery tends to hold its charge, since it works as a “passthrough” device. Imagine pouring water into a glass that is already full.
How do I enable “smart charging”?
Configure day and night profiles:
acc -c a ": day profile; at 6:00 \"acc -s pc=75 mcc= mcv=4100; acc -n 'Switched to day profile'\""; acc -c a ": night profile; at 22:00 \"acc -s pc=50 mcc=500 mcv=3900; acc -n 'Switched to night profile'\""
LINKS
Download Link
Module Info
© 2025 Magisk Community