Introduction
A custom ROM (aka aftermarket firmware) is a modified version of an existing operating system, that is not officially supported by the manufacturer of a device. Some custom ROMs are based on existing mobile OSs, like Android, and some are based on PC operating systems, such as Manjaro or Ubuntu. They’re different from devices that use stock firmware in that they can offer features and enhancements not found in stock versions of Android, do not contain bloatware, and do not depend on the devices manufacturer for software updates.
The most popular custom ROMs include LineageOS, LineageOS for microG, Paranoid Android, ProtonAOSP, GrapheneOS and CalyxOS.
Some custom ROMs, like GrapheneOS and ProtonAOSP, offer a WebUSB-based installer that is easier to use for most users, but in this guide, I will be covering the command-line based installation as it is the more traditional and universal approach to installing custom ROMs.
Warnings
- Unlocking the bootloader will reset your phone, so make sure you have all your data backed up!
- This process may void your warranty with some manufacturers.
- A modified device will trip the Play Integrity API (formerly SafetyNet Attestation API) which can cause some services like GPay to stop working.
- This will make your device vulnerable against hackers with physical access to your device, so do not unlock the bootloader on a device that you intend to carry state/company secrets on.
- Flashing a custom ROM can be risky and may cause unexpected issues or even brick your device. It is recommended to only flash a custom ROM if you are experienced with Android.
- Always use caution and read the instructions carefully when unlocking your device's bootloader or flashing a custom ROM. Improperly following the steps can cause irreversible damage to your device.
- Before flashing a custom ROM, make sure it is compatible with your device and check for any known issues or bugs reported by other users.
- If you encounter any issues during the unlocking or flashing process, do not hesitate to seek help from experienced users on forums or support channels provided by the custom ROM developer.
Tools
Parts
-
-
Now you just need to tap the Build number repeatedly, until you get a confirmation message saying "You are now a developer!". I already enabled developer options on my device, so I don´t need to do it again.
-
-
-
Plug your phone into your computer via the USB-C to USB-A Cable.
-
Pull down the notification shade and select Charging this device via USB.
-
Select the option File transfer/Android Auto.
-
-
-
Open the terminal application on your computer with the SDK Platform Tools installed and enter adb devices
-
This should trigger a popup on your device. Make sure to have the checkmark ticked and click Accept.
-
You can run the command again to check if it worked. It should now say device instead of unauthorized.
-
-
-
Enter the command adb reboot bootloader
-
Wait a couple seconds until your device rebooted into the bootloader, then enter the command fastboot flashing unlock
-
You should now see a prompt similar to the one shown in the picture. Use the volume rocker to choose the Unlock the bootloader-option and confirm by pressing the power button.
-
-
-
If your device rebooted after unlocking the bootloader, boot into the bootloader again by pressing and holding the power- and volume-down-button until the device has rebooted into the bootloader.
-
-
-
Download the TWRP Recovery for your device or the recovery that came with your custom ROM.
-
Enter the command fastboot boot [directory]\[filename].img and wait until your device has rebooted into recovery mode.
-
-
-
Download the OS image for the custom rom you want to install.
-
Enter the command adb sideload [directory]\[filename].zip
-
-
-
Download the GApps package you want to install.
-
Repeat step 10 to reenable ADB sideload.
-
Enter the command adb sideload [directory]\[filename].zip
-
-
-
This might take some time, but as long as the phone is not boot looping (repeatedly rebooting), everything should be fine.
-
To restore your device to its factory condition, follow these instructions with an OS image provided by your device manufacturer.