[Magisk] VR25:
This is a fairly long post...

After some more research and testing, I came up with new stuff, packed into what I've been calling "MCS on steroids".

Please, read the info below fully and carefully, before doing anything else (breathing included).

# Magic Charging Switch (mcs)
## Copyright (C) 2017-2018, VR25 @ xda-developers
### License: GPL v3+

---
#### DISCLAIMER

This software is provided as is, in the hope that it will be useful, but without any warranty. Always read/reread this reference prior to installing/upgrading. While no cats have been harmed, I assume no responsibility under anything which might go wrong due to the use/misuse of it.

A copy of the GNU General Public License, version 3 or newer ships with every build. Please, read it prior to using, modifying and/or sharing any part of this work.

To prevent fraud, DO NOT mirror any link associated with this project.

---
#### WARNING

MCS manipulates Android's low level (kernel) parameters which control the charging circuitry.
While nothing went wrong with my device (harpia) so far, I assume no responsability under anything which might break due to the use/misuse of this software.
By choosing to use/misuse MCS, you agree to do so at your own risk!

---
#### DESCRIPTION

Advanced battery charging controller for extending lithium ion batteries lifespan.

Battery stats are reset on `$maxCapacity%` (doesn't work on all devices).

Charging is controled based on temperature, battery capacity, current (amperage), and more.

Charging slows down at `$fairTemp°C` and/or `$maxCapacity% - $coolDownCapacity%`. This allows battery to cool down and its voltage to drop to a less stressful threshold.

Charging is halted when battery temperature reaches `$maxTemp°C` and/or capacity equals `$maxCapacity%`.

To prevent deep battery discharge and eventual cell damage, system is automatically and cleanly shutdown if capacity drops to `$shutdownCapacity%`.

Changes to config take effect almost immediately (`$sleep` seconds delay). No reboot is necessary. However, after changing `maxCurrent`, charger must be reconnected with a delay of `$sleep` seconds.

If `log=<path>` is enabled in config.txt, mcs generates verbose. Do not leave this ON when not needed. Else, your internal storage will be filled up!

If config.txt is missing, it is automatically recreated with default settings.

MCS service is stopped by removing the lock file `/data/media/mcs_beta/.running`.

Config instructions are on the config file itself (/data/media/mcs_beta/config.txt).

---
#### PRE-REQUISITES

- Magisk v15+

---
#### SETUP STEPS

1. Install/upgrade from Magisk Manager or custom recovery.
2. Customize /data/media/mcs_beta/config.txt (optional).
3. Reboot.

---
#### LINKS

- [Battery University]([url]http://batteryuniversity.com/learn/article/how_to_prolong_lithium_based_batteries)[/url]
- [Facebook Support Page]([url]https://facebook.com/VR25-at-xda-developers-258150974794782)[/url]
- [XDA Thread]([url]https://xdaforums.com/apps/magisk/module-magic-charging-switch-cs-v2017-9-t3668427)[/url]

---
#### LATEST CHANGES

**2018.9.29 (201809290)**
- Auto-shutdown if battery capacity drops to `$shutdownCapacity%`.
- Control charging based on temperature, battery capacity, current (amperage), and more.
- Greater device support (perhaps)
- Halt charging if battery temperature reaches `$maxTemp°C`. Resume slow/fast charging when conditions are appropriate.
- New config format/syntax
- No extra/terminal features (for now)
- Slowdown charging at a set temperature range, and at `$coolDownCapacity%` before battery capacity reaches `$maxCapacity%`.
- Simplified documentation

Now, that you've read all of the above, I can say a few more words. If you didn't understand most of the info, read at least once more.

Moving on...

As my observations suggest so far, controlling voltage directly is only possible on a handful of devices. Hence, I took an indirect approach. It's not a million dollar shot, but it helps.

A kernel modification is necessary, and it involves changing /sys/class/power_supply/battery/voltage_max permissions to at least 600 (default mode is usually 444).

I'm no kernel dev, but I might be able to find the code portion tied to this and modify it accordingly. Too bad currently available data plans are too limited to even git clone a kernel source code. :(

Anyway, while this MCS version may work on virtually any Android device, on the other side of the coin, it might just as well be a big failure. It's up to the community to test (at their own risk, of course) and say something about it.

P.S., disable/uninstall other MCS versions and/or similar modules/apps before installing.

...Wireless charging control is not supported (at least for now).

...Charging indicator(s) will remain enabled even when charging has been halted.