lineage os 14.1
init.rc
on charger
class_start charger
class_stop charger
trigger late-init
some android phone
on charger
setprop ro.bootmode "normal"
setprop sys.powerctl "reboot
On I9500 runing linage OS 16 modify the init.rc
on charger
setprop ro.bootmode "normal"
setprop sys.powerctl "reboot"
- Extracted Boot image through TWRP (Backup> select boot > swiped to Backup)
- Rename boot.emmc.win to boot.img
- Copy boot.img to the root dir of the program Android.Image.Kitchen, and run "unpackimg.bat"
- Open up folder /ramdisk/sbin/ and rename "charger" to "charger_orig"
- Create "charger" and put in
Code:
#!/system/bin/sh
#Skip offline charge and start device if enough juice on battery. If low on battery do offline charge
CAPACITY=$(cat /sys/class/power_supply/battery/capacity)
MIN_CAPACITY=5
if [ $CAPACITY -gt $MIN_CAPACITY ]
then
sleep 1
/system/bin/reboot
fi
/sbin/charger_orig
- Go back to the root of Android.Image.Kitchen and run "repackimg.bat"
- Take "image-new.img" and copy to phone
- Install img with TWRP (install>install image> select above "image-new.img" >select boot > swiped to install)