[Q] Power on when plugged in (boot when docked)?

Search This thread

ahhl

Senior Member
Jul 23, 2007
1,058
110
reporting again here on successfull on making auto boot redmi note 7 global on android 10 miui 12
after sucessfull install orangefox recovery and install magisk using orangefox.
boot into system and use total commander to search for init.rc



modify the on charger line from

on charger
class_start charger

to

on charger
exec u:r:magisk:s0 -- /system/bin/reboot

save the init.rc and boot into recovery, mount all partition. go to where you keep the init.rc and set permission to 644

the copy/paste ( using orangefox file manager) init.rc to \system_root folder.

then turn off the device and plug-in charger. the device will boot twice and boot into system..

walla
 
  • Like
Reactions: aIecxs

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    reporting again here on successfull on making auto boot redmi note 7 global on android 10 miui 12
    after sucessfull install orangefox recovery and install magisk using orangefox.
    boot into system and use total commander to search for init.rc



    modify the on charger line from

    on charger
    class_start charger

    to

    on charger
    exec u:r:magisk:s0 -- /system/bin/reboot

    save the init.rc and boot into recovery, mount all partition. go to where you keep the init.rc and set permission to 644

    the copy/paste ( using orangefox file manager) init.rc to \system_root folder.

    then turn off the device and plug-in charger. the device will boot twice and boot into system..

    walla
  • 18
    SOLVED: Power on when plugged in (boot when docked)?

    Hey guys, I know that no one else may ever have any use for this, or even care, but I wanted to post an update. I was finally able to get this figured out through some guess work, trial and error, and looking at the work someone else did on a fairly similar project.

    I owe plenty of credit to the fine work done by Chainfire on his project described in this link. His work, while not the same project, demonstrated that something similar to what I wanted to do WAS possible.

    Anyway, to make the tablet boot up when first plugged in- The battery charging indicator that runs when you first plug in the Galaxy Tab is run from the file /system/bin/playlpm. To make it boot automatically, delete the old playlpm (or better yet, rename it to playlpm.bak, just in case) and replace it with the following script.

    /system/bin/playlpm
    Code:
    #!/system/bin/sh
    /system/bin/reboot

    Be sure to set the ownership and permissions the same as the old playlpm. It didn't work for me at first because I had forgotten to give execute permission.

    Thats all that it takes. Most of the time, the Tab should have enough power to go straight to booting. If the battery is really dead, it may flash the charging battery icon a few times, failing to boot until it gets enough charge. It will eventually come on.

    I don't know of any additional side-effects for doing it this way, but there may be some, I don't know what else the stock playlpm is supposed to manage. This worked for my purposes though. Hope it could help someone else.
    5
    Appologies if this has been asked/answered here before. I tried searching, but didn't find any solution. Maybe someone else has stronger Google skills than I.

    Here is what I am trying to do. I'd like to find a way to have the Galaxy Tab power on automatically when it is plugged in to power and begins charging. My company has several Galaxy Tabs (rooted) that are being used for a specialized purpose. They should be plugged in 24/7. However, it is possible that they will lose power, and the battery will eventually run down. When power is restored, I'd like to be sure that they come back on, without any user interaction.

    I don't THINK this is the case, but it is worth asking: Is this a standard Android setting I can change anywhere?

    I assume I will have to modify some code. Right now, I notice that when the Tab is turned off, and you plug it in, the charging indicator shows up and displays the battery levels. To me this indicates that code is running SOMEWHERE as soon as the Tab gets plugged in. I'd like to hijack that, and just have it power on.

    Does anyone know where I should start looking for the code that runs when the device is plugged in? I found a charging.jpg in /mnt/.lfs that seems to be the image that displays, but so far no sign of what code is running. If there is any sort of init script, that would be amazing if someone could point that out.

    Even if you don't know how to accomplish this, if you have any helpful pointers or "take a look at these files" to point me in the right direction, I'd really appreciate it.

    As always guys, thanks for all the help!
    4
    Hello,

    None of the proposed solutions worked for me on Samsung Galaxy Tab A 10.1 (T580) with Android 7 (no boot, black screen, boot to Recovery, etc.), but after much testing, I've found another way to make it work.

    Extract boot.img from the rooted device and copy to PC (13540000.dwmmc0 -> T580's boot partition):
    adb shell "su -c dd if=/dev/block/platform/13540000.dwmmc0/by-name/BOOT of=/sdcard/boot.img"
    adb pull /sdcard/boot.img

    Download Android Image Kitchen:
    https://forum.xda-developers.com/showthread.php?t=2073775

    Drag-and-drop boot.img to unpackimg.bat.

    Open ramdisk/init.rc

    Search for on charger and add at the end (after write /sys/class/power_supply...):
    setprop ro.bootmode "normal"
    setprop sys.powerctl "reboot"

    Save file and repack image (double click on repackimg.bat).

    Rename image-new.img to boot.img

    Tar boot.img file (you will need tar for Windows):
    tar -cf boot.tar boot.img

    Download Odin latest version:
    https://samsungodin.com/

    Open Odin, click on AP, select boot.tar file.

    Reboot device to download mode:
    adb reboot download

    Click Start on Odin.

    After reboot, disconnect and power off device. Reconnect the USB cable and wait.
    2
    Found solution that works on Samsung Galaxy Tab A6

    For me the reboot scheme didn't work but what did work was putting into /system/bin/lpm this:
    Code:
    #!/system/bin/sh
    echo b > /proc/sysrq-trigger

    Hope it helps someone :)
    1
    reporting again here on successfull on making auto boot redmi note 7 global on android 10 miui 12
    after sucessfull install orangefox recovery and install magisk using orangefox.
    boot into system and use total commander to search for init.rc



    modify the on charger line from

    on charger
    class_start charger

    to

    on charger
    exec u:r:magisk:s0 -- /system/bin/reboot

    save the init.rc and boot into recovery, mount all partition. go to where you keep the init.rc and set permission to 644

    the copy/paste ( using orangefox file manager) init.rc to \system_root folder.

    then turn off the device and plug-in charger. the device will boot twice and boot into system..

    walla
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone