How to make Android device boot when power is plugged in?

后端 未结 6 1173
长发绾君心
长发绾君心 2020-12-15 09:40

I need to use this for a Samsung Tablet.

Usually if the device is switched-off and the USB cable is being connected the display will wake up for some seconds showing

相关标签:
6条回答
  • 2020-12-15 10:00

    That's going to be a function of firmware at a very low level which, if the device is shut down, runs without any part of Android present.

    0 讨论(0)
  • 2020-12-15 10:00

    On my S4 mini GT-i9291 the procedure listed above by Thorsten worked only with one modification: add the "su".

    #!/system/bin/sh
    su
    mount -o remount,rw /system
    /system/bin/lpm.orig &
    while [ true ]; do
    sleep 1
    ps | grep lpm.orig && sleep 3 && /system/bin/reboot
    chown root.shell /system/bin/lpm
    done  
    

    Tks!!!!!

    0 讨论(0)
  • 2020-12-15 10:11

    These answers led me to my solution. I'm using this on a Samsung Galaxy Tab S. For other tablets, the path to the system mount will be different. To find it, use this command in an adb shell.

    cat /proc/mounts | grep system

    One problem I came across was the tablet booting into recovery mode after I changed the lpm file, but that's because I mv'd the old one and created a new lpm file and didn't set the correct permissions and ownership. Using cp instead fixed this. My one-liner to set this up on a tablet is:

    mount -o remount,rw /dev/block/platform/dw_mmc.0/by-name/SYSTEM /system && cp /system/bin/lpm /system/bin/lpm_orig && echo "#!/system/bin/sh\n/system/bin/reboot" > /system/bin/lpm
    
    0 讨论(0)
  • 2020-12-15 10:13

    A member on XDA has posted a solution for this which seems to work on some Samsung devices.

    The idea is to replace the script for the battery icon (which will appear of course as soon as the device is plugged in) with a custom script that will boot the phone. To make this work locate /system/bin/playlpm. Rename the old playlpm to playlpm.bak and replace it with the following script:

    #!/system/bin/sh
    /system/bin/reboot
    

    For more information read the thread on XDA

    0 讨论(0)
  • 2020-12-15 10:17

    The change you'll need to make is in the bootloader.

    That's the first thing that's started up, which comes long before the C environment gets initialized, or the kernel gets loaded, or even anything from the user space or from Android...

    Bootloaders can vary significantly depending on the hardware they were written for, but there is little that's secret about them and you should be able to find the information you're looking for -- now that you know which keywords to use.

    0 讨论(0)
  • 2020-12-15 10:18

    I have a rooted Samsung S4 mini. The following steps worked for me:

    1. mount -o remount,rw /system
    2. mv /system/bin/lpm /system/bin/lpm.orig
    3. create /system/bin/lpm as follows:

      #!/system/bin/sh
      /system/bin/lpm.orig &
      while [ true ]; do
        sleep 1
        ps | grep lpm.orig && sleep 3 && /system/bin/reboot
      done
      
    4. chown root.shell /system/bin/lpm

    0 讨论(0)
提交回复
热议问题