Tuesday, December 19, 2017

Auto boot (start or power on) android on charge

After some research and I don`t remember how many google pages and searches I found that you can achieve this function using:
1. Enter Fastboot Mode (adb reboot bootloader)
2. Enter Command: fastboot oem off-mode charge 0
3. Enter Command: fastboot reboot
if that is not working for you maybe this one will work:
1. search in /system/bin/ for playlpm, ipod, lpm, kpoc_charger or any other file that have inside some reference to battery animation.
2. edit that file, delete all content inside and add
#!/system/bin/sh
/system/bin/reboot
if that is not working you can try this:
1. Unpack boot.img and edit init.rc.
2. Add following to the end of file:
#Check if chargermode and start autoreboot service.
on property:ro.bootmode=charger
start autoreboot
#autoreboot service which command reboot
service autoreboot /su/bin/su /system/bin/reboot -c reboot now
user root
oneshot
3. re-pack boot.img
None of that worked for me but I had an idea. Why not just create that damn file inside /bin ???
1. unpack boot.img
2. edit > ramdisk > init.target.rc
3. add start kpoc_charger to “on charger” line *** “kpoc_charger” can have any name be free to name it ***
4. add after:
service kpoc_charger /system/bin/kpoc_charger
class charge
5. create kpoc_charger file on root/system/bin/ with 755 permissions using any root file managers
6. edit file and add:
#!/system/bin/sh
/system/bin/reboot
Have fun and enjoy this.

*Copy pasted from an online post by CODRYN

For NEXUS and MOTOROLA PHONES

1. enter FASTBOOT mode 
2. Connect phone to computer via USB
3. Go to adb folder and then press SHIFT+RIGHT CLICK
4. Select command prompt
5. Enter "fastboot oem off-mode-charge 0"

To reverse it type "fastboot oem off-mode-charge 1"


 Another method for ASUS:
1. Unpack the kernel 
2. Open the init.qcom.rc file in the Notepad ++ ramdisk 
3. Look for and delete the lines:
service charger / charger
class charger
group log
seclabel u: r: healthd: s0

4. Instead of deleted lines we write the following lines:
on property: ro.bootmode = charger
class_start sec-charger
service playlpm / system / bin / reboot
class sec-charger
critical

5. We pack the kernel. 
6. Install the kernel.