[Xiaomi Mi A2 / 6X Questions & Answers] himi24:
Hello people,

I need a xiaomi phone to boot when usb power is turned on.

Stock boot image

Android 9 PKQ1.180904.001.V10.0.8.0.PDIMIXM

What I tried so far:

#1 Battery animation file

I found some solutions for samsung smartphones modifing charger animation files.

system/bin/lpd

system/bin/lpod

--> Did not find such file. My /System/bin/ contains:

acpi dd input mknod rmdir tc-wrapper-1.0
am debuggerd insmod mkswap rmmod tee
app_process dex2oat ionice mktemp run-as telecom
app_process32 dexdiag iorenice modinfo runcon time
app_process64 dexdump ip modprobe schedtest timeout
applypatch dexlist ip-wrapper-1.0 monkey screencap tinycap
appops df ip6tables more screenrecord tinymix
appwidget diff ip6tables-restore mount secdiscard tinypcminfo
atrace dirname ip6tables-save mountpoint secilc tinyplay
awk dmesg ip6tables-wrapper-1.0 move_time_data.sh sed toolbox
base64 dos2unix iptables mv sendevent top
basename dpm iptables-restore ndc sensors_test touch
bcc du iptables-save ndc-wrapper-1.0 sensorservice toybox
blockdev dumpsys iptables-wrapper-1.0 netstat seq tr
bmgr echo iw newfs_msdos service true
bu egrep keystore_cli_v2 nice setenforce truncate
bugreport env kill nl setprop tty
bugreportz expand killall nohup setsid tzdatacheck
bunzip2 expr ld.mc oatdump settings uiautomator
bzcat fallocate linker od sh ulimit
bzip2 false linker64 paste sha1sum umount
cal fgrep linker_asan patch sha224sum uname
cat file linker_asan64 patchoat sha256sum uniq
chcon find ln perfetto sha384sum unix2dos
chgrp flock load_policy pgrep sha512sum update_engine_client
chmod fmt locksettings pidof simg2img uptime
chown free log ping sleep usleep
chroot getenforce logcat ping6 sm uudecode
chrt getevent logname pkill sort uuencode
cksum getprop logwrapper pm split vmstat
clear grep losetup pmap start vr
cmd groups ls ppd stat wc
cmp gunzip lshal printenv stop which
comm gzip lsmod printf strings whoami
content head lsof ps stty wigig_logcollector
cp hid lspci pvclicense_sample svc wigig_remoteserver
cpio host_manager_11ad lsusb pwd swapoff wigig_wiburn
crash_dump32 hostname md5sum readlink swapon wm
crash_dump64 hw media realpath sync xargs
curl hwclock microcom reboot sysctl xxd
cut id mkdir renice tac yes
dalvikvm ifconfig mkfifo requestsync tail zcat
dalvikvm32 ime mkfs.ext2 resize2fs tar
dalvikvm64 incident mkfs.ext3 restorecon taskset
date inotifyd mkfs.ext4 rm tc

#2 Ram Disk modification

I pulled the /System/bin/reboot file using adb shell and extracted the boot.img using android kitchen 3.5 from the forum.

Verified that everything works by unpacking/repacking/flasing boot image.

https://xdaforums.com/showthread.php?t=2073775

- replaced the /ramdisk/sbin/charger file with the reboot file

--> battery animation is still there but nothing happens

- modified the charger file according to this discussion: https://xdaforums.com/galaxy-note-3/help/lineage-os-auto-boot-charge-connected-t3626364/page2

--> battery animation gone but stuck at google logo

- modified /ramdisk/init.rc and added:

on charger

trigger late-init

--> battery animation gone but stuck at google logo

- deleted /sbin/charger and charger service in init.rc and flashed image to both boot slots

--> changes nothing, battery animation will still show up.

- searched for battery/animation files / images in the ramdisk, but there seems to be nothing.

What else could I try?

Why isnt it working as expected?

Would flashing LineageOS or getting root access change anything?

UPDATE

--> here you can find a solution

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

Many Greetings & Thanks alot,

himi :confused: