Google collects a lot of data from Android phones. A lot of it is GPS and accelerometer data. Even if you do not have a Google account on your phone, Google can use location data to identify where the phones spends most of its time and get a reasonably good idea of your circles.
So how do we block this?
DNS/IP Blocking
The first method is to block all network requests to google servers.
Some VPNs allow you to configure your own DNS, where you can block all google domains. Point them to 0.0.0.0.
But it's hard, verging on impossible to catch all google domains, so there's an easier option
You can block traffic to the following set of IP addresses, which are the ones google currently uses. It's a lot harder to get new IP addresses than it is to get new domain names, so this method should be longer lasting.
- 8.8.8.8
- 8.8.4.4
- 2001:4860:4860::8888
- 2001:4860:4860::8844
One downside of this method is that you cannot visit google websites in your browser as well. It is also harder to set up on mobile phones, which sometimes connect to the internet via Wi-Fi and sometimes via mobile data.
Google Services likely is still recording all data and just waiting for a working connection to upload it. If you ever disable this blocking to, say, watch a youtube video, all that data gets uploaded, making the whole process pointless.
Disabling Google Services
You can disable all google apps on your phone. This stops Google from continuously recording what you do. However, with Android that comes installed with your phone, this may not even be allowed. This also interferes with the functioning of all apps that use Google Services, OS updates, and GPS location.
Wait, why GPS?
Well, the way GPS works is that all GPS satellites are broadcasting information about their orbit, called ephemeris data, which needs to be refreshed every few hours. Based on the timing of the messages from different satellites, the GPS receiver can estimate its distance from each satellite and thus its own location. The full message takes 45 seconds to transmit, after which it repeats the message. This means that a GPS receiver has to listen for at least 45 seconds to know its location.
However, what if we could get the ephemeris data from elsewhere, and then just listen to the satellites and instantly get the current location? This is made possible by making the ephemeris data available online. On your Android, Google Services provide the pre-loaded ephemeris data.
You can enable Google Services when you want them, and they will only record your data for as long as they are enabled.
Installing a Custom OS Without Google Services
Take Android out, replace it with an OS with no Google Services at all! GPS augmentation is done using a different provider!
Changing the OS on a smartphone is a lot trickier than changing the OS on a computer. Most reputed distributions provide detailed instructions which you can follow to safely install the custom OS, but you have to follow the instructions exactly. Mistakes carry a high risk of rendering your phone unusable, which happened to me when I first tried this. For this reason, it is recommended that you read through the instructions a few times first before starting anything.
Since that first misadventure, replacing the OS has always gone smoothly for me, but the tension is always heart-wrenching.
The process generally involves unlocking the bootloader, installing the custom recovery software, installing the OS itself, and then relocking the bootloader.
You can then install Google Services if you use any apps that need them, and keep it disabled until you need it. GPS and updates work with no issues.
Installing a Custom OS With Google Services Sandboxing
GrapheneOS, ironically available only for Pixel devices, lets you install Google Services without giving them too much access to the sensors. This seems to strike the best balance between usability and privacy, in my opinion.