Skip to content

Commit

Permalink
**2019.5.16 (201905160)**
Browse files Browse the repository at this point in the history
- Additional charging switches
- General optimizations
> Note: compatible with ACCApp 1.0.6
  • Loading branch information
VR-25 committed May 16, 2019
1 parent 014e5cd commit b0aabe7
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 27 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,11 @@ See current submissions [here](https://www.dropbox.com/sh/rolzxvqxtdkfvfa/AABceZ
---
## LATEST CHANGES

**2019.5.16 (201905160)**
- Additional charging switches
- General optimizations
> Note: compatible with ACCApp 1.0.6
**2019.5.14-r1 (201905141)**
- Exported logs archive also includes config.txt and magisk.log
- Fixed typos
Expand All @@ -392,7 +397,3 @@ See current submissions [here](https://www.dropbox.com/sh/rolzxvqxtdkfvfa/AABceZ
**2019.5.14 (201905140)**
- Overwrite existing config if its format is newer than current config's
> Note: compatible with ACCApp 1.0.6
**2019.5.13 (201905130)**
- capacitySync disabled by default - some systems don't like the "dumpsys" command
- Fixed installer bugs
2 changes: 1 addition & 1 deletion common/MODPATH/acc
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ set -euo pipefail

modPath=/sbin/_acc/acc
config=/data/media/0/acc/config.txt
[[ $PATH == "*magisk/busybox*" ]] || PATH=/sbin/.magisk/busybox:$PATH
[[ $PATH == *magisk/busybox* ]] || PATH=/sbin/.magisk/busybox:$PATH
device=$(getprop ro.product.device | grep .. || getprop ro.build.product)
batt=$(echo /sys/class/power_supply/*attery/capacity | awk '{print $1}' | sed 's|/capacity||')

Expand Down
2 changes: 1 addition & 1 deletion common/MODPATH/accd
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ resetBsOnUnplug=false
modPath=/sbin/_$modId/$modId
config=/data/media/0/$modId/config.txt

[[ $PATH == "*magisk/busybox*" ]] || PATH=/sbin/.magisk/busybox:$PATH
[[ $PATH == *magisk/busybox* ]] || PATH=/sbin/.magisk/busybox:$PATH

log=${modPath%/*}/acc-daemon-$(getprop ro.product.device | grep .. || getprop ro.build.product).log

Expand Down
1 change: 1 addition & 0 deletions common/MODPATH/accd-init
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#!/system/bin/sh
(/sbin/_acc/acc/accd &) &
exit 0
16 changes: 9 additions & 7 deletions common/MODPATH/switches.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
# License: GPLv3+
#
# PWD=/sys/class/power_supply
# Last updated: Sat, May 11, 2019

# Last updated: Wed, May 15, 2019

battery/charger_control 1 0
battery/charge_disable 0 1
Expand All @@ -21,21 +20,21 @@ huawei_charger/enable_charger 1 0
bq*_charger/enable_charging 1 2
ac/charging_enabled 1 0
dc/charging_enabled 1 0
charger/charge_enabled 1 0
*charger/charge_enabled 1 0
chargalg/disable_charging 0 1
mt-battery/disable_charger 0 1
parallel/charging_enabled 1 0
parallel/input_suspend 0 1
dollar_cove_charger/enable_charging 1 0
dollar_cove_charger/enable_charger 1 0
battery/charging_enabled 1 0
battery*/charging_enabled 1 0
battery/battery_charging_enabled 1 0
battery/batt_slate_mode 0 1
battery/store_mode 0 1
usb-parallel/charging_enabled 1 0
dc-wireless/charging_enabled 1 0
*-charger/charging_enabled 1 0
dc/input_suspend
dc/input_suspend 0 1

/proc/smb*_disable_chrg 0 1
/sys/devices/platform/battery/ChargerEnable 1 0
Expand All @@ -49,9 +48,12 @@ dc/input_suspend
/sys/devices/soc/soc:lge,cable_detect/lge_power/lge_cable_detect/charging_enabled 1 0
/sys/devices/soc/soc:lge,charging_controller/lge_power/lge_cc/charging_enabled 1 0

# unconfirmed
/sys/devices/soc.0/78b8000.i2c/i2c-4/4-006b/power_supply/ext-charger/charge_enabled 1 0
/sys/devices/soc.0/qpnp-linear-charger-8/power_supply/battery_qpnp/charging_enabled 1 0

# experimental

# EXPERIMENTAL
#battery/is_in_call 0 1
#/sys/devices/platform/battery_meter/FG_suspend_current_threshold 100 30
#/sys/devices/platform/battery_meter/FG_daemon_disable 0 1
#bms/temp_cold 0 500
Expand Down
3 changes: 2 additions & 1 deletion common/service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# acc/accd initializer

# prepare working directory
([ -d /sbin/_acc ] && exit 0
mkdir /sbin/_acc
ln -fs ${0%/*} /sbin/_acc/acc
ln -fs /sbin/_acc/acc/acc /sbin/acc
Expand All @@ -19,6 +20,6 @@ fi
unset termuxSu

# start accd
accd
accd &) &

exit 0
35 changes: 24 additions & 11 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@ on_install() {
rm -rf $config ${config%/*}/logs 2>/dev/null || :
else
[ $configVer -lt 201905111 ] \
&& sed -i -e '/CapacityOffset/s/C/c/' -e '/^versionCode=/s/=.*/=201905111/' $config || :
&& sed -i -e '/CapacityOffset/s/C/c/' -e '/^versionCode=/s/=.*/=201905111/' $config
[ $configVer -lt 201905130 ] \
&& sed -i -e '/^capacitySync=/s/true/false/' -e '/^versionCode=/s/=.*/=201905130/' $config || :
&& sed -i -e '/^capacitySync=/s/true/false/' -e '/^versionCode=/s/=.*/=201905130/' $config
fi
fi

Expand Down Expand Up @@ -201,7 +201,27 @@ set_permissions() {
[ -f $file ] && set_perm $file 0 0 0755
done

# finishing touches
finish_up

}

# You can add more functions to assist your custom script code

finish_up() {

chmod -R 0777 ${config%/*}

# fix termux su PATH
if [ -f $termuxSu ] && grep -q '/su:' $termuxSu; then
sed -i 's|/su:|:|' $termuxSu
magisk --clone-attr ${termuxSu%su}apt $termuxSu
fi

# workaround for "boot script not executed" bug
$LATESTARTSERVICE && unzip -oj "$ZIPFILE" 'common/*' -d $MODPATH/ >&2 \
&& cp -l $MODPATH/service.sh $MODPATH/post-fs-data.sh \
&& LATESTARTSERVICE=false

if $BOOTMODE; then
mkdir -p /sbin/_$MODID
[ -h /sbin/_$MODID/$MODID ] && rm /sbin/_$MODID/$MODID \
Expand All @@ -214,15 +234,8 @@ set_permissions() {
wait
/sbin/${MODID}d
fi
chmod -R 0777 ${config%/*}
# fix termux su PATH
if [ -f $termuxSu ] && grep -q '/su:' $termuxSu; then
sed -i 's|/su:|:|' $termuxSu
magisk --clone-attr ${termuxSu%su}apt $termuxSu
fi
}

# You can add more functions to assist your custom script code

cancel() {
imageless_magisk || unmount_magisk_image
Expand Down Expand Up @@ -276,7 +289,7 @@ version_info() {
ui_print "(i) Important info: https://bit.ly/2TRqRz0"
ui_print " "
if $BOOTMODE; then
ui_print "(i) Ignore the reboot prompt. You can use ACC right away. Check the documentation for details."
ui_print "(i) Ignore the reboot button. You can use ACC right away."
ui_print " "
fi
}
4 changes: 2 additions & 2 deletions module.prop
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
id=acc
name=Advanced Charging Controller (acc)
version=2019.5.14-r1
versionCode=201905141
version=2019.5.16
versionCode=201905160
author=VR25 @ xda-developers
description=This is primarily intended for extending battery service life. On the flip side, the name says it all. It supports Magisk 17-19.
minMagisk=17000

0 comments on commit b0aabe7

Please sign in to comment.