This might have changed since, but in 2017 LastPass had to work with Google to update how they run their app. Google introduced "a new policy restricting the use of Android Accessibility Services" [1]
I'd look into that before starting that implementation.
https://github.com/LibreShift/red-moon/issues/253#issuecomme...