In a previous guide I told you about LineageOS + microG, and in this one I will give you a quick overview on how to flash your device.
⚠️ If you haven’t already, this guide will go through unlocking your boot loader, which will erase all data on your phone.
⚠️ This might void your warranty.
ℹ️ This guide does not apply to Samsung devices as they don’t use fastboot.
Getting the recovery and the ROM
First, you need to download TWRP recovery for your device from https://twrp.me/Devices/ and then download LineageOS + microG for your device from https://lineage.microg.org/ (or just use the plain LineageOS if that’s your thing or you want to flash Gapps later).
Getting the tools
sudo apt install android-tools-*
On Ubuntu this is super easy with a single command and the recommended OS, check the official Android documentation for other systems here https://developer.android.com/studio/releases/platform-tools
Allowing OEM unlock
To unlock the boot loader, we need to allow this first. While inside Android, go to Settings > About phone and find software info stating the “Build Number”. Tap the number text about 5 times or more until it says “You are now a developer”. Now find the developer settings on your phone and enable boot loader unlocking. It might be called OEM unlock.
Unlocking the boot loader
⚠️ This might void your warranty.
⚠️ This will erase all your personal data.
Now, turn off your phone and start it up while holding power and volume up. This will get you into fastboot mode.
Now, plug the device into your PC using its official (or compatible) USB cable and open a terminal. Inside you will want to type:
fastboot oem unlock
Continue on your phone, and confirm the unlock by navigating with your volume buttons and confirming with your power button. Wait for it to wipe your data. Afterwards it will likely boot up into Android. Shut down the device and start it up again while holding volume up and power, to get back into fastboot mode.
Flashing the custom recovery
Now that we’ve unlocked the device, you will want to flash the TWRP recovery image.
fastboot flash recovery Downloads/twrp-*-devicename.img
Now using your volume buttons you should be able to navigate into an option to boot into recovery. Choose it with the power button (pressing it once).
You should now be in the TWRP recovery.
Wiping the phone
Now that you’re in the TWRP recovery, it might show you a warning. Swipe right to allow modifications. You should see a main menu with options.
Choose Wipe > Format Data (this will wipe your internal storage and remove current encryption)
Press the home button and choose Wipe > Advanced Wipe
Select Dalvik, Cache, Data, Internal Storage and System and swipe right to wipe. Note that this will “break your phone” until you flash a system back onto it.
Flashing LineageOS + microG
Now press the home button again and choose Advanced > ADB Sideload
On your PC you will want to execute:
adb sideload Downloads/lineage-*-microG-devicename.zip
Wait for it to complete.
Once done, press on Home, choose Reboot > System and if asked to install TWRP related things, DO NOT INSTALL.
Now wait for it to boot up and set up your phone as usual.
Encrypting your phone
Now you will want to enable encryption again.
Go to Settings and search for “encrypt” using the search function. Find the setting to encrypt your phone and do it. Make sure the device is sufficiently charged and plugged in.
That’s all there is to it! You might want to learn about F-Droid, which comes pre-installed.
Check out my previous posts!