And put software on that hardware that preserves your rights. I use GrapheneOS on a Pixel, and there are ROMs for other hardware as well:
LineageOS
CalyxOS
/e/OS
Each has tradeoffs, but the point is to pick something you control and force apps to meet you where you are. If enough people do that, app developers will accommodate them.