On GrapheneOS[0] (privacy focused AOSP-based mobile OS) you can do that stuff easily while still owning your device/having root, etc (at least according to this video[1] I saw)
[0]: https://grapheneos.org/
[1]: https://www.youtube.com/watch?v=yIZmUINSvQ4