How to make phone boot automatically upon battery insertion (unlocked bootloader and root: yes)? By battery insertion I mean current flowing on the battery pins, not the micro USB port.

Description

The phone in question is a Samsung Galaxy Xcover 4, the bootloader is unlocked, and I have root access. Its intended purpose is as a kiosk device that will be sealed inside an external hard plastic enclosure. This means that the power button is unavailable for booting the phone. The phone is powered directly from the wall by means of a custom-made battery eliminator PCB, and I need the micro USB port for host mode UART communication, which means it will never be charged/powered via the micro USB port.

What has been attempted so far

As mentioned, the device is rooted, so I've tried modifying the BOOT partition image and flashing an updated one. The modifications I've been looking at pertains to the program

/init


in the root directory. and its associated

/init.rc
/init.samsungexynos7570.rc
/...


files. For example, I was able to make the phone boot upon receiving charge via the USB port by overwriting the contents of the file 

/system/bin/lpm


with the script

#!/system/bin/sh
echo b &gt; /proc/sysrq-trigger


because /system/bin/lpm is referenced in a service specified in the charging section of /init.rc. I was also able to make it boot via USB port charging by removing the existing "on charge" triggers in the init.*.rc files, and simply adding

on property:ro.bootmode=charger:
    trigger late-init


For more details about what I did, see this link. But this is not a solution for me because I want to make it boot simply by powering the battery pins, not the micro USB port (which is preoccupied with being in host mode, so it definitely can't be charged). 

Further thoughts

However, since modifying the /init.rc file changed its behaviour even while "off" (i.e. it now boots upon micro USB charging as opposed to not), this seems to tell me that the phone is never really completely off when "off", and that the /init program is constantly running as long as there is enough charge on the battery pins (please derail this thought train asap if this is completely wrong). Which would mean the kernel and the /init program should start automatically when there's sufficient charge on the battery pins. So my thinking was to simply add something along the lines of

trigger late-init


or

start &lt;my_service&gt;


(where my_service for example could be the lpm script I mentioned above) in an early init trigger stage, so that it would boot simply by virtue of the /init program running. But so far I've had no luck.

Does anyone know whether something like this would possible? Thanks for your time.
I soldered the pins of my Nexus 7 2012 Gen 1 and the device did start up. The soldering simulates a always pressed power on button.
However I tried the same with the Nexus 7 2013 Gen 2 and it turned itself off again, because the button was always pressed. So I needed to solder a capacitor and a resistor in series so simulate a short button press. This worked for me, but the software solution would be more elegant.
I could measure only a few uA when the battery is plugged in so I can't image a part of the bootloader is powering up on the mentioned devices. My idea is now to solder the power supply directly to the micro usb port as for data only 2 pins (USB2.0) are used. USB Pins: https://www.giga.de/downloads/microsoft-windows/tipps/usb-anschluss-farben-stecker-bedeutung-und-erklaerung/

Then the device will start up with the lpm script or the "Fastboot oem off-mode-charge 0" change.
An other solution would be really appreciated.
Thanks and Cheers