SELinux prevents my init.rc exec command to execute
I finally managed to solve the problem. There are two problems:


You're not using the "exactly the same identity of adb shell". There are a couple of groups to which adb shell belongs but they're not mentioned in that exec command.
/system/bin/am on its own is not executable, it's a shell script and should be passed to /system/bin/sh to be executed.


So, here's the final and working init.rc statements:

on property:dev.bootcomplete=1
    exec u:r:shell:s0 shell shell input log adb sdcard_rw sdcard_r net_bt_admin net_bt inet net_bw_stats -- /system/bin/sh /system/bin/am start -n com.example.package/com.example.package.MainActivity