De-Googling my phone

I’ve been a professional Free Software developer in the GNU/Linux area for 14 years now, and a hobbyist developer and user for much longer. For some reason that never extended much to the smartphone world, beyond running LineageOS on my older phones (my current Sony Xperia is still under warranty and I’m fine with the officially supported Android), and various stabs at using the Ubuntu phone (RIP!).

On a few long weekends this year it got a hold of me, and I had a look over the Google fence to see how Free Software is doing on Android and how to reduce my dependency on Google Play Services and Google apps. Less because I would actually severely distrust Google, as they have a lot of business and goodwill to lose if they ever majorly screw up; but more because of simple curiosity and for learning new things. I want to note down my experience here for sharing and discussing.

I started experimenting on my old Nexus 4 by completely blanking it and installing current LineageOS 14.1 without the Google apps. This provides a nice testing ground that is completely free of any proprietary Google stuff. From that I can apply good solutions on my “production” Xperia.

Alternative app stores and free apps

The number one must have is of course to install the F-Droid app, which opens the door to a surprisingly large and good world of Free Software apps. With that I was already able to replace a good deal of my installed apps with free alternatives:

  • K9 Mail, Telegram, and OsmAnd+ are also available on F-Droid, which I find preferrable as they rebuild everything from source and thus binaries seem a bit more trustworthy.

  • I previously used Opera as a web browser, because it is relatively lightweight (important on my previous phone) and the really good builtin ad blocker. But these days Firefox is really fast and good enough, so I replaced it with Fennec, which is more or less Firefox with some non-free bits removed. After installing uBlock Origin I’ve never looked back.

  • Some apps have fairly straightforward replacements:

    • Google Authenticator → FreeOTP
    • YouTube → NewPipe
    • BlueFilter → Night Screen
    • QR Scanner → SecScanQR
    • ConnectBot → Termux (which is actually a magnitude more powerful and also has a better terminal implementation)
    • GPS Status → SatStat
  • Some other apps like Google+ and Pocketliga just got replaced with bookmarks to web sites, which are good enough. This includes Google Maps; I usually prefer and use OsmAnd for walking, biking, and general navigation/routing. But for finding commercial things Maps is usually better; however, I use it rarely enough to not get too annoyed by the much higher latency of the web page.

There are also some apps that I want (like WhatsApp, Nextbike, or Quizduell) that don’t have free software alternatives. Uptodown is an alternative app store that does not require Play Services and has a lot of apps like the above or the Deutsche Bahn Navigator (but that requires Play Services by itself, so that doesn’t help that much).

Email

This was also easy. I’ve run my own Mail server forever, use mutt on the desktop, Rainloop for the occasional web mail access, and the gorgeous K9 on the phone. I have always loathed the GMail web UI, so I never got into the habit of using GMail much, except as a sacrificial spam address for random web shops. But it turns out that this is surprisingly simple to use without the GMail app and Play services - just create an app password and use it in a new K9 mail account. This also simplifies things to not having to deal with two different email apps.

Notes and TODO lists

I’ve used Google Keep for a long time for notes and TODO lists. The Android app and widget, and the web UI have a nice no-nonsense approach and work just fine. Perhaps surprisingly this was the thing that took me longest to replace: there is a plethora of notes/TODO apps around, and I’ve tested quite a few of them.

During that I discovered Org mode, a very powerful and flexible plaintext-based system (a bit like Markdown in spirit, but different syntax and much more powerful). Primarily it is an Emacs extension, but there is a reasonably good vim-orgmode plugin for writing on the desktop (which I much prefer over typing in the Keep web UI!), and Orgzly for Android that has a pleasant UI for maintaining notes, and also a nice widget for putting my TODO list on the starter screen.

Neither of these can sync with other devices, but fortunately this (rather independent) task also has a nice solution, see below.

I’ve happily used these tools for two months now. vim-orgmode fits my usual workflow on the desktop much better, and on the phone the experience is not significantly different (I don’t use the more powerful Org features - yet).

File syncing

While looking for how to synchronize my Org notes between phone and laptop, I stumbled over the really magnificient Syncthing project. It’s a general-purpose many-to-many file sync solution using modern and standard encryption and authentication technology, and is readily available on Debian (for my server), Fedora (for my laptop), and F-Droid (for my phone). Installation and configuration on the web and Android UIs are straightforward, and it can just as easily be used to backing up your photos or syncing music or ebooks (for you Dropbox or Google Drive using types - I use neither, though).

The main disadvantage to Keep or other Google apps is that there is no push notification on changes - all instances of Syncthing poll, so there is some delay in propagating updates. Also, Android keeps nagging with a “Syncthing is running in the background” notification, but fortunately it can be toned down enough in Android 8 to not get in the way any more. Power usage is obviously something to watch out for here, but I haven’t noticed any significantly worse battery drain so far.

Contacts and Calendar

A few years ago I had run ownCloud for quite some time, mostly to store my contacts and calendar. But it takes a non-trivial amount of setup, maintance, and resources on the server and has a rather high influx of security issues, so I went back to Google eventually.

Today I discovered Radicale, which is much more appealing: It is a lightweight Python module that provides a CalDAV/CardDAV API for a bunch of standard *.ics (calendar) and *.vcf (contact) files. For the most part its documentation is excellent, and I set up the service and Apache reverse proxying on my server in no time.

The only thing that is not documented well is how to import existing ics/vcf files (exported from Google Calendar/Contacts). Turns out one can just use a standard HTTP/WebDAV PUT request:

curl -u 'martin:myPassWord' -X PUT https://my.server.de/radicale/martin/contacts/ --data-binary @contacts.vcf

(the same thing with exported *.ics for calendar).

On Android I installed DAVdroid where I just added the Radicale root URL (with user/password), then saw my two contact/calendar sources, and enabled them. I disabled the phone’s Google account on the phone instead. Yay, once again I own my data. :-)

This does not provide a web UI for the calendar/contacts. I rarely used https://calendar.google.com, and essentially never https://contacts.google.com, so I suppose I won’t actually need to find a replacement. But if so, I might take a look at Roundcube to replace Rainloop, as the former has a plugin for calendar. I don’t have Thunderbird, Evolution, or anything similar installed, as that’s just too heavyweight for the rare cases where I deal with my personal calendar on the laptop.

Remaining items

The one remaining app on my phone that needs Google Play Services is now the Deutsche Bahn Navigator. I like and use that a lot, both for information and for buying tickets. On my next trip I’ll give trainline.eu a go, which looks very promising: same price as https://bahn.de directly, they consider my BahnCard, don’t need Play Services, and can also book trains in other countries.

There are also some warts with other apps (Quizduell and swa Fahrinfo) that occasionally complain about missing Play Services, although they work well enough without. In Nextbike one loses the life map where bikes are available, which is quite important; a reasonable alternative is to look that up on their website, which provides the same map. Actually booking a bike and all the other functionality works fine without Play Services.

Conclusion

I’ve learned a lot of new things during the above, so this was a worthwhile experiment beyond mere political and idealistic reasons. However, setting up such a “Google free” phone requires a significant amount of time, dedication, and skill (not to mention a personal server), definitively far beyond to what I’d trust my mother to comprehend. But it’s reassuring to know that, if push comes to shove, it’s definitively still possible to have an useful smartphone that’s running mostly FOSS and no Google proprietary stuff!

Update: I posted a follow-up that resolves and amends some issues above.