Replicant 6.0 released

Over the last one and a half years, a lot of work has been done to move Replicant to a new version and to add new features. Everything started with a (now archived) forum post in January 2016 that documented the initial efforts to get Replicant 6.0 somehow working on a Galaxy S3. Development continued through the first half of 2016, however by far most of the work was done from September 2016 onwards.

Replicant 4.2, the last release, was based on CyanogenMod 10.1 and Android 4.2 respectively. Replicant 6.0 is based on LineageOS 13.0 which is based on Android 6.0. Replicant 6.0 includes all the improvements that were made since CyanogenMod 10.1. Have a look at the changelog for an overview of the new features and changes that were additionally made on our side.

This initial release supports the Galaxy S2, Galaxy S3 and Galaxy Note 2. The Galaxy S3 4G was added as an incomplete device for now as support for telephony and mobile data is missing. The status page shows which functionalities are supported on the individual devices. The previous blog post details the reasons why no SDK is provided as part of the release.

Unfortunately, this release only supports a subset of the devices that were previously supported by Replicant 4.2. So adding support for more devices has the highest priority for the next update. Thanks to device donations from the community, it will be possible to get Replicant 6.0 working on the GTA04, Galaxy Nexus, Galaxy Tab 2 7.0, Galaxy Tab 2 10.1 and Galaxy Note. Please consider donating to Replicant to help development.

As an additional release goal, a complete wiki overhaul was completed over the last two months. Besides updating outdated pages and a general cleanup, a lot of new documentation is now available for users and developers alike. We hope the new release will attract more developers, so that we can tackle some of the tasks we have been facing for a long time.

There won’t be a Replicant 6.0 SDK because there is already something better

And you can help making it accessible to more GNU/Linux users!

We have decided not to create a Replicant 6.0 SDK as part of the upcoming Replicant 6.0 release. For three previous Replicant versions (2.2, 4.0 and 4.2), a SDK was provided.

Replicant offered its own SDK because the Android SDK released by Google is distributed under a non-free license and suggests installing non-free plug-ins such as the Google APIs. For a long time, Replicant has provided the only Android SDK that is available under a free license and that doesn’t offer to install non-free software.

Android SDK in Debian

However, for some time, the Android SDK is available in Debian and it will be possible to build Android apps in Debian Stretch, the upcoming release. The Debian packages suffice to build an app that only has a minimal set of dependencies. Not all libraries that might be needed for building an app are already packaged, but it seems that nothing is missing that would otherwise be available in a Replicant SDK. The packaged Android SDK in Stretch even has the same target API as a Replicant 6.0 SDK would have.

The packaged Android SDK in Debian has many advantages over a Replicant SDK. Build tools should be installable from the package manager of the distribution you are using and not be distributed in a binary archive outside of it. Android SDK packages are provided in Debian alongside other Android build tools like Gradle. The packages can be built reproducibly. We only have very limited time and resources to work on the SDK. Debian has its own team, the Debian Android Tools team, that focuses on packaging more libraries and target APIs, among other things.

Packaging for more distributions

For these reasons, rather than spending time and development efforts on a Replicant 6.0 SDK, we encourage you to work with maintainers to get the Debian Android packages included in more distributions. As Replicant itself is  a fully free software distribution, we would be especially happy to see the packages included in fully-free GNU/Linux distributions, like Parabola or Trisquel.

The Debian Android Tools team is available to answer questions and they are interested in having cross-distro collaboration to solve remaining issues. They can be reached via their mailing list or in the IRC channel #debian-mobile. Their wiki page provides useful documentation.

Of course, we are available as well to answer questions and to coordinate these efforts.

Replicant 6.0 development updates

Replicant 6.0 is moving forward and quite some work has been done over the last months.

Galaxy S2

Only the Galaxy S3 was supported for a very long time. Recently, support for the Galaxy S2 was added. This was made possible because two community members, Grim Kriegor and dllud, sent me a device. The initial work on the device by another community member, Jookia, also gave me a head start for the port.

GTA04

In December, I attended the 8th Open Hard- and Software Workshop which was a great opportunity to discuss and work on various topics related to the GTA04. I assisted Lukas Märdian from Goldelico with porting Replicant 6.0 to the GTA04 and at the end of the workshop, we were able to boot Replicant 6.0 and had basic functionality working. Lukas continues to work on the port and I’m planning to integrate his changes and get Replicant 6.0 ready for the GTA04.

Support for external WiFi dongles with the AR9271 chipset

After you have installed Replicant on one of the supported devices, you will notice that WiFi doesn’t work. The reason is that the WiFi chips on all supported devices need a proprietary firmware to be loaded onto the chip. As Replicant only ships free software, this firmware is not included in an image.
An alternative is to use an external WiFi dongle with an USB OTG cable. A free firmware exists for the AR9271 chipset and various WiFi adapters use this chipset. Tehnoetic provided patches for initial support in Replicant 4.2. For Replicant 6.0, I went a different way and backported the necessary changes from the 3.4 Linux kernel to the kernel for the Galaxy S2 and S3. Such dongles are now operable with these two devices. Fil Bergamo is working on scripts to make it easy to use WiFi adapters. You can find more information in this forum thread.

Graphics rendering

The previous blog post already metioned that I’m working on the graphics acceleration. Mesa llvmpipe can now be used as an alternative to the Android software renderer. Unfortunately, llvmpipe is still too slow and the Android software renderer stays the default graphics renderer for now. But it’s possible to use some more apps like Firefox-based browsers with llvmpipe that wouldn’t work with the Android software renderer. Llvmpipe also makes it possible to use a recent webview. For now, Replicant 6.0 is stuck with the last webview version that worked with the Android software renderer. Optimizing llvmpipe for ARM likely would make it fast enough. Any help in this regard would be greatly appreciated!
Another long-standing issue is related to the software rendering: QR code scanning or in general barcode scanning didn’t work with Replicant because the software renderer requires a camera preview format that is incompatible with barcode scanner apps. I was able to fix it by doing the neccessary conversions of preview frames that are requested by barcode scanner apps.

Toolchain

I moved the build system from Debian Jessie to the upcoming Debian release with the codename Stretch. The Debian Android Tools team has packaged quite a few more build tools in Stretch which can now be used instead of prebuilt binaries from the default Android toolchain. The whole effort makes the Replicant build process more trustworthy and ensures that all build tools are verifiable and built using only free software.

Security/privacy enhancements

Besides fixing various bugs, I’m especially committed to making Replicant more secure. Originally, I started contributing to Replicant by submitting patches for known security issues in Replicant 4.2. Security updates for the kernel and the Android system are included in Replicant 6.0 as quickly as possible, but delays can always happen due to various reasons. Furthermore, I started to include some security/privacy enhancements from CopperheadOS.

Current work and future plans

Porting Replicant 6.0 to more devices is a priority right now. Besides devices that are already supported by Replicant 4.2, some new targets are evaluated. An interesting target is the LTE variant of the Galaxy S3 (GT-I9305). Currently, only the non-LTE variant (GT-I9300) is supported by Replicant and Replicant doesn’t support any 4G-enabled phone yet. It’s possible to build a Replicant 6.0 image for the LTE variant, but it lacks support for the modem. The main task of the port will be to write a free implementation of the modem interface for telephony, SMS and mobile data.
I also played with the mainline kernel on the Galaxy S3 and I was able to boot Replicant 6.0 on top of the Linux 4.8 kernel with a few patches so that it was usable with very limited functionality. I will share more results from this endeavor in the future.
Replicant is based on CyanogenMod 13.0. As the CyanogenMod project was discontinued, future Replicant 6.0 versions will be based on its successor, LineageOS 13.0.