Here's a github repo that explains how to start an app after boot up in Kotlin.
You may encounter issues on some recent Android versions and devices because of how OEM is managing battery optimization.