Automated power on with charging cable plugged: Difference between revisions

From Edgar BV Wiki
Jump to navigation Jump to search
Line 27: Line 27:
You can't just copy stuff over /system/bin/lpm presumably due to inode problems. If you do, when you plug in the charger you will only see and empty battery picture. So you need to create the script, and then cat the script over the lpm file
You can't just copy stuff over /system/bin/lpm presumably due to inode problems. If you do, when you plug in the charger you will only see and empty battery picture. So you need to create the script, and then cat the script over the lpm file


   cp lpm lpm.orig
   echo lpm > lpm.orig
   vi lpm.sh
   vi lpm.sh


Line 45: Line 45:
</pre>
</pre>


   cat lpm.sh > lpm
   echo lpm.sh > lpm


#  chmod 0755 /system/bin/lpm
#  chmod 0755 /system/bin/lpm

Revision as of 16:00, 19 September 2019

For Non-Samsung phones

Turn Your Old Android Phone/Tablet into the Ultimate Car GPS (for poweron with charger plugged in, see 12:36)

Because Samsung can't do Fastboot the above method won't work for charger, but it comes down to going to fastboot mode and typing

  adb reboot bootloader
  fastboot oem off-mode-charge 0

Set your Android Phone to Automatically Power on when USB Charger is plugged in

Because Samsung can't do Fastboot the above method won't work, but it comes down to going to fastboot mode and typing

  adb reboot bootloader
  fastboot oem off-mode-charge 0

For Samsung phones

Auto-starting Samsung Android phone when charger is plugged in.

Ensure busybox is installed first Busybox by stericson Note also that if you install to /sbin you will lose it all after reboot, so install to /system/xsbin

Note: start in recovery mode (twrp) and mount the system partition here. If the phone is started then you can't perform the /system remount.

  adb shell
  cd /system/bin

https://forum.xda-developers.com/galaxy-s7/help/samsung-galaxy-s7-boot-charge-t3680083

You can't just copy stuff over /system/bin/lpm presumably due to inode problems. If you do, when you plug in the charger you will only see and empty battery picture. So you need to create the script, and then cat the script over the lpm file

  echo lpm > lpm.orig
  vi lpm.sh
#!/system/bin/sh
/system/bin/lpm.orig &
while [ true ]; do
 
 bat_proc=`cat /sys/class/power_supply/battery/capacity`
 
 if [ $bat_proc -gt 10 ]; then
 sleep 3 && /system/bin/reboot
 fi
 
 sleep 5
done
  echo lpm.sh > lpm
  1. chmod 0755 /system/bin/lpm
  chmod 0755 /system/bin/lpm.orig
  1. chown root.shell /system/bin/lpm
  chown root.shell /system/bin/lpm.orig