forked from VR-25/acc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME.html
More file actions
1897 lines (1221 loc) · 74.8 KB
/
Copy pathREADME.html
File metadata and controls
1897 lines (1221 loc) · 74.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<h1>Advanced Charging Controller (ACC) with WebUI</h1>
<p><a href="https://github.com/Infiniti151/acc-with-webui/actions/workflows/build.yml"><img src="https://img.shields.io/github/actions/workflow/status/Infiniti151/acc-with-webui/build.yml?branch=dev&style=for-the-badge&logo=github-actions&logoColor=white&label=Build" alt="Build" title="" /></a> <a href="https://github.com/Infiniti151/acc-with-webui/releases"><img src="https://img.shields.io/github/v/release/Infiniti151/acc-with-webui?style=for-the-badge&logo=github&logoColor=white&label=Release" alt="Latest Release" title="" /></a> <a href="https://github.com/Infiniti151/acc-with-webui/blob/dev/webui/package.json"><img src="https://img.shields.io/badge/Svelte-5.56.8-orange?style=for-the-badge&logo=svelte&logoColor=white" alt="Svelte" title="" /></a> <a href="https://github.com/Infiniti151/acc-with-webui/blob/dev/License.md"><img src="https://img.shields.io/github/license/Infiniti151/acc-with-webui?style=for-the-badge&logo=spdx&logoColor=white&color=yellow&label=License" alt="License" title="" /></a> <a href="https://github.com/Infiniti151/acc-with-webui/releases"><img src="https://img.shields.io/github/downloads/Infiniti151/acc-with-webui/total?style=for-the-badge&color=purple&label=Downloads&logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0id2hpdGUiPjxwYXRoIGQ9Ik0xOSA5aC00VjNIN3Y2SDNMMTIgMTlsOS05ek01IDE4djJoMTR2LTJINXoiLz48L3N2Zz4=" alt="Downloads" title="" /></a></p>
<blockquote>
<p>[!important]
<a href="#webui">WebUI</a> is the only addition in this fork. No backend code has been changed. Why not just use the AccA app? Coz I don't want to install a separate app to control a module. Also, it has been abandoned since 2022. It was built before the advent of root manager WebUIs and WebUIs are the standard now for module GUIs. Only open issues regarding WebUI here. All issues regarding acc must be opened upstream. This is based on acc dev branch in order to get the latest acc updates.</p>
<p>[!warning]
WebUI is tested in KernelSU Next manager (v3.1.0), but should work fine in KernelSU manager. It is untested for Apatch and Magisk with WebUI X: Portable.</p>
</blockquote>
<hr />
<ul>
<li><a href="#description">DESCRIPTION</a></li>
<li><a href="#license">LICENSE</a></li>
<li><a href="#disclaimer">DISCLAIMER</a></li>
<li><a href="#warnings">WARNINGS</a></li>
<li><a href="#prerequisites">PREREQUISITES</a></li>
<li><a href="#quick-start-guide">QUICK START GUIDE</a>
<ul>
<li><a href="#notes">Notes</a></li>
</ul></li>
<li><a href="#building-andor-installing-from-source">BUILDING AND/OR INSTALLING FROM SOURCE</a>
<ul>
<li><a href="#dependencies-build">Dependencies (Build)</a></li>
<li><a href="#build-tarballs-and-flashable-zips">Build Tarballs and Flashable Zips</a></li>
<li><a href="#notes-1">Notes</a></li>
<li><a href="#install-from-local-source-or-github">Install from Local Source or GitHub</a></li>
<li><a href="#notes-2">Notes</a></li>
<li><a href="#build-webui-indexhtml">Build WebUI</a></li>
</ul></li>
<li><a href="#default-configuration">DEFAULT CONFIGURATION</a></li>
<li><a href="#setupusage">SETUP/USAGE</a>
<ul>
<li><a href="#terminal-commands">Terminal Commands</a></li>
</ul></li>
<li><a href="#plugins">PLUGINS</a></li>
<li><a href="#notestips-for-front-end-developers">NOTES/TIPS FOR FRONT-END DEVELOPERS</a>
<ul>
<li><a href="#basics">Basics</a></li>
<li><a href="#installingupgrading-acc">Installing/Upgrading ACC</a></li>
<li><a href="#uninstalling-acc">Uninstalling ACC</a></li>
<li><a href="#initializing-acc">Initializing ACC</a></li>
<li><a href="#managing-acc">Managing ACC</a></li>
<li><a href="#webui">WebUI</a></li>
<li><a href="#action-button">Action Button</a></li>
</ul></li>
<li><a href="#troubleshooting">TROUBLESHOOTING</a>
<ul>
<li><a href="#acc--t-results-seem-inconsistent"><code>acc -t</code> Results Seem Inconsistent</a></li>
<li><a href="#charging-switch">Charging Switch</a></li>
<li><a href="#custom-max-charging-voltage-and-current-limits">Custom Max Charging Voltage And Current Limits</a></li>
<li><a href="#diagnosticslogs">Diagnostics/Logs</a></li>
<li><a href="#finding-additionalpotential-charging-switches-quickly">Finding Additional/Potential Charging Switches Quickly</a></li>
<li><a href="#install-upgrade-stop-and-restart-processes-seem-to-take-too-long">Install, Upgrade, Stop and Restart Processes Seem to Take Too Long</a></li>
<li><a href="#restore-default-config">Restore Default Config</a></li>
<li><a href="#samsung-charging-always-stops-at-70-capacity">Samsung, Charging <em>Always</em> Stops at 70% Capacity</a></li>
<li><a href="#slow-charging">Slow Charging</a></li>
<li><a href="#unable-to-charge">Unable to Charge</a></li>
<li><a href="#unexpected-reboots">Unexpected Reboots</a></li>
<li><a href="#warp-vooc-and-other-fast-charging-tech">WARP, VOOC and Other Fast Charging Tech</a></li>
<li><a href="#why-did-accd-stop">Why Did accd Stop?</a></li>
</ul></li>
<li><a href="#power-supply-logs-help-needed">POWER SUPPLY LOGS (HELP NEEDED)</a></li>
<li><a href="#localization">LOCALIZATION</a></li>
<li><a href="#tips">TIPS</a>
<ul>
<li><a href="#always-limit-the-charging-current-if-your-battery-is-old-andor-tends-to-discharge-too-fast"><em>Always</em> Limit the Charging Current If Your Battery is Old and/or Tends to Discharge Too Fast</a></li>
<li><a href="#generic">Generic</a></li>
<li><a href="#google-pixel-devices">Google Pixel Devices</a></li>
<li><a href="override_battery_mah_capacity">Override Battery mAh Capacity</a></li>
<li><a href="override_broken_temperature_sensor">Override Broken Temperature Sensor</a></li>
</ul></li>
<li><a href="#frequently-asked-questions-faq">FREQUENTLY ASKED QUESTIONS (FAQ)</a></li>
</ul>
<hr />
<h2>DESCRIPTION</h2>
<p>ACC is an Android software mainly intended for <a href="https://batteryuniversity.com/article/bu-808-how-to-prolong-lithium-based-batteries">extending battery service life</a>.
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".</p>
<hr />
<h2>LICENSE</h2>
<p>Copyright 2017-2024, VR25
Copyright 2026, Infiniti151</p>
<p>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.</p>
<p>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.</p>
<p>You should have received a copy of the GNU General Public License
along with this program. If not, see <a href="https://www.gnu.org/licenses/">https://www.gnu.org/licenses/</a>.</p>
<hr />
<h2>DISCLAIMER</h2>
<p>Always read/reread this reference prior to installing/upgrading this software.</p>
<p>While no cats have been harmed, the author assumes no responsibility for anything that might break due to the use/misuse of it.</p>
<p>To prevent fraud, do NOT mirror any link associated with this project.
Do NOT share builds (tarballs/zips)! Share official links instead.</p>
<hr />
<h2>WARNINGS</h2>
<p>ACC manipulates Android low level (<a href="https://duckduckgo.com/lite/?q=kernel+android">kernel</a>) 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!</p>
<p>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).</p>
<p>Refer to <a href="https://forum.xda-developers.com/t/rom-official-arrowos-11-0-android-11-0-vayu-bhima.4267263/post-85119331">this XDA post</a> for additional details.</p>
<p><a href="https://github.com/lybxlpsv">lybxlpsv</a> suggests booting into bootloader/fastboot and then back into system to reset the PMIC.</p>
<p>In case of bootloop, one can easily generate persistent logs and/or stop/disable acc.
ACC daemon initializes 60 seconds after the boot animation stops.
This gives plenty of time to run <code>pkill -9 -f accd</code> to kill the waiting process or <code>accd -x</code> to generate persistent logs (<code>/sdcard/accd-*.log</code>) for debugging the bootloop.
<code>accd -x</code> also sets the disable flag (<code>/data/adb/vr25/acc-data/disable</code>). This file prevents the daemon from starting again. It's removed manually or by the installer.
<code>acc -t</code> always implies <code>-x</code> and tries to auto-blacklist switches that trigger unwanted reboots.</p>
<hr />
<h2>PREREQUISITES</h2>
<ul>
<li><a href="https://batteryuniversity.com/article/bu-808-how-to-prolong-lithium-based-batteries">Must read - how to prolong lithium ion batteries lifespan</a></li>
<li>Android or KaiOS</li>
<li>Any root solution (e.g., KernelSU, Magisk, SuperSU, etc)</li>
<li><a href="https://github.com/Magisk-Modules-Repo/busybox-ndk">Busybox*</a> (only if not rooted with KernelSU or Magisk)</li>
<li>Non KernelSU/Magisk installs require a way of running <code>/data/adb/vr25/acc/service.sh</code> on boot to initialize acc.</li>
<li>Terminal emulator</li>
<li>Root text editor (optional)</li>
</ul>
<p>* A busybox binary can simply be placed in <code>/data/adb/vr25/bin/</code>.
Permissions (<code>0755</code>) are set automatically, as needed.
Precedence: /data/adb/vr25/bin/busybox > KernelSu's or Magisk's busybox > system's busybox</p>
<p>Other executables or static binaries can also be placed in <code>/data/adb/vr25/bin/</code> (with proper permissions) instead of being installed system-wide.</p>
<hr />
<h2>QUICK START GUIDE</h2>
<ol>
<li><p>All commands/actions require root.</p></li>
<li><p>Install/upgrade: flash* the zip or use a front-end app.
There are two additional ways of upgrading: <code>acc --upgrade</code> (online) and <code>acc --flash</code> (zip flasher).
Rebooting after installation/removal is generally unnecessary.
Manual uninstall before upgrade is unnecessary.</p></li>
<li><p>[Optional] run <code>acc</code> (wizard). That's the main command to remember.</p></li>
<li><p>[Optional] run <code>acc pause_capacity resume_capacity</code> (default <code>75 70</code>) to set the battery levels at which charging should pause and resume, respectively.</p></li>
<li><p>If you come across any issues, refer to the <a href="#troubleshooting">troubleshooting</a>, <a href="#tips">tips</a> and <a href="#frequently-asked-questions-faq">FAQ</a> 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.</p></li>
</ol>
<h3>Notes</h3>
<p>Steps <code>2</code> and <code>3</code> are optional because there are default settings.
For details, refer to the <a href="#default-configuration">default configuration</a> section below.
Users are encouraged to try step <code>2</code> - to familiarize themselves with the available options.</p>
<p>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.</p>
<p>Uninstall: run <code>acc --uninstall</code> or flash* <code>/data/adb/vr25/acc-data/acc-uninstaller.zip</code>.</p>
<p>ACC runs in some recovery environments as well.
Unless the zip is flashed again, manual initialization is required.
The initialization script is <code>/data/adb/vr25/acc/service.sh</code>.</p>
<hr />
<h2>BUILDING AND/OR INSTALLING FROM SOURCE</h2>
<h3>Dependencies (Build)</h3>
<ul>
<li>git, wget, or curl (pick one)</li>
<li>zip</li>
</ul>
<h3>Build Tarballs and Flashable Zips</h3>
<ol>
<li><p>Download and extract the source code: <code>git clone https://github.com/Infiniti151/acc-with-webui.git</code>
or <code>wget https://github.com/Infiniti151/acc-with-webui/archive/master.tar.gz -O - | tar -xz</code>
or <code>curl -L# https://github.com/Infiniti151/acc-with-webui/archive/master.tar.gz | tar -xz</code></p></li>
<li><p><code>cd acc*</code></p></li>
<li><p><code>sh build.sh</code> (or double-click <code>build.bat</code> on Windows 10+, if you have Windows subsystem for Linux (with zip) installed)</p></li>
</ol>
<h4>Notes</h4>
<ul>
<li><p><code>build.sh</code> automatically sets/corrects <code>id=*</code> in <code>*.sh</code> and <code>update-binary</code> files.
To skip generating archives, run the build script with a random argument (e.g. <code>sh build.sh h</code>).</p></li>
<li><p>To update the local source code, run <code>git pull --force</code> or re-download it (with <code>wget</code>/<code>curl</code>) as described above.</p></li>
</ul>
<h3>Install from Local Source or GitHub</h3>
<ul>
<li><p><code>[export installDir=<parent install dir>] sh install.sh</code> installs acc from the extracted source.</p></li>
<li><p><code>sh install-online.sh [-c|--changelog] [-f|--force] [-k|--insecure] [-n|--non-interactive] [%parent install dir%] [commit]</code> downloads and installs acc from GitHub - e.g., <code>sh install-online.sh dev</code>.
The order of arguments doesn't matter.
For upgrades, if <code>%parent install dir%</code> is not supplied, the original/current is used.</p></li>
<li><p><code>sh install-tarball.sh [module id, default: acc] [parent install dir (e.g., /data/data/mattecarra.accapp/files)]</code> installs the tarball (<code>acc*gz</code>) from the script's location.
The archive must be in the same directory as this script - and obtained from GitHub: https://github.com/Infiniti151/acc-with-webui/archive/$commit.tar.gz (<code>$commit</code> examples: <code>master</code>, <code>dev</code>, <code>v2020.5.20-rc</code>).</p></li>
<li><p>One can also use a single command to download and install acc:</p></li>
</ul>
<p><code>curl -sSL https://raw.githubusercontent.com/Infiniti151/acc-with-webui/install-online.sh | /system/bin/sh -s dev</code></p>
<p><code>wget -qO- https://raw.githubusercontent.com/Infiniti151/acc-with-webui/dev/install-online.sh | /system/bin/sh -s dev</code></p>
<h4>Notes</h4>
<ul>
<li><p><code>install-online.sh</code> is the <code>acc --upgrade</code> back-end.</p></li>
<li><p>The default parent installation directories, in order of priority, are: <code>/data/data/mattecarra.accapp/files/</code> (ACC App, but only for non KernelSU/Magisk installs), <code>/data/adb/modules/</code> (KernelSU/Magisk) and <code>/data/adb/vr25/</code> (other root solutions).</p></li>
<li><p>No argument/option is strictly mandatory.
The exception is <code>--non-interactive</code> for front-end apps.</p></li>
<li><p>The <code>--force</code> option to <code>install-online.sh</code> is meant for re-installation and downgrading.</p></li>
<li><p><code>sh install-online.sh --changelog --non-interactive</code> 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.</p></li>
<li><p>You may also want to read <a href="#terminal-commands">Terminal Commands</a> > <code>Exit Codes</code> below.</p></li>
</ul>
<h3>Build WebUI (index.html)</h3>
<p>For building just the WebUI without the entire zip,</p>
<ol>
<li>Install Node.js 18.0.0+ (though Node.js 20+ LTS is strongly recommended).</li>
<li><code>cd webui</code></li>
<li><code>npm install && npm run build</code></li>
<li>index.html will be built at <code>../install/webroot/</code></li>
</ol>
<hr />
<h2>DEFAULT CONFIGURATION</h2>
<p>```</p>
<h1>DC</h1>
<p>configVerCode=202505180</p>
<p>allowIdleAbovePcap=true
ampFactor=
battStatusWorkaround=true
capacity=(5 101 70 75 false)
cooldownCurrent=
cooldownRatio=()
currentWorkaround=false
forceOff=false
language=en
offMid=true
prioritizeBattIdleMode=true
rebootResume=false
resetBattStats=(false false false)
temperature=(45 50 40 55)
tempLevel=0
voltFactor=</p>
<p>applyOnBoot=()</p>
<p>applyOnPlug=()</p>
<p>battStatusOverride=''</p>
<p>chargingSwitch=()</p>
<p>idleApps=()</p>
<p>maxChargingCurrent=()</p>
<p>maxChargingVoltage=()</p>
<p>runCmdOnPause=''</p>
<h1>SYNTAX</h1>
<h1>allowIdleAbovePcap=true|false</h1>
<h1>ampFactor=1000|1000000</h1>
<h1>applyOnBoot=([CTRL<em>FILE1::RAW</em>VALUE[::DEFAULT]] [CTRL<em>FILE2::RAW</em>VALUE[::DEFAULT]...] [--exit])</h1>
<h1>applyOnPlug=([CTRL<em>FILE1::RAW</em>VALUE[::DEFAULT]] [CTRL<em>FILE2::RAW</em>VALUE[::DEFAULT]...])</h1>
<h1>battStatusOverride=Idle|Discharging|'code to PRINT value for _status'</h1>
<h1>battStatusWorkaround=true|false</h1>
<h1>capacity=(shutdown<em>capacity=% cooldown</em>capacity=% resume<em>capacity=% pause</em>capacity=% capacity_mask=true|false)</h1>
<h1>chargingSwitch=([CTRL<em>FILE1 ON OFF [CTRL</em>FILE2 ON OFF...] [--]])</h1>
<h1>cooldownCurrent=mA|mA%</h1>
<h1>cooldownRatio=(cooldown<em>charge=seconds cooldown</em>pause=seconds)</h1>
<h1>currentWorkaround=true|false</h1>
<h1>forceOff=true|false</h1>
<h1>idleApps=(comma or space-separated patterns matching Android package names)</h1>
<h1>language=LANGUAGE_CODE</h1>
<h1>maxChargingCurrent=(MILLIAMPS [CTRL<em>FILE1::RAW</em>VALUE::DEFAULT CTRL<em>FILE2::RAW</em>VALUE::DEFAULT...])</h1>
<h1>maxChargingVoltage=(MILLIVOLTS [CTRL<em>FILE1::RAW</em>VALUE::DEFAULT CTRL<em>FILE2::RAW</em>VALUE::DEFAULT...] [--exit])</h1>
<h1>offMid=true|false</h1>
<h1>prioritizeBattIdleMode=true|false|no</h1>
<h1>rebootResume=true|false</h1>
<h1>resetBattStats=(reset<em>batt</em>stats<em>on</em>pause=true|false reset<em>batt</em>stats<em>on</em>unplug=true|false reset<em>batt</em>stats<em>on</em>plug=true|false)</h1>
<h1>runCmdOnPause='COMMAND...'</h1>
<h1>temperature=(cooldown<em>temp=ºC max</em>temp=ºC resume<em>temp=ºC shutdown</em>temp=ºC)</h1>
<h1>tempLevel=%</h1>
<h1>voltFactor=1000|1000000</h1>
<h1>NOTES</h1>
<h1>Do not edit this in Windows Notepad, ever!</h1>
<h1>It replaces LF (Linux/Unix) with CRLF (Windows) line endings.</h1>
<h1>Nullifying values that should not be null causes unexpected behavior.</h1>
<h1>However, doing it with "--set var=" restores the default value of "var".</h1>
<h1>In other words, for regular users, "--set" is safer than modifying the config file directly.</h1>
<h1>Do not feel like you must configure everything!</h1>
<h1>Do not change what you don't understand.</h1>
<h1>The daemon does not have to be restarted to apply changes. It picks them up automatically within seconds.</h1>
<h1>INTERNAL FUNCTIONS</h1>
<h1>at HH:MM command1, commmand2... scheduler</h1>
<h1>e.g.,</h1>
<h1>at 2:14 acc --notif 2:14 AM now!</h1>
<h1>at 22:30 acc -n 22:30 now!</h1>
<h1>batt_cap print battery level</h1>
<h1>calc <operation...> float calculator</h1>
<h1>set<em>temp</em>level <0-100> refer to temp_level (tl) below</h1>
<h1>voltage_now prints the instantaneous charging voltage</h1>
<h1>INTERNAL VARIABLES</h1>
<h1>$_DPOL discharge polarity (+|-)</h1>
<h1>$_status Charging|Discharging|Idle</h1>
<h1>$_STI switch test iterations (default: 35)</h1>
<h1>$batt expands to the /sys/class/power_supply/battery (or equivalent) directory</h1>
<h1>$battCapacity $batt/capacity file</h1>
<h1>$battStatus $batt/status file</h1>
<h1>$currFile current_now file</h1>
<h1>$idleThreshold mA absolute value to consider charging status=Idle (default: 10)</h1>
<h1>$temp temperature reporting file</h1>
<h1>${isAccd:-false} true|false (whether accd in running)</h1>
<h1>The "date" command</h1>
<h1>$(date +FORMAT)</h1>
<h1>FORMAT specifies display format string using strftime(3) syntax:</h1>
<h1>%% literal % %n newline %t tab</h1>
<h1>%S seconds (00-60) %M minute (00-59) %m month (01-12)</h1>
<h1>%H hour (0-23) %I hour (01-12) %p AM/PM</h1>
<h1>%y short year (00-99) %Y year %C century</h1>
<h1>%a short weekday name %A weekday name %u day of week (1-7, 1=mon)</h1>
<h1>%b short month name %B month name %Z timezone name</h1>
<h1>%j day of year (001-366) %d day of month (01-31) %e day of month ( 1-31)</h1>
<h1>%N nanosec (output only)</h1>
<h1>%U Week of year (0-53 start sunday) %W Week of year (0-53 start monday)</h1>
<h1>%V Week of year (1-53 start monday, week < 4 days not part of this year)</h1>
<h1>%F "%Y-%m-%d" %R "%H:%M" %T "%H:%M:%S" %z numeric timezone</h1>
<h1>%D "%m/%d/%y" %r "%I:%M:%S %p" %h "%b" %s unix epoch time</h1>
<h1>%x locale date %X locale time %c locale date/time</h1>
<h1>ALIASES (for use with --set only)</h1>
<h1>allow<em>idle</em>above_pcap aiapc</h1>
<h1>amp_factor af</h1>
<h1>apply<em>on</em>boot ab</h1>
<h1>apply<em>on</em>plug ap</h1>
<h1>batt<em>status</em>override bso</h1>
<h1>batt<em>status</em>workaround bsw</h1>
<h1>capacity_mask cm</h1>
<h1>charging_switch s</h1>
<h1>cooldown_capacity cc</h1>
<h1>cooldown_charge cch</h1>
<h1>cooldown_current cdc</h1>
<h1>cooldown_pause cp</h1>
<h1>cooldown_temp ct</h1>
<h1>current_workaround cw</h1>
<h1>force_off fo</h1>
<h1>idle_apps ia</h1>
<h1>lang l</h1>
<h1>max<em>charging</em>current mcc</h1>
<h1>max<em>charging</em>voltage mcv</h1>
<h1>max_temp mt</h1>
<h1>resume_temp rt</h1>
<h1>off_mid om</h1>
<h1>pause_capacity pc</h1>
<h1>prioritize<em>batt</em>idle_mode pbim</h1>
<h1>reboot_resume rr</h1>
<h1>reset<em>batt</em>stats<em>on</em>pause rbsp</h1>
<h1>reset<em>batt</em>stats<em>on</em>plug rbspl</h1>
<h1>reset<em>batt</em>stats<em>on</em>unplug rbsu</h1>
<h1>resume_capacity rc</h1>
<h1>run<em>cmd</em>on_pause rcp</h1>
<h1>shutdown_capacity sc</h1>
<h1>shutdown_temp st</h1>
<h1>temp_level tl</h1>
<h1>volt_factor vf</h1>
<h1>FINE, BUT WHAT DOES EACH OF THESE VARIABLES ACTUALLY MEAN?</h1>
<h1>configVerCode</h1>
<h1>This is checked during updates to determine whether the config should be patched. Do NOT modify.</h1>
<h1>The value is not necessarily the same as acc's version code.</h1>
<h1>allow<em>idle</em>above_pcap (aiapc)</h1>
<p>#</p>
<h1>Type: Boolean</h1>
<h1>Default: true</h1>
<p>#</p>
<h1>If set to false, accd will avoid idle mode (if possible) when capacity > pause_capacity.</h1>
<h1>This is useful for forever-plugged setups, where battery longevity is a top priority.</h1>
<h1>Idle mode is good, but "storing" a highly charged battery for a LONG time is a bad idea.</h1>
<h1>The recommended capacity range for long-term/forever-plugged is 40-60%.</h1>
<h1>amp<em>factor (af) # volt</em>factor (vf)</h1>
<p>#</p>
<h1>Type: Integer (usually 1000000 or 1000)</h1>
<h1>Defaults: Null</h1>
<p>#</p>
<h1>Unit multiplier for conversion (e.g., 1V = 1000000uV, 1A = 1000000mA).</h1>
<h1>ACC can automatically determine the units, but the mechanism is not 100% foolproof.</h1>
<h1>Leave those properties alone, unless acc -i misreports current/voltage values.</h1>
<h1>apply<em>on</em>boot (ab) # apply<em>on</em>plug (ap)</h1>
<p>#</p>
<h1>Type: String (CTRL<em>FILE1::VALUE::DEFAULT CTRL</em>FILE2::VALUE::DEFAULT... --exit)</h1>
<h1>Default: Null</h1>
<p>#</p>
<h1>e.g., acc -s ab=wireless/voltage_max::9000000 (forces fast wireless charging on Pixel devices)</h1>
<p>#</p>
<h1>This is for general kernel tweaking.</h1>
<h1>For ab, settings are applied on boot and on daemon start/restart.</h1>
<h1>For ap, settings are applied periodically, while charging.</h1>
<p>#</p>
<h1>Default values (optional) are restored when the daemon stops.</h1>
<h1>"--exit" (for ab only) instructs accd to stop after applying settings.</h1>
<h1>batt<em>status</em>override (bso)</h1>
<p>#</p>
<h1>Type: String (Idle|Discharging|'code to PRINT value for _status')</h1>
<h1>Default: Null</h1>
<p>#</p>
<h1>Overrides the battery status determined by the not_charging function.</h1>
<h1>It can be Idle, Discharging (both case sensitive), or a script to PRINT the desired value for the _status variable.</h1>
<h1>When it's Idle or Discharging, _status will be set to that value if the charging switch state is off.</h1>
<h1>This only works in conjunction with an enforced charging switch (set manually, has a trailing " --").</h1>
<p>#</p>
<h1>Usage scenario: the switch "main/cool_mode 0 1" supports idle mode. However, sometimes it doesn't respond soon enough (e.g., due to fast charging).</h1>
<h1>The user can then enforce it with "acc -ss" and set "batt<em>status</em>override=Idle".</h1>
<h1>This means, when "main/cool<em>mode" is "on" (0), _status will be determined by the not</em>charging function (as usual), but when it's off (1), <em>status will be Idle, overriding the not</em>charging function's logic.</h1>
<p>#</p>
<h1>If the user were to write their own logic, it would be something like the following:</h1>
<h1>batt<em>status</em>override='[ $(cat main/cool_mode) -eq 1 ] && printf Idle || :'</h1>
<h1>The "|| :" part is mandatory to avoid issues with "set -e", which acc uses extensively.</h1>
<h1>batt<em>status</em>workaround (bsw)</h1>
<p>#</p>
<h1>Type: Boolean</h1>
<h1>Default: true</h1>
<p>#</p>
<h1>With this enabled (true), in addition to just reading POWER<em>SUPPLY</em>STATUS, if the battery is "Charging" and current is within 40mA (inclusive), battery status is considered "Idle".</h1>
<h1>Status is considered "Discharging", if the current's polarity changes after calling the disable_charging function.</h1>
<h1>By not relying solely on the information provided by POWER<em>SUPPLY</em>STATUS, this approach dramatically boosts compatibility.</h1>
<h1>This must be disabled on systems that report wrong/misleading charging current values.</h1>
<h1>capacity_mask (cm)</h1>
<p>#</p>
<h1>Type: Boolean</h1>
<h1>Default: false</h1>
<p>#</p>
<h1>This forces Android to report "capacity = (capacity - shutdown <em>capacity) * 100 / (pause</em>capacity - shutdown_capacity)", effectively masking capacity limits.</h1>
<h1>It also prevents Android from getting capacity readings below 2%, since some systems shutdown before battery level actually drops to 0%.</h1>
<h1>Use case: Secretly install acc on a relative's device, and enable this, so that they always see the regular 0-100% battery level scale.</h1>
<h1>charging_switch (s)</h1>
<p>#</p>
<h1>Type: String (CTRL<em>FILE1 ON OFF CTRL</em>FILE2 ON OFF... --)</h1>
<h1>Default: Null (automatic)</h1>
<p>#</p>
<h1>If unset, acc cycles through its database and sets the first switch/group that successfully disables charging.</h1>
<h1>If later, the set switch/group fails 3 times in a row, acc unsets it, moves it to the end of the list and repeats the above.</h1>
<h1>If all switches fail to disable charging, chargingSwitch is unset and acc/d exit with code 7.</h1>
<p>#</p>
<h1>This automated process can be disabled by appending " --" to the switch/group.</h1>
<h1>e.g., acc -s s="battery/charging_enabled 1 0 --"</h1>
<h1>"acc -ss" always appends " --".</h1>
<p>#</p>
<h1>Certain switches tend to be problematic/unreliable under specific condition (e.g., screen off, fast charging, heavy load).</h1>
<h1>Sometimes, this is caused by rogue thermal management programs (e.g., mi_thermald).</h1>
<h1>To mitigate this, one may want to try force_off or a thermal mod.</h1>
<h1>cooldown_capacity (cc)</h1>
<p>#</p>
<h1>Type: Integer (percentage)</h1>
<h1>Default: 101</h1>
<p>#</p>
<h1>Battery level or millivolts at which the cooldown cycle starts.</h1>
<h1>Cooldown reduces battery stress induced by prolonged exposure to high temperature and high charging voltage.</h1>
<h1>It does so through periodically pausing charging for a few seconds (cooldown_pause, more details below).</h1>
<h1>Requires cooldown<em>current OR "cooldown</em>charge and cooldown_pause".</h1>
<h1>cooldown<em>charge (cch) # cooldown</em>pause (cp)</h1>
<p>#</p>
<h1>Type: Integer (seconds)</h1>
<h1>Defaults: null</h1>
<p>#</p>
<h1>Those dictate the cooldown cycle intervals (seconds).</h1>
<h1>When not set, the cycle is disabled.</h1>
<h1>Suggested values are cch=50 and cp=10.</h1>
<h1>If charging gets slower than desired, try cch=50 and cp=5.</h1>
<h1>Note that cooldown<em>capacity and cooldown</em>temp can be disabled individually by assigning them values that would never be reached under normal circumstances.</h1>
<h1>cooldown<em>current optionally works with ratios as well (cooldown</em>charge: regular current, cooldown<em>pause: cooldown</em>current).</h1>
<h1>cooldown_current (cdc)</h1>
<p>#</p>
<h1>Type: Integer (milliamps)</h1>
<h1>Default: Null</h1>
<p>#</p>
<h1>Instead of pausing charging for cooldown_pause seconds, limit the max charging current (e.g., to 500 (mA) or even 50% (of the max current).</h1>
<h1>cooldown<em>pause and cooldown</em>charge are optional.</h1>
<h1>When the value is a percentage, temp_level is used as back-end, rather than the regular current control logic.</h1>
<h1>cooldown_temp (ct)</h1>
<p>#</p>
<h1>Type: Integer (°C)</h1>
<h1>Default: 45</h1>
<p>#</p>
<h1>Temperature (°C) at which the cooldown cycle starts.</h1>
<h1>Cooldown reduces the battery degradation rate by lowering the device's temperature.</h1>
<h1>Requires cooldown<em>current OR "cooldown</em>charge and cooldown_pause".</h1>
<h1>current_workaround (cw)</h1>
<p>#</p>
<h1>Type: Boolean</h1>
<h1>Default: false</h1>
<p>#</p>
<h1>If set to true, acc only uses current control files whose paths match "batt".</h1>
<h1>This is necessary only if the current limit affects both input and charging current values.</h1>
<h1>Enable if low current values don't work.</h1>
<h1>force_off (fo)</h1>
<p>#</p>
<h1>Type: Boolean</h1>
<h1>Default: false</h1>
<p>#</p>
<h1>Enable this only as last resort, if the set charging switch is stubbornly reset by the system.</h1>
<h1>Oftentimes, userspace thermal management daemons (e.g., mi_thermald) and/or driver bugs are behind charging control issues.</h1>
<h1>idle_apps (ia)</h1>
<p>#</p>
<h1>Type: String</h1>
<h1>Default: Null</h1>
<p>#</p>
<h1>This is a list of comma or space-separated patterns matching Android package names.</h1>
<h1>When a matched app is running in the foreground, acc daemon enables idle mode.</h1>
<h1>e.g., acc -s ia=maps,codm,pokemon</h1>
<h1>lang (l)</h1>
<p>#</p>
<h1>Type: String</h1>
<h1>Default: en</h1>
<p>#</p>
<h1>Display language, when null, English (en) is assumed.</h1>
<h1>WARNING: Current translations are poor/outdated.</h1>
<h1>max<em>charging</em>current (mcc) # max<em>charging</em>voltage (mcv)</h1>
<p>#</p>
<h1>Type: Integer (milliamps/millivolts)</h1>
<h1>Defaults: Null</h1>
<p>#</p>
<h1>Control files are automatically added by accd when the array has just one element (the milliamps/millivolts value).</h1>
<h1>If the second element of the array (array[1]) starts with "-", accd recognizes it as an instruction to update the control files.</h1>
<h1>This is useful for setting/changing current and voltage limits without a frontend (--set or app).</h1>
<h1>Simply put, if the user has the following in their config, accd automatically adds/updates the control files:</h1>
<h1>maxChargingCurrent=(1000) # Control files will be added.</h1>
<h1>maxChargingVoltage=(4000 -battery/voltage<em>max bms/voltage</em>max) # Control files will be updated. The "-" is mandatory after changing the value (first element). Otherwise, the change has no effect.</h1>
<p>#</p>
<h1>Notes: The maximum current that can be set via dedicated commands is 9999 mA. For voltage, the max is 4300 mV. One can override those by editing the config directly. When the charging current value is a percentage, temp_level is used as back-end, rather than the regular current control logic.</h1>
<h1>max<em>temp (mt) # resume</em>temp (rt)</h1>
<p>#</p>
<h1>Type: Integer (°C)</h1>
<h1>Defaults: mt=50, rt=40</h1>
<p>#</p>
<h1>Those two work together and are NOT tied to the cooldown cycle.</h1>
<h1>At max_temp, charging is paused.</h1>
<h1>If charging is paused due to capacity >= pause<em>capacity, it resumes when capacity <= resume</em>capacity AND temp <= max_temp.</h1>
<h1>If charging is paused due to temp >= max<em>temp, it resumes when capacity < pause</em>capacity AND temp <= resume_temp</h1>
<h1>off_mid (om)</h1>
<p>#</p>
<h1>Type: Boolean</h1>
<h1>Default: true</h1>
<p>#</p>
<h1>Whether to turn off charging after rebooting the system or restarting accd, if capacity is within resume<em>capacity and pause</em>capacity.</h1>
<h1>one-line scripts</h1>
<p>#</p>
<h1>Type: String</h1>
<h1>Default: Null</h1>
<p>#</p>
<h1>Every line that begins with ":" is interpreted as a shell script.</h1>
<h1>This feature can be useful for many things, including setting up persistent config profiles (i.e., source a file that overrides the main config).</h1>
<h1>All script lines are executed whenever the config is loaded/sourced.</h1>
<h1>This happens regularly while the daemon is running, and at least once per command run.</h1>
<p>#</p>
<h1>Note: Due to user data encryption, files used in one-line scripts must reside somewhere in /data/adb/, just like acc's own data files.</h1>
<h1>Ignore if your data isn't encrypted.</h1>
<p>#</p>
<h1>Tip: One can schedule tasks with the following construct:</h1>
<h1>: sleep profile; at 22:00 acc -s pc=50 mcc=500 mcv=3900, acc -n Switched to night profile</h1>
<p>#</p>
<h1>WARNING: All scripts must always return zero. Appending "|| :" ensures that.</h1>
<h1>pause<em>capacity (pc) # resume</em>capacity (rc)</h1>
<p>#</p>
<h1>Type: Integer (percentage)</h1>
<h1>Defaults: pc=75, rc=70</h1>
<p>#</p>
<h1>Battery level or millivolts at which charging shall be paused/resumed.</h1>
<h1>prioritize<em>batt</em>idle_mode (pbim)</h1>
<p>#</p>
<h1>Type: Boolean | String (pbim=no)</h1>
<h1>Default: true</h1>
<p>#</p>
<h1>Battery idle mode, also called "standby mode" or "charging bypass", is the ability of running off the charger, as if the battery were disconnected from the device.</h1>
<h1>Not all devices support this, but there's also emulated idle mode (refer to the readme), which works on all devices.</h1>
<p>#</p>
<h1>If enabled, charging switches that support battery idle mode take precedence.</h1>
<h1>This is only relevant when the switch is automatically determined -- i.e., charging_switch is not set or it has no trailing " --".</h1>
<h1>In other words, this variable is only used when acc is automatically testing charging switches.</h1>
<h1>When set to "no", it has the opposite effect (prioritize non-idle mode).</h1>
<h1>reboot_resume (rr)</h1>
<p>#</p>
<h1>Type: Boolean</h1>
<h1>Default: false</h1>
<p>#</p>
<h1>Reboot (when capacity capacity is at or below resume_capacity) to re-enable charging.</h1>
<h1>This is only for devices whose switches can't re-enable charging.</h1>
<h1>A warning Android notification is posted 60 seconds prior, for the user to block the action, if they so please.</h1>
<h1>reset<em>batt</em>stats<em>on</em>pause (rbsp) # reset<em>batt</em>stats<em>on</em>plug (rbspl) # reset<em>batt</em>stats<em>on</em>unplug (rbsu)</h1>
<p>#</p>
<h1>Type: Boolean</h1>
<h1>Default: false</h1>
<p>#</p>
<h1>Reset battery stats after a given event.</h1>
<h1>run<em>cmd</em>on_pause (rcp)</h1>
<p>#</p>
<h1>Type: String</h1>
<h1>Default: Null</h1>
<p>#</p>
<h1>Run commands* after pausing charging.</h1>
<h1>* Usually a script ("sh some<em>file" or ". some</em>file")</h1>
<h1>shutdown_capacity (sc)</h1>
<p>#</p>
<h1>Type: Integer (percentage)</h1>
<h1>Default: 5</h1>
<p>#</p>
<h1>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.</h1>
<h1>A value less than 1 disables it.</h1>
<h1>An Android warning notification is posted shortly before the shutdown, giving some time to abort the process.</h1>