Revamping an old Android phone with Custom Rom

Moving to Android on an outdated phone

Recently I have decided to transition into a new career opportunity as a customer engineer at Google. This has implications on my main daily drivers, i.e. laptop and phone. While Google does give me the choice to continue to work on a Mac, I am planning to embrace ChromeOS for a change. For mobile however, the direction is clear: I will move back from iOS to Android with a Pixel device. This in itself does not really pose a problem for me - I have used Android devices in the past and been very happy with the Samsung Galaxy S10, for example. The only challenge I needed to overcome now is that I will have to return my current company iPhone before I will receive my Pixel - and I will need a phone to migrate some apps without full cloud storage, e.g. for banking authentication.

Choosing the Custom Rom route

Since purchasing a flagship phone for 2 months did not sound like sound investment advise, I decided to repurpose an old Android phone still sitting in a drawer at home. Usually I don’t keep old tech around, trying to give it a chance for second life via ebay or rebuy. This particular device, a Pocophone F1, however, could not really be sold because it is not without its quirks. The display glass was broken at some point and I had replaced it by myself. Since then, the “Volume UP” button did not work properly anymore, and the display would freeze on occasion. Other than that however, it is still working fine. Since this is a device from 2018, the last supported OS Version was Android 10. Being a fan of stock Android and also living in 2022 with its more up-to-date security patches, I decided to look into Custom Roms that support this device. My requirements were Android 12 + stock experience. I quickly came across the great Pixel Experience project, which looked almost like what I was looking for. Digging a little deeper, I found PixelOS, which was based on the aforementioned Rom, and had some additional features like Face Unlock with the Poco’s infrared sensor. It is also actively maintained, so the rom selection was done.

Unlocking the bootloader

Lucky enough, Xiaomi (the company behind the pocophone) does allow bootloader unlock, which is a prerequisite to flash custom roms on an Android device. Sadly however, their official tool is only available for Windows. I have tried some unmaintained solution for Mac, which I am not linking here due to it not working… In the end I had to borrow my sister’s laptop for the unlock. I had to jump through some additional hurdles, like choosing a specific USB-cable and using a USB 2.0 port. At some point however, I got the PC connection working in Fastboot mode (powering the phone up with “POWER” and" “Volume-DOWN” pressed at the same time). For some reason, Xiaomi makes you wait for multiple days after the initial unlock request. A week later however, a success message appeared and the bootloader of the Pocophone was unlocked!

Flashing the Custom Rom

After unlocking the bootloader, the whole phone is reset and everything has to be set-up from scratch. The full set-up instructions for the device can be found on the Pixel Experience instructions page - just replace the PixelExperience rom with the PixelOS rom to imitate my approach. I mostly followed this process, downloading the Google platform tools for Mac and running the terminal commands directly from the downloaded folder instead of adding them to $PATH. I will therefore only document the changes I had to make to the original instructions to get this working, since pressing the “Volume UP” button was no longer possible on my phone after the display repair. In fastboot mode, the phone can also be booted into recovery by sending a command like

./fastboot reboot recovery

Since this particular command did not work on the Pocophone, I had to directly boot from the provided recovery image:

./fastboot boot recovery-beryllium-20220614.img

From here, I could continue to follow the documented process and flash the custom rom as documented via

./adb sideload PixelOS_beryllium-12.1-20220613-1525.zip

Afterwards, the phone booted successfully and let me set up my new Android 12 experience with my own credentials and new features!

Passing SafetyNet with Magisk

One problem was remaining however: the phone detected I had root access after installing the Custom Rom, which does prevent certain sensitive apps (like for banking) from running properly. To fix this issue, a tool called Magisk can be used. Again, I am following the official installation instructions with the caveat of booting into recovery via a temporary image like before. There are other instruction methods documented online, but these have been marked deprecated by the developers and should therefore not be used anymore. The boot.img file can be extracted from the custom rom image with a free tool like “Unarchiver” on Mac. After it has been patched on the device itself and pulled back to the laptop as per the instructions, it can be flashed back onto the phone like the initial recovery:

  ./fastboot flash boot magisk_patched-25100_XSPwG.img

Now there are only very few settings that have to be adjusted within Magisk to successfully pass the Android SafetyNet requirements (which can be tested with a free tool like YASNAC, by the way). I was following this video on YouTube but will briefly summarize the main adjustments here. In the Magisk app, open the “Settings” and look for the toogle named “Zygisk”. Activate this, activate the toggle to enable “DenyList”, and tap to configure the “DenyList”. In this list, search for and expand “Google Play Services” and switch the toggles for “com.google.android.gms” and “com.google.android.gms.unstable”. Go back and reboot your phone. For me, this was sufficient to pass all SafetyNet requirements and successfully use all apps I have downloaded from the Google Play Store so far!

All this effort for a temporary phone?

Yes… because I can :-)