In September 2017 a security hole concerning Bluetooth was discovered in Android and published under the name “BlueBorne”. Unfortunately Sony decided not to provide any updates for the Xperia Z3 Compact anymore, as the device was already too old after nearly 3 years on the market (also see my other post about this).
Fortunately there was an inofficial port of LineageOS 14.1 based on Android 7.1, in which also the Bluetooth security hole was patched. However this version had the issue that the Bluetooth connection was temporarily lost very often. For using my smartwatch this was not a big deal as the connection was only lost for a few seconds and returned automatically, so the general usability of the smartwatch was not really affected. However for using my Bluetooth headset this problem was more than annoying – for example when I wanted to listen to some music during a journey in a train and the playback was just interrupted suddenly. Therefore I looked for an alternative and found CarbonROM. Compared to LineageOS, CarbonROM is not an inofficial port but a ROM which is officially customized to the Xperia Z3 Compact and gets updates on a regular basis.
Installation
The installation is mostly identical to LineageOS:
- Unlocking the bootloader
- Installation of Team Win Recovery Project (TWRP)
- Backing up the current data
- Wiping the internal memory
- Installation of CarbonROM
- Optional: root access
Unlock the bootloader
Unlocking the bootloader is possible using a service by Sony. Also see the this page in the developer area of Sony. Just be aware that you will loose the DRM keys needed for some Sony specific features, like the algorithms to optimize the pictures taken with the camera app by Sony. For me this is not a problem, since I use “OpenCamera” as an alternative anyway, which also takes very good pictures.
To do the unlocking you need a connection via USB in fastboot mode. You can activate this mode by turning off the device and then holding the volume down button pressed while connecting the device to the PC using USB. Beside the command line tools from the Android SDK (version 26 or older may required, as newer versions may not work properly for this purpose) there is also a driver for Windows required, which you can get from Sony. To install this driver in Windows 10 you need to turn off the driver signature verification, otherwise the driver can’t be installed. You find a tutorial how to do this you at HowToGeek.com.
To get the device recognized in fastboot mode, you need a driver from the Android SDK. You can download the version I used here as well: fastboot driver as ZIP file.
Installation of TWRP and CarbonROM
After you have successfully unlocked the bootloader you can continue following the tutorial at the XDA forum. I recommed not to use the version of TWRP from the tutorial, but the version 3.1.1 as mentioned in this post at XDA. Older versions of TWRP may not be able to install the custom ROM because the installation script which checks the compatibility with the device may fail.
Version 3.1.1 can also be installed in the FOTAKernel partition and usually does not get overwritten by a custom ROM. After you have downloaded the version from the link above, you unpack the ZIP file and then install the recovery images with the following command:
fastboot flash FOTAKernel twrp-3.1.1-0-z3c_V02.img
After this step the USB connection has to be disconnected again. TWRP can then be started by holding the volume down button and then turning on the device. The status LED will flash once in a kind of pink color to confirm that TWRP is active. You have to keep the volume down button pressed until TWRP starts but at least until the status LED is glowing.
Important: You should backup the old system in TWRP before you wipe the internal memory if you want to return to that system later!
I did not use the latest version 6.1 of CarbonROM, which is only available as weekly build. Instead I use the archived (stable) release version 5.1 of January 2018, which is still based on Android 7.1.2. You can get this version at the following address: https://basketbuild.com/devs/CarbonROM/.OLD/Nougat/z3c (CARBON-CR-5.1-MOO-RELEASE-z3c-20180131-0646.zip). If you like to try out the latest features you can also use the current version from https://get.carbonrom.org/device-z3c.html, which is already based on Android 8. However you should be aware that some hardware features and system functions may not work yet with that version.
Before installing CarbonROM you should wipe the internal memory completely in TWRP to avoid problems due to residues of the old system. This is also neccessary if you already have used LineageOS! For this step you have to be patient – formatting the system and cache partition may take a couple of minutes. This step is only needed once. Further updates of CarbonROM can then be installed without a complete wipe.
After CarbonROM has been installed, the first reboot takes a while. However in my experience further reboots are then much quicker as with the original ROM.
If TWRP is afterwards not be accessible any longer using the method described above, you can just install it again in the FOTAKernel partition using as described in fastboot mode without loosing any data.
In contrast to LineageOS the installation of Google Play might not be neccessary. If you should need a package nevertheless, you get a copy it at http://opengapps.org which can be installed using TWRP. The required variant is ARM and Android 7.1. I recommend the “nano” version which only contains the minimal required stuff and those apps which can not be installed afterwards using Google Play. If you need apps like Google Maps etc. you can just get them via Google Play.
Root access with Magisk
At this point I had a description about SuperSU in the past. However this tool is not open source and the “SafeyNet” test by Google would not work as well as it has to modify the /system partition to provide root access.
The recommended way now is to use the free solution Magisk. You will find the sources at Github as well as the official releases. This tool can be installed via TWRP as well and in addition to root access it also offers numerous modules for expanding the system.
Also see the official thread at XDA and the website of Magisk.
The big advantage of Magisk is that it provides “systemless root”, which means the /system partition does not need to be changed. By using the module “MagiskHide Props Config” you can also change the fingerprint of the device to get a valid “SafetyNet” check, if required.
Note: if you want to switch from SuperSU to Magisk, it is not enough to only remove SuperSU. You also have to re-install CarbonROM to get a “clean” system without any root modifications. The existing data and apps can be preserved, since a full wipe is not needed – just install CarbonROM again and Magisk afterwards.
Experience in every day use
Very positive: all hardware components are supported, even the camera button which can be used in OpenCamera to focus and take pictures.
A real improvement is the Bluetooth support. Connection losses as I experienced them in LineageOS multiple times a day don’t occur in CarbonROM any longer.
Another convenience are the additional settings in “CarbonFibers”. This allows to customize many elements of the user interface and also the behaviour of the hardware buttons or the notification LED.
This is completed by the included extension “substratum” which allows to customize the look of the whole interface or single elements of it – in Android itself but also for single apps.
The only feature which makes no sense to use is the online update as TWRP can not be started directly by CarbonROM due to the way TWRP is installed on the Z3 Compact. This would be needed to install the downloaded updates. But since you can always download and install newer versions manually I don’t see this as a big problem.
Speed and battery life are mostly identical to LineageOS. One battery charge usually lasts more than 24 hours and the device is quite fast.
Update March 2019: CarbonROM 6.1
Meanwhile I’ve been using version 6.1 of CarbonROM, which is based on Android 8.1.
Before installing it I did a full wipe in TWRP, so the previously installed apps had to be restored from the backup in Titanium Backup.
For the installation TWRP 3.2 was required, since with older versions the device validation for CarbonROM did not work properly. The GApps package was installed in TWRP directly after CarbonROM without booting the system – otherwise it may happen that Google services will not run properly.
Bluetooth and WiFi work fine so far. Also the camera button works in OpenCamera.
With this version it is now also possible to install system updates using the update function. The only limitation is that opening the Magisk Manager app in the system settings does not work. However this is not a big problem as the app can still be opened in the launcher and Magisk itself works fine.
Weblinks
Bootloader-Unlock in the Sony Developer World
Drivers by Sony (updated 2018-08-23)
CarbonROM 5.1 for the Z3 Compact
CarbonROM 6.1 for the Z3 Compact
Have you managed to use android pay with the nfc on carbon rom?
It worked once for my with CarbonROM 6.1 and PayPal, but only until there was an update for Google Pay and then it started refusing payments. This is a known problem since Google Pay is quite picky about which devices and ROMs are considered secure enough to work on.I reinstalled everything a couple of weeks ago and use Magisk 19.3 where Google Play services are checked in “Magisk hide”. Now Google Pay also works fine with CarbonROM 16.1 :-)
Are you still using the Z3 Compact?
I’ve recently updated mine using this information but I’m having issues with WiFi range and Bluetooth glitches.
Yes, I still use my Z3 Compact with CarbonROM 5.1 and don’t have any issues with WiFi or Bluetooth. However it’s crucial that you do a full wipe before installing CarbonROM if you had another ROM installed before.
Hi Arno,
I thought xda-developers will give me enough support to go through flashing CarbonRom, still your post was much more helpful. Thanks a lot!
I am wondering if you are aware of a camera bug I cannot find all over the net: my rear cam is not showing an image all the way along whilst the front cam is working like a charm. The former rom, Lineage 14.1, did work though. Any ideas are highly appreciated =)
Cheers,
Simon
Some hardware may not work properly with the latest version due to missing or incompatible drivers. That’s why I’m sticking the stable 5.1. With that version I never had any problems with my camera or any other hardware (WiFi, Bluetooth, NFC – all works fine).
If you are already using CarbonROM 5.1 and the camera still does not work it may also help to do a complete wipe including the system partition and then flash the ROM again.
Hi
Thanks for this very detailed guide!
I have just installed the 8.1.0 CarbonROM from 12juni2018.
But my hardware buttons are not recognized very well. Or at least the camera button is “dead” now.
I know you chose to use the older Android version, but maybe you upgraded later ;) Do you ave any idea why that is or what I might try to regain that button?
Oh, maybe you might throw some advice on another thing that bugs me, playing with flashing this mobile … I am unable to make backups with Nandroid/TWRP. I connect and run it with “adb backup -f … –twrp data system boot or whatnot.”
Or boot to recovery and start it from there. Whichever I try, will end in a timeout of some kind and the red message “e: recv error on uevent”
Sorry, if things don’t work on newer versions of CarbonROM, I can’t help you. I use the older version just because of these problems.
With backups I never had a problem in TWRP itself with the SD card as target. I don’t use ADB for this. Usually I mostly just use Titanium Backup for my apps and data.
Thanks for responding.
I’m trying to change the twrp version I have, to the one you’ve used, but it seems that https://eu.dl.twrp.me/z3c/ only holds even older versions.
I can only find 2.8.7.0 / 3.0.0 / 3.0.1 / 3.0.2-1 (Mine claims to be 3.2.1-2, and it’s not capable of anything useful, backup doesnt work and it hangs indefinitely whan I enter the “install” menu option)
Would you happen to know *where* I could get the 3.1.1 these days to try that out?
Don’t waste time – I found it 3.1.1 , and it DOES seem to allow “install” on my device. I have no clue why 3.2.1-2 acted so strange 8-}
https://forum.xda-developers.com/showthread.php?t=3557606
I’m here just to thank you for such a clear step-by-step instructions! Switched from stock .291 to latest “stable” Carbon 5.1. It’s a new life for my phone, runs much faster than before.
People should be aware that by unlocking device (fastboot -i 0x0fce oem unlock 0x….) you will erase all internal memory (except /system), not only /data as on regular wipe, so your photos/etc will disappear (wich I don’t undestand why)… Wasn’t a problem for me since I always do backups.