Old smartphone hardware with Android 13: my custom ROM journey
Background information

Old smartphone hardware with Android 13: my custom ROM journey

Martin Jud
12.5.2023
Translation: Megan Cornish

For the past three months, a cheap, four-inch smartphone has been my daily companion. It has an old processor from 2018 and runs on Android 11. More precisely, it ran on it until recently. Because I’ve successfully updated it to Android 13.

I wanted the smallest possible smartphone. Because small phones are virtually impossible to find these days, I bought a cheap new one with old hardware. And I’m happy with it so far. The way I use it means that I can even cope with little power – it has a MediaTek Helio P22 processor from 2018. But one thing really bothered me about the KingKong Mini 2 Pro. Manufacturer Cubot only provides it with Android 11 and doesn’t offer updates to a newer version, but I want the 13th edition of Google’s operating system.

This article is about custom ROMs and the amount of preparation and installation required to add them to an Android smartphone. Custom ROMs are modified versions of the free Android operating system developed by Google that can breathe new life into an old smartphone.

If you want to find out more about my mini phone and my initial struggle with its small keyboard, you can read the article below.

  • Background information

    Is a four-inch smartphone too small?

    by Martin Jud

Caution: it could void your warranty and be time-consuming

If you install a different operating system to the pre-installed version on a PC or notebook, you won’t affect its warranty. This isn’t the case for most Android smartphones because you have to unlock the bootloader to even install an alternative OS. The bootloader is responsible for loading the operating system into the memory when the device is started up. Unlocking it removes the restriction that only allows software by the smartphone manufacturer. However, unlocking most phones will void some or all of their warranties.

I can get over the loss of warranty on my smartphone, which only cost me 96 francs/euros including delivery. Otherwise, an alternative, manually installed Android version is recommended, especially for older devices that no longer receive (security) updates. Generally speaking, you should come to this project with patience and time and expect something to go wrong.

At worst, you’ll no longer be able to use the smartphone. At best, you’ll have fun from the start and be able to celebrate after successful installation. With a little reading and good preparation, installing a custom ROM isn’t impossible. If you have the will and the desire to do it, you’ll (probably) manage it.

Finding suitable custom ROMs

The first – and often the best – place I go for questions about alternative ROMs for Android is the XDA Developers forum. Among other things, the developer community provides a number of custom ROMs for specific smartphones. If I had a Pixel 5, for example, I’d be able to look through a separate subforum and find suitable alternative Android versions.

You can find customised Android ROMs for a number of smartphones online. One of the best-known distributions is LineageOS (formerly CyanogenMod). If you get a customised ROM and don’t make any mistakes when installing it, the result is a smartphone that works well with its new OS. That’s because a developer or development team has sacrificed their free time to adapting the drivers and apps specifically for your device.

But what if there’s no custom ROM for your smartphone? I can’t find a custom ROM that’s been adapted for my Cubot KingKong Mini 2 Pro on XDA or anywhere else. But there’s one last chance: Generic System Image (GSI). A GSI is also a custom ROM, but it’s not adapted for a specific device.

The prerequisite for installing a GSI is that the smartphone comes with at least Android 8 and its bootloader is unlocked. Why Android 8? Because that was the first version to integrate Google’s Project Treble, which modularises Android and separates device drivers from the rest of Android. This makes it easier to update the smartphone software.

So, if you’re looking for an alternative Android version for a device for which there’s no specifically adapted custom ROM, use the keywords «GSI» and/or «Project Treble» in your search query. Alternatively, look in the corresponding Project Treble forum on XDA, where you can find various GSIs including the current Android security update.

Potentially suitable ROMs located: what to look out for before making a final decision

There’s actually at least one person who owns the same smartphone as me and supposedly already successfully installed Android 13 in September 2022. User orangestate posted a guide for the KingKong Mini 2 Pro in a thread about the KingKong Mini (without «2 Pro») in the XDA forum. A very useful one, as it turns out.

Thanks for the brilliant tutorial, orangestate!
Thanks for the brilliant tutorial, orangestate!
Source: Martin Jud

But for now, I’ll focus on the custom ROMs mentioned in the same thread and take a closer look at two of them. The first is LineageOS, whose developers unfortunately don’t offer a GSI version. However, there are a number of other nice people who have taken care of porting it. For example, AndyYan offers a TrebleDroid-based version of LineageOS 20 (Android 13).

While trawling through the KingKong Mini thread, I also came across LeOS. It’s an Android version that comes without any Google apps or services. LineageOS is similar, but it gives you the option of installing Google apps, including the Play Store and Google Pay, fairly easily using a zip package.

How much Google do you want?

This made me stop and think. Hang on, what exactly do I actually want?

I asked myself:

  • Do I want to use all Google apps on my smartphone?
  • Are just some Google apps enough?
  • Can I do without Google completely?

I quickly realised that I wanted to keep a little Google (for now). Mainly because I want to continue using my purchased apps from the Play Store. And secondly because I haven’t really looked at which replacement apps I’d use for my handful of Google apps in the future.

Nik offers various Google app packages (NikGApps) on nikgapps.com which I could install later. The core package shown in the screenshot below is my idea of «a bit of Google». Only installing as much from Google as I need for the apps I use sounded good.

I’d like to see the package of Google apps and services outlined in red on my smartphone.
I’d like to see the package of Google apps and services outlined in red on my smartphone.
Source: Screenshot from nikgapps.com: Martin Jud

It meant that I could pull the apps I’m missing – Gmail, Maps and Chrome – from the Play Store and use them without any problems. Looking at the other packages, I have to smile, because I read that the whole raft of Google software communicates with servers hundreds or even thousands of times a day, which drains smartphone batteries much faster. It’s comparable to Microsoft’s Windows telemetry data.

Once I was aware of the normal amount of Google software, I was even more excited about a custom ROM. Would one charge soon be able to last more than a day?

Administrator rights: what’s needed for root access?

I also wanted to secure administrator rights, which is root access on Android. On a rooted smartphone, you can install apps with features that don’t work as well or at all without root access, such as good ad blockers.

The smartphone gets root access from an app that handles root management. Magisk and SuperSU are the main candidates for the job. Developer Chainfire stopped working on SuperSU in January 2018, but there are still a few current custom ROMs that come with a SuperSU root. The disadvantage is that not all root apps run with it.

So, I chose to rely on Magisk, which receives regular updates and also offers the option of installing a lot of useful modules. For Magisk to be installed, the custom ROM has to support read and write permissions for the system. I’ll explain more about root, installing Magisk and my favourite root apps in a separate article or two soon.

Important: before downloading a GSI, check your CPU architecture and partition layout

Before you decide on a GSI, to be on the safe side, you should make sure there’s a suitable version for your smartphone. For a GSI to run on it, it has to be designed for your smartphone memory’s CPU architecture and partition layout. There’s either an A and an A/B partition layout. A/B is supported from Android 7 (2016). There can be two sets of partitions in the system – i.e. a second set of boot, system and other partitions. This ensures that seamless updates are supported, meaning that updates can be installed while you’re using the smartphone. As a result, a smartphone only has to restart once after the update.

You can easily find the architecture and this layout via the Treble Info app. Once it starts up, it displays the following on my smartphone:

The Treble Info app tells you whether a GSI generally works. It also shows the CPU architecture (ARM or ARM64), the binder architecture and the partition layout (a or ab).
The Treble Info app tells you whether a GSI generally works. It also shows the CPU architecture (ARM or ARM64), the binder architecture and the partition layout (a or ab).
Source: Martin Jud

I could see that my device is generally suitable for Project Treble (GSI) and «system-arm64-ab.img.xz» tells me that it has an ARM64 architecture. If I click on Properties in the app, I’ll find that there’s also a 64-bit binder architecture. There are also ROMs where the binder architecture differs from that of the processor.

Equally important, the «ab» after the architecture of the system image name indicates there’s an A/B partition layout. If there was only an «a» there, I’d have to look for a GSI with an A layout. There are ROMs for A, A/B or both layout variants – for example in this recommended subforum of Project Treble by XDA.

LeaOS: my Android 13 GSI of choice

During further research, I came across LeaOS. I like it more than my first two candidates – which have confusingly similar names. So, I wanted to install it.

I was taking a risk with Lea, as there are no reports on whether it’s stable and error-free on my Cubot smartphone. But the GSI from developer AltairFR has everything I could want:

  • Android 13 based on the Android Open Source Project (AOSP) with the latest security update and developer patches
  • Available with or without Google apps (although unfortunately I wasn’t entirely sure upfront how much of Google is installed with this version)
  • Available with vndklite read/write permissions (I needed it for root access with Magisk)
  • Not available with SuperSU (that’s a good thing; I wanted Magisk)
  • Includes Trebledroid patches by Phh and thus additional system settings (one of which would be very useful to me, although I didn’t know that at this point)

AltairFR offers six variants of LeaOS for download. All versions are ARM64 and A/B ready, which suits my smartphone. So that I know which GSI to download, the developer has included abbreviations in the file names. The version I was interested in has «arm64_vgN» in its name. This stands for «ARM64 A/B vndklite read-write – Google Apps with no SU» – i.e. with read and write permissions as well as Google apps and without SuperSU.

Installing a new alternative Android

After downloading the LeaOS GSI, it was finally time to get down to business. I first had to remind myself what I needed, including how to go about using the Android Debug Bridge (ADB). The make it possible to use commands in the console to send data to the smartphone via a USB cable. It’s been years since I last did it, so a guide helped.

For my project, I needed a driver for my Cubot smartphone and the SDK Platform Tools with ADB.

Then I made sure my smartphone had the latest version of Cubot’s stock Android 11 installed. Also, I downloaded the image of the same version from Cubot.

Then I prepared the smartphone for the actual installation according to ADB instructions: I installed the SDK Platform Tools on the Windows computer. I went into the smartphone settings and selected the last item, «About the device». Then I tapped the build number seven times at the very bottom. This unlocked the smartphone’s developer options. Then I activated the USB debugging option in the settings under System > Developer options. The last thing I did was install the USB driver under Windows. Then I connected the computer to the smartphone. To test whether the connection was established, I entered the command «adb devices» in the console in the platform tools directory. That listed the KingKong as a connected device.

My smartphone about to lose its warranty.
My smartphone about to lose its warranty.
Source: Martin Jud

After that, I followed orangestate’s instructions which I mentioned earlier. In summary:

  • I unpacked the contents of the Cubot stock ROM so that the vbmeta.img, boot.img and recovery.img files were ready. I also downloaded another file called product_gsi.img here.
  • I entered an ADB command in the console that reboots the smartphone into the bootloader.
  • Once in the bootloader, I entered the command to unlock the bootloader. I acknowledged a warning before voiding the device's warranty.
  • I flashed the vbmeta.img, boot.img and recovery.img files with three more commands.
  • Then I switched to fastboot mode with another command.
  • Once there, I flashed the product_gsi.img file and then the image of LeaOS with a final command.
The final two commands to install the custom ROM.
The final two commands to install the custom ROM.
Source: Martin Jud

This was actually it. On top of that, I flashed a final file called lk_patched.img. This prevents Cubot from displaying in orange that I’m out of warranty when I start the smartphone. Since this only happens during the booting process, this step isn’t absolutely necessary. Nevertheless, I want to spare myself the message.

After all this, I restarted the smartphone and waited for Android 13.

How well Android 13 runs on the mini phone

Woohoo, it works! After restarting it, Android 13 greeted me and I could start setting up the smartphone as if I’d just bought it. After a while, everything was back to how it should be. Apart from the Play Store, Play Services and Android Auto, Google apps aren’t available after installation. However, I have to point out that the pre-installed calendar app from AOSP didn’t work for me. so I reinstalled the Google Calendar app from the Play Store.

It worked.
It worked.
Source: Martin Jud

Other than that, there were no other initial issues. Google recognises my smartphone without any problems and I can use my purchased apps – which isn’t always the case for smartphones with custom ROMs.

The apps run neither faster nor slower than on Android 11. This means that my KingKong is still slow in some apps and on longer websites. But the AOSP launcher from Android 13 and my preferred Smart Launcher 6 are smooth without no stuttering.

However, just one day after installation, I noticed that I had problems with my Bluetooth headphones. To be precise, I couldn’t hear anything, even though they were connected to the smartphone. I then looked for and found the solution in the new submenu in the settings called «Phh Treble Settings» – which is only reserved for certain custom ROM owners and home to the previously mentioned advanced settings by developer Phh. One of them is called «Bluetooth workarounds». I changed this option from «None» to «Mediatek».

Another stroke of luck – the Mediatek Bluetooth workaround made my headphone problem disappear.
Another stroke of luck – the Mediatek Bluetooth workaround made my headphone problem disappear.
Source: Martin Jud

After that, everything went smoothly. Music played perfectly from then on. Nevertheless, I gathered experience for three weeks before I started writing this. And yes, there’s one last thing I’m dying to share: the battery actually lasts longer than it used to – a lot longer. A day and a half instead of a day with normal use. I don’t know whether that’s because only part of the previous Google software is still available or whether Android 13 itself has become more efficient.

All in all, I’m very satisfied – the effort was worth it. And, luckily, when a newer version of LeaOS comes out, I won’t have to go through everything again. All I have to do is flash the new GSI over the old one.

My tiny phone will definitely not be the last one I breathe new life into. If you still want more after this slightly longer custom ROM journey, you won’t be disappointed. I’ll also be documenting my root journey. You’ll also soon find out what root allows you to do and which root apps have become virtually indispensable for me.

Header image: Martin Jud

55 people like this article


User Avatar
User Avatar

I find my muse in everything. When I don’t, I draw inspiration from daydreaming. After all, if you dream, you don’t sleep through life.


These articles might also interest you

Comments

Avatar