I've read a lot, and heard both sides, but still slightly in the cloud when it comes to android. Android is a open source OS, but when I buy a phone, it comes preloaded with google services and apps that are clearly not open-source, and are integrated at such a level a cannot remove them. Only "disable" them.

If android is truly open source, can I compile my own image and flash it to my phone so that I am running a 100% open-source code OS on a mobile platform?

(I'm thinking in the mindset of Debian, where all code is open source and available to the end user)


Yes and no.

You could run https://www.lineageos.org/ to have a completely FOSS operating system. You would still want some sort of app marketplace. You can put "gapps" on your LineageOS phone, or you could use https://f-droid.org/.

However, "thinking in the mindset of Debian," this is like running Linux on a laptop in 2001: you may still need closed-source components for firmware or hardware drivers.

  • 1
    That's a great last comment, @Jon. It's important for Trevor to decide, if it comes down to it, whether he wants a phone that works or an open-source flag to wave; for just because open-source code is in the base , doesn't eliminate the potential need for drivers on top which are definitely closed. So the "do I want to be a purist or do I just want to make a phone call today" question may become relevant. – user2066657 Jun 14 '18 at 5:44

There are several aspects to consider...

  1. Yes, Android is open source, at least as provided by the Android Open Source Project. However as you mention more and more of the platforms’ features are provided as non-open source components, e.g. in Google Services; this includes somewhat basic features such as the swiping keyboard, and more complex subsystems such as Android Auto. And most phones’ kernels include proprietary modules whose source code isn’t available...

  2. Yes, you can rebuild your own version of Android. See for example the LineageOS build instructions (look up any supported device there, and you’ll find build instructions).

  3. Whether you can flash your build onto your phone depends on the specific model of phone you have. Many phones attempt to prevent their operating system from being replaced by images which aren’t signed by the manufacturer; flashing those relies on someone finding a hack. LineageOS also has instructions for supported devices, and you’ll find others on Android forums.

The result is rarely fully open source: as mentioned above, the kernel typically includes proprietary blobs, which means you’re often stuck on whichever version the manufacturer shipped, and there’s usually a number of pieces of proprietary firmware (including the boot firmware). There are projects which attempt to address this, such as Replicant (an Android variant with the emphasis on freedom and security) and postmarketOS (an Alpine Linux-based phone-optimised distribution with reverse-engineered support for a surprising amount of hardware); both of these target older phones so they might not be relevant for you.

On the application side, F-Droid documents how to build all the hosted applications.

So it is certainly possible to run a largely open source system on many phones, but in the vast majority of cases it’s still a compromise. In particular, the security story on phones is really bad; LineageOS used to try to track relevant CVEs on supported devices, but there are thousands and they’ve stopped for the time being.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.