Flashing a custom ROM
Last updated : 15/2/2024
Intro
Here's a custom ROM flashing guide I've constantly relied on. However, this guide assumes that TWRP recovery is used, as I have 0 experience with other custom recoveries (if it's TWRP-based, hopefully they're similar).
This guide will work on most custom ROMs except for the likes of official Calyx & Graphene (and some non-TWRP-flashable ROMs such as LineageOS on Zenfone 6). Also, if you want to follow this guide on any other devices other than the ones listed in this guide, do at your own risk (or just don't & follow the Lineage wiki for your device, if & only if it's official LineageOS).
Pre-reqs (especially important when coming from encrypted ROM) :
- Backup your data & place the backups in the external storage. You can use Titanium, Migrate, Neo Backup (these 3 require root), and/or SeedVault (if available).
- Remove your SIM card, if it's attached. Skip this step if not.
- Remove lock screen security. This stops TWRP from asking for decryption password.
- Boot to TWRP recovery (or any other TWRP-based recovery of your choice)
If you haven't removed your lock screen security, TWRP will ask for the password to decrypt files.
- Enter Wipe > Format Data & type yes when prompted
- Reboot to recovery
- Skip the 2nd step of the flashing guide found below. Which guide to follow depends on your device.
A-only partitioned devices (Poco F1; LG V30; OnePlus 3[T])
- Place custom ROM in external storage, along with whatever else you're going to flash
- Boot to recovery with external storage attached to the device. If you come from the encrypted pre-reqs, start here.
- Go to Wipe > Advanced Wipe. Then, wipe Dalvik, Cache, System, Data. Some TWRP and/or devices (such as official TWRP for F1) has the option of wiping vendor, which is optional (since most F1 ROMs comes with OSV)
- Return to the main menu, select Install & browse to the external storage where you placed your ROM in. Flash it & wait until it's done.
For firmware updates on Xiaomi phones (such as the F1 here); flash them before flashing custom ROM.
- Reboot to system, and wait until it boots.
A/B 2SI (Poco X3 [N/P])
- Place custom ROM in external storage, along with whatever else you're going to flash
- Boot to recovery with external storage attached to phone. If you come from the encrypted pre-reqs, start here.
- In the main menu, select Install & browse to the external storage where you placed your ROM in. Flash it & wait until it's done.
For firmware updates on Xiaomi phones (such as the X3(N/P) here); flash them before flashing custom ROM.
- Reboot to system, and wait until it boots.
A/B partitioned devices (Pixel XL [Pie]; Mi A1; Mi A2; OnePlus 6 [without any repartitioning cruft]; Zenfone 6 [Pie, A10])
- Place custom ROM (or the full stock ROM for Zenfone 6, if using) & recovery installer zip in external storage
- Boot to recovery with external storage attached to the device. If you come from the encrypted pre-reqs, start here.
Zenfone 6 users coming from firmware updates will also start here, if using custom ROM.
- Go to Wipe > Advanced Wipe. Then, wipe Dalvik, Cache (cache option may not appear, so it's optional), & System (may cause issues, so it's optional). For some device and/or TWRP variants, there may be a "Vendor" option, which generally shouldn't be wiped.
- Return to main menu, go to Install. Browse to the external storage where you placed your ROM & recovery installer in, and flash both of them, in the order of ROM > recovery zip (or install recovery .img in Advanced > Install Recovery Ramdisk after flashing ROM if your preferred recovery isn't a flashable zip file).
Some TWRP variants (like this one) have its own TWRP survival script, rendering the recovery zip installation unnecessary.
Some ROMs have prebuilt TWRP (or other TWRP-based recovery), which allows you to flash only the ROM. In this case, recovery zip flashing is optional, but still possible.
If you prefer to hotboot TWRP with a PC & ADB commands, you may skip installing the recovery.
- Reboot Recovery. (If you installed a recovery zip on the previous step, ignore the first note below)
If you're not flashing TWRP, reboot to bootloader & boot TWRP using fastboot commands (this part requires you to connect your bootloader-booted PDA to a PC with adb/fastboot commands).
- Check the partition you're on. If you previously came from A, you should be on B & vice versa. However, if you're still stuck on the previously active partition, manually change partition in Reboot by selecting the other partition.
- Head to Wipe > Format Data, and follow instructions to wipe data. Alternatively, do a factory reset if your device isn't encrypted.
- Reboot to system, and wait until it boots.
My opinions regarding GApps
When it comes to GApps (Google's Play Services, Play Store, etc.), they are :
- A privacy hazard when allowed to connect to internet
One study claimed that a phone (running factory-stock Android / iOS) will send data to Google regardless of user interaction. However, the linked study (or perhaps most studies like this one) doesn't take some important things into account, such as:
- Does GApps-free AOSP ROMs (such as Lineage, Calyx, Graphene, and/or /e/) count in the research scope, since there was no mention of it whatsoever?
- Does the iPhone have Google-made apps installed, or any other apps with ties to Google (such as the Google-owned Waze)?
21/10/2021 Update : Found another research regarding Android privacy which finally included Lineage & /e/ (but no Calyx and/or Graphene), but the research still isn't perfect as the researcher flashed OpenGApps alongside LineageOS. (Link to research PDF)
- Oversized bloat with too much functions (including spyware)
Play Services makes Android works as it's supposed to be, but I'm not sure if I want to attach a well-known spyware just for the sake of using a mapping service (in this case, OSMAnd). The alternative (microG / UnifiedNLP) isn't as good either, since it can't read location as user-app, rendering OSMAnd useless.
- Capable of integrating themselves so well with the system, removing them can be hazardous to the system (I once ended up getting a RescueParty to recovery while attempting to debloat a Pixel ROM out of boredom)
- Play Services can be nutshelled as a rootkit / malware in Android.
For example, Play Services could silently install an app without the user's consent, as shown in this article (archive.org)
I don't recommend flashing GApps (unless you absolutely need to use it; but at that point you might as well flash a Pixel ROM), so I won't write a guide on how to flash them - you can search the internet for those guides. However, there are times where I had no choice but to rely on GApps to make apps work, such as in my "phone" phone, so take that as you wish.
Back to top
Index - cellphone
Main Page