Skip to content

Commit

Permalink
**v2021.11.3 (202111030)**
Browse files Browse the repository at this point in the history
- Fixed installation issues
- Improved support for the current Magisk canary.
- Shutdown warning notifications (mV) are now posted at shutdown_capacity + 100mV (formerly 200).
  • Loading branch information
VR-25 committed Nov 3, 2021
1 parent 5ad7b43 commit 1d8baad
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 45 deletions.
4 changes: 2 additions & 2 deletions META-INF/com/google/android/update-binary
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ set -eu
srcDir="$(cd "${0%/*}" 2>/dev/null || :; echo "$PWD")"

# extract flashable zip if source code is unavailable
[ -f $srcDir/$id ] || {
[ -d $srcDir/$id ] || {
srcDir=/dev/.$domain.${id}-install
rm -rf $srcDir 2>/dev/null || :
mkdir $srcDir
unzip "${3:-${ZIPFILE}}" -d $srcDir/ >&2
unzip "${APK:-${ZIPFILE:-$3}}" -d $srcDir/ >&2
}


Expand Down
23 changes: 8 additions & 15 deletions README.html
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ <h4 id="notes-2">Notes</h4>
<h2 id="default-configuration">DEFAULT CONFIGURATION</h2>
<pre><code><code><div>#DC#

configVerCode=202110020
configVerCode=202111030
capacity=(-1 60 70 75 false false)
temperature=(40 60 90 65)
cooldownRatio=()
Expand Down Expand Up @@ -459,7 +459,7 @@ <h2 id="default-configuration">DEFAULT CONFIGURATION</h2>
# shutdown_capacity (sc) #
# When the battery is discharging and its capacity/voltage_now_millivolts &lt;= sc and phone has been running for 15 minutes or more, acc daemon turns the phone off to reduce the discharge rate and protect the battery from potential damage induced by voltage below the operating range.
# sc=-1 disables it.
# [Beta] if the file /data/adb/vr25/acc-data/warn exists, accd posts Android shutdown warning notifications at sc + 5% or sc + 200 mV.
# [Beta] if the file /data/adb/vr25/acc-data/warn exists, accd posts Android shutdown warning notifications at sc + 5% or sc + 100 mV.

# cooldown_capacity (cc) #
# Capacity/voltage_now_millivolts at which the cooldown cycle starts.
Expand Down Expand Up @@ -1230,19 +1230,6 @@ <h2 id="links">LINKS</h2>
</ul>
<hr>
<h2 id="latest-changes">LATEST CHANGES</h2>
<p><strong>v2021.9.19 (202109190)</strong></p>
<ul>
<li>Additional charging switches - the database is more concise with the extensive use of wildcards.</li>
<li>Battery status detection enhancements</li>
<li><code>capacity_mask=true</code>: forces Android to report <code>capacity = capacity * (100 / pause_capacity)</code>, effectively masking capacity limits. This replaces <code>capacity_freeze2</code>.</li>
<li><code>current_workaround</code> no longer requires a reboot (just <code>accd --init</code>).</li>
<li>Fixed cooldown and <code>acc -f</code> issues.</li>
<li>General fixes &amp; optimizations</li>
<li>Optimized <code>--parse</code> (<code>acc -p</code>).</li>
<li>Support for &quot;volatile&quot; plugins (gone on reboot, useful for debugging): <code>/dev/.vr25/acc/plugins/</code></li>
<li>Updated documentation (mainly tips &gt; idle mode and alternatives)</li>
<li>Upgrade rollback feature (<code>-b|--rollback</code> or wizard option <code>f</code>)</li>
</ul>
<p><strong>v2021.9.20 (202109200)</strong></p>
<ul>
<li>General enhancements</li>
Expand All @@ -1260,6 +1247,12 @@ <h2 id="latest-changes">LATEST CHANGES</h2>
<li>Strip newlines from the output of acc -p.</li>
<li>The logs tarball now also includes the outputs of <code>getprop</code> and <code>acc -p</code> (potential/new charging switches).</li>
<li>Updated Documentation</li>
</ul>
<p><strong>v2021.11.3 (202111030)</strong></p>
<ul>
<li>Fixed installation issues</li>
<li>Improved support for the current Magisk canary.</li>
<li>Shutdown warning notifications (mV) are now posted at shutdown_capacity + 100mV (formerly 200).</li>
</ul>

</body>
Expand Down
21 changes: 7 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ In interactive mode, it also asks the user whether they want to download and ins
```
#DC#
configVerCode=202110020
configVerCode=202111030
capacity=(-1 60 70 75 false false)
temperature=(40 60 90 65)
cooldownRatio=()
Expand Down Expand Up @@ -417,7 +417,7 @@ currentWorkaround=false
# shutdown_capacity (sc) #
# When the battery is discharging and its capacity/voltage_now_millivolts <= sc and phone has been running for 15 minutes or more, acc daemon turns the phone off to reduce the discharge rate and protect the battery from potential damage induced by voltage below the operating range.
# sc=-1 disables it.
# [Beta] if the file /data/adb/vr25/acc-data/warn exists, accd posts Android shutdown warning notifications at sc + 5% or sc + 200 mV.
# [Beta] if the file /data/adb/vr25/acc-data/warn exists, accd posts Android shutdown warning notifications at sc + 5% or sc + 100 mV.
# cooldown_capacity (cc) #
# Capacity/voltage_now_millivolts at which the cooldown cycle starts.
Expand Down Expand Up @@ -1368,18 +1368,6 @@ A common workaround is having `resume_capacity = pause_capacity - 1`. e.g., resu
---
## LATEST CHANGES

**v2021.9.19 (202109190)**
- Additional charging switches - the database is more concise with the extensive use of wildcards.
- Battery status detection enhancements
- `capacity_mask=true`: forces Android to report `capacity = capacity * (100 / pause_capacity)`, effectively masking capacity limits. This replaces `capacity_freeze2`.
- `current_workaround` no longer requires a reboot (just `accd --init`).
- Fixed cooldown and `acc -f` issues.
- General fixes & optimizations
- Optimized `--parse` (`acc -p`).
- Support for "volatile" plugins (gone on reboot, useful for debugging): `/dev/.vr25/acc/plugins/`
- Updated documentation (mainly tips > idle mode and alternatives)
- Upgrade rollback feature (`-b|--rollback` or wizard option `f`)

**v2021.9.20 (202109200)**
- General enhancements
- Manual capacitySync toggle (`[capacity_sync|cs] = [true|false]`) - it overrides the automatic. Both include the `freeze at 2%` feature. This is the actual `capacity_freeze2` replacement now. `capacity_mask` implies `capacity_sync`.
Expand All @@ -1395,3 +1383,8 @@ A common workaround is having `resume_capacity = pause_capacity - 1`. e.g., resu
- Strip newlines from the output of acc -p.
- The logs tarball now also includes the outputs of `getprop` and `acc -p` (potential/new charging switches).
- Updated Documentation

**v2021.11.3 (202111030)**
- Fixed installation issues
- Improved support for the current Magisk canary.
- Shutdown warning notifications (mV) are now posted at shutdown_capacity + 100mV (formerly 200).
1 change: 0 additions & 1 deletion acc/acc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ parse_switches() {
if [ -z "${2-}" ]; then
set -- $1 $(echo ${config_%/*}/logs/power_supply-${device}.log)
[ -f $2 ] || $execDir/power-supply-logger.sh
echo
fi

cat -v "$2" > $f
Expand Down
9 changes: 4 additions & 5 deletions acc/accd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ if ! $init; then
ctrl_charging() {

local count=0
local i=

while :; do

Expand Down Expand Up @@ -286,12 +285,12 @@ if ! $init; then
# warnings
if $shutdownWarnings && [ -f $data_dir/warn ]; then
if t ${capacity[0]} -gt 3000; then
! t $(grep -o '^..' $voltage_now) -eq $(( ${capacity[0]%??} + 2 )) \
|| ! su -lp 2000 -c "cmd notification post -S bigtext -t 'ACC' 'Tag' \"WARNING: $(grep -o '^....' $voltage_now | sed 's/^.//' | sed "s/^./$i/")mV to auto shutdown, plug the charger!\"" \
! t $(grep -o '^..' $voltage_now) -eq $(( ${capacity[0]%??} + 1 )) \
|| ! su -lp 2000 -c "cmd notification post -S bigtext -t 'ACC' 'Tag' \"WARNING: ~100mV to auto shutdown, plug the charger!\"" \
|| sleep ${loopDelay[1]}
else
! t $(cat $batt/capacity) -eq $(( ${capacity[0]} + 5 )) \
|| ! su -lp 2000 -c "cmd notification post -S bigtext -t 'ACC' 'Tag' \"WARNING: ${i}% to auto shutdown, plug the charger!\"" \
|| ! su -lp 2000 -c "cmd notification post -S bigtext -t 'ACC' 'Tag' \"WARNING: 5% to auto shutdown, plug the charger!\"" \
|| sleep ${loopDelay[1]}
fi
shutdownWarnings=false
Expand Down Expand Up @@ -340,7 +339,7 @@ if ! $init; then
local maskedCap=$battCap
else
local capFactor=$(calc 100 / ${capacity[3]})
local maskedCap=$(printf "%.*f" 0 $(calc $battCap \* $capFactor))
local maskedCap=$(printf %.f $(calc $battCap \* $capFactor))
fi
}

Expand Down
4 changes: 2 additions & 2 deletions acc/default-config.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configVerCode=202110020
configVerCode=202111030
capacity=(-1 60 70 75 false false)
temperature=(40 60 90 65)
cooldownRatio=()
Expand Down Expand Up @@ -175,7 +175,7 @@ currentWorkaround=false
# shutdown_capacity (sc) #
# When the battery is discharging and its capacity/voltage_now_millivolts <= sc and phone has been running for 15 minutes or more, acc daemon turns the phone off to reduce the discharge rate and protect the battery from potential damage induced by voltage below the operating range.
# sc=-1 disables it.
# [Beta] if the file /data/adb/vr25/acc-data/warn exists, accd posts Android shutdown warning notifications at sc + 5% or sc + 200 mV.
# [Beta] if the file /data/adb/vr25/acc-data/warn exists, accd posts Android shutdown warning notifications at sc + 5% or sc + 100 mV.

# cooldown_capacity (cc) #
# Capacity/voltage_now_millivolts at which the cooldown cycle starts.
Expand Down
4 changes: 2 additions & 2 deletions customize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ set -eu
srcDir="$(cd "${0%/*}" 2>/dev/null || :; echo "$PWD")"

# extract flashable zip if source code is unavailable
[ -f $srcDir/$id ] || {
[ -d $srcDir/$id ] || {
srcDir=/dev/.$domain.${id}-install
rm -rf $srcDir 2>/dev/null || :
mkdir $srcDir
unzip "${3:-${ZIPFILE}}" -d $srcDir/ >&2
unzip "${APK:-${ZIPFILE:-$3}}" -d $srcDir/ >&2
}


Expand Down
4 changes: 2 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ set -eu
srcDir="$(cd "${0%/*}" 2>/dev/null || :; echo "$PWD")"

# extract flashable zip if source code is unavailable
[ -f $srcDir/$id ] || {
[ -d $srcDir/$id ] || {
srcDir=/dev/.$domain.${id}-install
rm -rf $srcDir 2>/dev/null || :
mkdir $srcDir
unzip "${3:-${ZIPFILE}}" -d $srcDir/ >&2
unzip "${APK:-${ZIPFILE:-$3}}" -d $srcDir/ >&2
}


Expand Down
4 changes: 2 additions & 2 deletions module.prop
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
id=acc
domain=vr25
name=Advanced Charging Controller (ACC)
version=v2021.10.30
versionCode=202110300
version=v2021.11.3
versionCode=202111030
author=VR25
description=Mainly intended for extending battery service life on Android devices. In a nutshell, this is achieved through limiting charging current, temperature and voltage. Any root solution is supported. The installation is always "system-less", whether or not the system is rooted with Magisk.

0 comments on commit 1d8baad

Please sign in to comment.