Skip to content

Commit 5cf5b1f

Browse files
committed
Miscellaneous enhancements
1 parent b5818fb commit 5cf5b1f

File tree

9 files changed

+126
-41
lines changed

9 files changed

+126
-41
lines changed

META-INF/com/google/android/update-binary

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ exxit() {
3030
rm -rf /dev/.$domain.${id}-install
3131
$KSU || {
3232
rm -rf /data/adb/modules_update/$id
33-
(abort) > /dev/null
33+
(abort) > /dev/null
3434
}
3535
echo
3636
exit $e
@@ -162,9 +162,9 @@ mkdir -p $data_dir/backup
162162
cp -aH /data/adb/$domain/$id/* $config $data_dir/backup/ 2>/dev/null || :
163163

164164

165-
/system/bin/sh $srcDir/install/uninstall.sh install
166165
KSU=${KSU:-false}
167166
$KSU || { [ ! -f /data/adb/*/bin/busybox ] || KSU=true; }
167+
/system/bin/sh $srcDir/install/uninstall.sh install
168168
cp -R $srcDir/install $installDir/$id
169169
installDir=$(readlink -f $installDir/$id)
170170
cp $srcDir/module.prop $installDir/
@@ -305,7 +305,7 @@ printf "$version ($versionCode) installed and running!\n\nRollback with acc -bc
305305
if [ -x /sbin/${id}d ] || grep -q '#exec_wrapper' /system/bin/${id}d 2>/dev/null; then
306306
_echo "Rebooting is unnecessary."
307307
else
308-
_echo "Note: If you're not rebooting now, prefix all acc executables with /dev/ (as in /dev/acc -i, /dev/accd). Otherwise, you'll be using the previous installation of those. Reasoning: Magisk, KernelSU and similar, don't remount/update modules without a reboot. Subsequent upgrades won't require a reboot."
308+
_echo "Note: If you're not rebooting now, prefix all acc executables with /dev/ (as in /dev/acc -i, /dev/accd). Otherwise, you'll be using the previous installation of those. Reasoning: Magisk, KernelSU and similar, don't remount/update modules without a reboot."
309309
fi
310310

311311

README.html

+7-5
Original file line numberDiff line numberDiff line change
@@ -1440,7 +1440,7 @@ <h2 id="default-configuration">DEFAULT CONFIGURATION<a class="headerlink" href="
14401440

14411441
// forceOff=force_off=BOOLEAN
14421442

1443-
// idleApps=idle_apps=(comma or space separated patterns matching Android package names) NULLABLE
1443+
// idleApps=idle_apps=(comma or space-separated patterns matching Android package names) NULLABLE
14441444

14451445
// idleThreshold=idle_threshold=MILLIAMPS
14461446

@@ -1678,7 +1678,7 @@ <h2 id="default-configuration">DEFAULT CONFIGURATION<a class="headerlink" href="
16781678
// idle_apps (ia) #
16791679
// Default: Null
16801680
//
1681-
// This is a list of comma or space separated patterns matching Android package names.
1681+
// This is a list of comma or space-separated patterns matching Android package names.
16821682
// When a matched app is running in the foreground, idle mode is enabled.
16831683
// e.g., idleApps=(maps navig somegame) or idleApps=(maps,navig,somegame) or mixed
16841684

@@ -1801,7 +1801,8 @@ <h2 id="default-configuration">DEFAULT CONFIGURATION<a class="headerlink" href="
18011801
// Default: 5
18021802
//
18031803
// When the battery is discharging, its level/millivolts is at or below shutdown_capacity, and the device has been running for 15 minutes or more, acc daemon turns the device off to reduce the discharge rate, and protect the battery from potential damage, induced by voltage below the operating range.
1804-
// A value of -1 disables it.
1804+
// A value less than 1 disables it.
1805+
// An Android warning notification is posted shortly before the shutdown, giving some time to abort the process.
18051806

18061807

18071808
// shutdown_temp (st) #
@@ -1823,8 +1824,9 @@ <h2 id="default-configuration">DEFAULT CONFIGURATION<a class="headerlink" href="
18231824
// Default: mi_thermald
18241825
//
18251826
// [Some] thermal management processes interfere with charging control.
1826-
// This variable controls which of these get temporarily suspended after pausing charging.
1827-
// As a safety measure, if the string does not contain &quot;thermal&quot;, the value is ignored.
1827+
// This variable controls which of these get temporarily suspended after pausing charging (comma-separated list).
1828+
// As a safety measure, if the string does not contain the word &quot;thermal&quot;, the value is ignored.
1829+
// That word alone matches all thermal management processes.
18281830

18291831
#/DC#
18301832
</pre></div>

README.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ runCmdOnPause=''
378378
379379
// forceOff=force_off=BOOLEAN
380380
381-
// idleApps=idle_apps=(comma or space separated patterns matching Android package names) NULLABLE
381+
// idleApps=idle_apps=(comma or space-separated patterns matching Android package names) NULLABLE
382382
383383
// idleThreshold=idle_threshold=MILLIAMPS
384384
@@ -616,7 +616,7 @@ runCmdOnPause=''
616616
// idle_apps (ia) #
617617
// Default: Null
618618
//
619-
// This is a list of comma or space separated patterns matching Android package names.
619+
// This is a list of comma or space-separated patterns matching Android package names.
620620
// When a matched app is running in the foreground, idle mode is enabled.
621621
// e.g., idleApps=(maps navig somegame) or idleApps=(maps,navig,somegame) or mixed
622622
@@ -739,7 +739,8 @@ runCmdOnPause=''
739739
// Default: 5
740740
//
741741
// When the battery is discharging, its level/millivolts is at or below shutdown_capacity, and the device has been running for 15 minutes or more, acc daemon turns the device off to reduce the discharge rate, and protect the battery from potential damage, induced by voltage below the operating range.
742-
// A value of -1 disables it.
742+
// A value less than 1 disables it.
743+
// An Android warning notification is posted shortly before the shutdown, giving some time to abort the process.
743744
744745
745746
// shutdown_temp (st) #
@@ -761,8 +762,9 @@ runCmdOnPause=''
761762
// Default: mi_thermald
762763
//
763764
// [Some] thermal management processes interfere with charging control.
764-
// This variable controls which of these get temporarily suspended after pausing charging.
765-
// As a safety measure, if the string does not contain "thermal", the value is ignored.
765+
// This variable controls which of these get temporarily suspended after pausing charging (comma-separated list).
766+
// As a safety measure, if the string does not contain the word "thermal", the value is ignored.
767+
// That word alone matches all thermal management processes.
766768
767769
#/DC#
768770
```

changelog.md

+87-12
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,90 @@
1+
**v2024.2.25-rc (202402250)**
2+
3+
- Ability to specify (regex) thermal management processes to temporarily suspend after disabling charging
4+
- [acc -c d string] Quotes are no longer mandatory
5+
- Fix config parsing issues
6+
- Optimize exec wrappers
7+
8+
- Improve the stability of idleApps
9+
10+
- -c|--config h string Print config help text associated with "string" (config variable, e.g., acc -c h rt (or resume_temp))
11+
- [acc -f] Don't use scripts from the default config & disengage as soon as the charger is unplugged, regardless of battery level; fix rt issue
12+
- [acc -i] Avoid duplicate lines & redundant information
13+
- [acc -p] Filter more useless sysfs nodes
14+
- Add timestamp to all non-stable flashable zips
15+
- Always replace one-line scripts with the same name (case-insensitive)
16+
- Fix idle detection issues
17+
- Support cooldown_current with temp_level as back-end (e.g., acc -s cdc=60% to limit current by 60%)
18+
- Support curl binary without --dns-server option (for upgrades)
19+
- Support Nexus 10 (manta)
20+
21+
- [acc -p] Add filters
22+
- Also consider pc_port/online for plug state detection
23+
- Fix accd ungraceful stop issue
24+
- Minimize the use of subshells
25+
- Set idleAbovePcap threshold to (pause_capacity + 1)
26+
- Set millivolts idleAbovePcap threshold to (pause_capacity + 50)
27+
- Try honoring allowIdleAbovePcap=false only 2x at most, per accd session
28+
29+
- [acc -p] Filter out more useless stuff
30+
- [acc -t] Add status column hint
31+
- [acc -t] Show currently set charging switche(s)
32+
- [accd] Miscellaneous fixes & optimizations
33+
- [allowIdleAbovePcap=false] Fall back to idle mode as soon as capacity <= pause_capacity
34+
- [Config updater] Remove redundant text
35+
- [Refactor] -b[c] restores previous installation; "c" includes the config
36+
- Fix current and voltage control files parsing logic
37+
- Optimize busybox handling
38+
- Patches for KSU/Apatch, install notes and "no reboot needed" workaround
39+
- Show applied config patches after upgrades (Android notification)
40+
- Simplify rt-mt logic
41+
42+
- Add debug info to acc-t_output-${device}.log
43+
- Check dc/online as well for plug state info
44+
- Fix config printing issues
45+
- Lower switch test timeout
46+
- Optimize --info's output
47+
- Optimize battStatusWorkaround logic
48+
- Optimize mi_thermald dynamic suspend logic
49+
- Reset "auto switch" and move it to the end of the list only if unsolicitedResumes = 3, rather than 1
50+
- Reset switch (in auto-mode) if pbim changes via --set
51+
- Set defaults allow_idle_above_pcap=false & idle_threshold=30
52+
- Set discharge_polarity automatically even while charging
53+
- Support additional busybox paths (including Apatch's)
54+
55+
- Improve charger plug detection
56+
57+
- [push.sh] Support KernelSU
58+
- Fix typos in doc
59+
- Improve charger plug detection
60+
- Recommend trying temp_level if no regular current control file is found
61+
- Suppress missing current control file errors
62+
63+
- Restore scheduler changes from v2023.11.26-dev
64+
65+
- Implement idle_apps
66+
- Improve charger online detection
67+
- Make it possible to post multiple notifications with acc -n
68+
- Optimize current and voltage logic
69+
70+
- Dynamically pause my_thermald to keep it from disabling idle mode
71+
- Fix issue with pc, rc, mt and rt null values
72+
- Fix wizard option 8 (uninstall)
73+
- Forbid mt - rt > 10 (fallback to rt = mt - 1)
74+
- Notifications include time
75+
- Parse current and voltage control files only once per boot session to avoid "false defaults"
76+
- Rewrite scheduling logic
77+
- Use hard instead of soft links for KernelSU/Magisk mount files
78+
79+
- Forbid control files modifications by 3rd-party
80+
- Improve online upgrade, temp_level and schedules logic
81+
- In acc -c a ': sleep profile; at 22:00 "acc -s pc=60 mcc=500; acc -n \"sleep profile\""', the quotes are optional and all ";" can be replaced with ","
82+
- Include dmesg and logcat in log archive
83+
- Support "," in place of "|" for egrep patterns (e.g., acc -i curr,volt; acc -w curr,volt; acc -sp cap,temp)
84+
- Support unquoted notify string (e.g., acc -n switched to sleep profile)
85+
- Suppress "Terminated" messages
86+
87+
188
**v2023.10.16 (202310160)**
289
- "edit g" shall work with non-root apps (acc -h g, acc -l g, acc -la g)
390
- -f supports additional options (e.g., acc -f -sc 500)
@@ -37,15 +124,3 @@
37124
- 312a429 Update resume_temp information
38125
- 2744859 Fix module info updater
39126
- 6dac4a7 resume_temp with trailing r always overrides resume_capacity
40-
41-
**v2023.8.12 (202308120)**
42-
- -H|--health <mAh>: Print estimated battery health
43-
- -r|--readme now sends intent to open README.html
44-
- Additional charging switches
45-
- Fix set_temp_level() sleep 4;
46-
- Fixed one-line scripts identifier
47-
- Fixed random accd crash
48-
- Implemented resume_temp; deprecated max_temp_pause
49-
- Refactored edit handler; use "g" (instead of "app") for GUI editor
50-
- Set default temp_level to null to accommodate battery/siop_level
51-
- Set list number width to 2 columns

customize.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ exxit() {
3030
rm -rf /dev/.$domain.${id}-install
3131
$KSU || {
3232
rm -rf /data/adb/modules_update/$id
33-
(abort) > /dev/null
33+
(abort) > /dev/null
3434
}
3535
echo
3636
exit $e
@@ -162,9 +162,9 @@ mkdir -p $data_dir/backup
162162
cp -aH /data/adb/$domain/$id/* $config $data_dir/backup/ 2>/dev/null || :
163163

164164

165-
/system/bin/sh $srcDir/install/uninstall.sh install
166165
KSU=${KSU:-false}
167166
$KSU || { [ ! -f /data/adb/*/bin/busybox ] || KSU=true; }
167+
/system/bin/sh $srcDir/install/uninstall.sh install
168168
cp -R $srcDir/install $installDir/$id
169169
installDir=$(readlink -f $installDir/$id)
170170
cp $srcDir/module.prop $installDir/
@@ -305,7 +305,7 @@ printf "$version ($versionCode) installed and running!\n\nRollback with acc -bc
305305
if [ -x /sbin/${id}d ] || grep -q '#exec_wrapper' /system/bin/${id}d 2>/dev/null; then
306306
_echo "Rebooting is unnecessary."
307307
else
308-
_echo "Note: If you're not rebooting now, prefix all acc executables with /dev/ (as in /dev/acc -i, /dev/accd). Otherwise, you'll be using the previous installation of those. Reasoning: Magisk, KernelSU and similar, don't remount/update modules without a reboot. Subsequent upgrades won't require a reboot."
308+
_echo "Note: If you're not rebooting now, prefix all acc executables with /dev/ (as in /dev/acc -i, /dev/accd). Otherwise, you'll be using the previous installation of those. Reasoning: Magisk, KernelSU and similar, don't remount/update modules without a reboot."
309309
fi
310310

311311

install.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ exxit() {
3030
rm -rf /dev/.$domain.${id}-install
3131
$KSU || {
3232
rm -rf /data/adb/modules_update/$id
33-
(abort) > /dev/null
33+
(abort) > /dev/null
3434
}
3535
echo
3636
exit $e
@@ -162,9 +162,9 @@ mkdir -p $data_dir/backup
162162
cp -aH /data/adb/$domain/$id/* $config $data_dir/backup/ 2>/dev/null || :
163163

164164

165-
/system/bin/sh $srcDir/install/uninstall.sh install
166165
KSU=${KSU:-false}
167166
$KSU || { [ ! -f /data/adb/*/bin/busybox ] || KSU=true; }
167+
/system/bin/sh $srcDir/install/uninstall.sh install
168168
cp -R $srcDir/install $installDir/$id
169169
installDir=$(readlink -f $installDir/$id)
170170
cp $srcDir/module.prop $installDir/
@@ -305,7 +305,7 @@ printf "$version ($versionCode) installed and running!\n\nRollback with acc -bc
305305
if [ -x /sbin/${id}d ] || grep -q '#exec_wrapper' /system/bin/${id}d 2>/dev/null; then
306306
_echo "Rebooting is unnecessary."
307307
else
308-
_echo "Note: If you're not rebooting now, prefix all acc executables with /dev/ (as in /dev/acc -i, /dev/accd). Otherwise, you'll be using the previous installation of those. Reasoning: Magisk, KernelSU and similar, don't remount/update modules without a reboot. Subsequent upgrades won't require a reboot."
308+
_echo "Note: If you're not rebooting now, prefix all acc executables with /dev/ (as in /dev/acc -i, /dev/accd). Otherwise, you'll be using the previous installation of those. Reasoning: Magisk, KernelSU and similar, don't remount/update modules without a reboot."
309309
fi
310310

311311

install/default-config.txt

+7-5
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ runCmdOnPause=''
139139

140140
# forceOff=force_off=BOOLEAN
141141

142-
# idleApps=idle_apps=(comma or space separated patterns matching Android package names) NULLABLE
142+
# idleApps=idle_apps=(comma or space-separated patterns matching Android package names) NULLABLE
143143

144144
# idleThreshold=idle_threshold=MILLIAMPS
145145

@@ -377,7 +377,7 @@ runCmdOnPause=''
377377
# idle_apps (ia) #
378378
# Default: Null
379379
#
380-
# This is a list of comma or space separated patterns matching Android package names.
380+
# This is a list of comma or space-separated patterns matching Android package names.
381381
# When a matched app is running in the foreground, idle mode is enabled.
382382
# e.g., idleApps=(maps navig somegame) or idleApps=(maps,navig,somegame) or mixed
383383

@@ -500,7 +500,8 @@ runCmdOnPause=''
500500
# Default: 5
501501
#
502502
# When the battery is discharging, its level/millivolts is at or below shutdown_capacity, and the device has been running for 15 minutes or more, acc daemon turns the device off to reduce the discharge rate, and protect the battery from potential damage, induced by voltage below the operating range.
503-
# A value of -1 disables it.
503+
# A value less than 1 disables it.
504+
# An Android warning notification is posted shortly before the shutdown, giving some time to abort the process.
504505

505506

506507
# shutdown_temp (st) #
@@ -522,5 +523,6 @@ runCmdOnPause=''
522523
# Default: mi_thermald
523524
#
524525
# [Some] thermal management processes interfere with charging control.
525-
# This variable controls which of these get temporarily suspended after pausing charging.
526-
# As a safety measure, if the string does not contain "thermal", the value is ignored.
526+
# This variable controls which of these get temporarily suspended after pausing charging (comma-separated list).
527+
# As a safety measure, if the string does not contain the word "thermal", the value is ignored.
528+
# That word alone matches all thermal management processes.

module.prop

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
id=acc
22
domain=vr25
33
name=Advanced Charging Controller (ACC)
4-
version=v2024.2.11.1-rc
5-
versionCode=202402111
4+
version=v2024.2.25-rc
5+
versionCode=202402250
66
author=VR25
77
description=Extend your battery's service life by controlling charging current, temperature, and voltage. Any root solution is supported. The installation is always "systemless". Works on Android and KaiOS.
88
updateJson=https://raw.githubusercontent.com/VR-25/acc/master/module.json

push.sh

+7-3
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,14 @@ _adb() {
2929
fi
3030
}
3131

32-
if _adb shell su -c "which ksud >/dev/null"; then
32+
if _adb shell su -c "which apd >/dev/null"; then
33+
install="apd module install $dest"
34+
elif _adb shell su -c "which ksud >/dev/null"; then
3335
install="ksud module install $dest"
34-
else
36+
elif _adb shell su -c "which magisk >/dev/null"; then
3537
install="magisk --install-module $dest"
38+
else
39+
install=
3640
fi
3741

38-
_adb push $zip $dest && _adb shell su -c "$install" || :
42+
[ -z "$install" ] || _adb push $zip $dest && _adb shell su -c "$install" || :

0 commit comments

Comments
 (0)