Open source as charity has run out of steam; to survive, open source must be profitable.
The way to do it is to have a license under which all uses personal, educational, hobbyist, etc. are completely free and open source, but as soon as someone wants to sell something with your code in it, you get a cut.
Not entirely unlike a transaction processor like Visa or MasterCard.
It should be viral, so that all commercial software made with software under the license must also be licensed under the license, and the corporation’s commercial code must be available for inspection upon (legal?) inquiry, though the corporation may restrict the ability for others to use their code in other corporations’ commercial applications.
Lock-in is achieved when it’s cheaper and easier for these freeloading corporate entities to pay up (the devs) than it is to try to rewrite everything.
Smaller apps might not do it at all, or maybe just one, but anything that's been around long enough will inevitably have up to about 5 different analytics platforms. It's the thing I feel the "ickiest" about being an iOS developer. I've successfully fought against putting in stuff like Session Replay (and Apple has since banned it) so that makes me feel a tiny bit better.
As for running an adblock on your router, if your router supports openwrt, openwrt has an adblock addon[2] that is easily configurable.
Unfortunately, you will lose out on the statistics that Pi-hole collects.
[1] https://github.com/StevenBlack/hosts
[2] https://github.com/openwrt/packages/tree/master/net/adblock/...
Note: I ended up setting up that pi-hole, and I see it blocking a ton of DNS lookups for these types of companies across my family's devices.
> I think many people would be surprised by the amount of analytics data leaving their phone _all the time_. I recently was doing some work where I had my iPhone proxied through mitmproxy on my laptop, and was blown away by just how much data was being sent. Some apps were sending a request to one or more analytics firms every single time I touched a UI control. I would set up a pi-hole and VPN to block this stuff, but I'm sure the app developers will just start tunneling the requests through their own hosts. Maybe some day one of these open source phones will actually be viable.
[0] https://news.ycombinator.com/item?id=19109243
[1] https://news.ycombinator.com/item?id=19109027