The world of custom firmware opens up unlimited possibilities for the smartphone owner that are not available in the stock system. CyanogenMod for a long time it remained the standard of stability and functionality, giving users deep control over the device. Installing this system allows you to get rid of pre-installed garbage, speed up the operation of the old gadget and get functions that the manufacturers did not implement.
However, the process of introducing an alternative operating system requires accuracy and understanding of the Android architecture. You have to interact with system memory partitions, change the bootloader and execute commands through the console. Any mistake at the preparation stage can lead to the phone stopping booting.
In this guide, we will analyze each step in detail: from obtaining superuser rights to the first boot in a new environment. Attention: you perform all actions at your own peril and risk. Before you begin, be sure to create a backup copy of all important data, as the process will inevitably lead to a complete wipe of the deviceโs internal memory.
Preparation of the device and necessary tools
Before you begin modifying the system, you need to collect a complete arsenal of software. You will need a computer with a Windows, macOS or Linux operating system, as well as a quality USB cable. It is critically important to download and install drivers for your smartphone so that the PC correctly recognizes it in ADB and Fastboot.
The next step is to download the firmware files themselves. You need to find the latest build CyanogenModcompatible with the codename of your device (for example, hammerhead for Nexus 5 or jflte for Galaxy S4). You will also need a file with application packages Google Apps (GApps), since Google services are not built into pure CyanogenMod builds for licensing reasons.
โ ๏ธ Attention: Make sure that you download GApps that match the version of Android in the firmware. Installing the Android 6.0 package on Android 5.1 firmware will result in a cyclic reboot (bootloop).
Don't forget to enable USB debugging mode on the phone itself. To do this, go to Settings โ About phone and click on the build number seven times to activate the developer menu. Then in the section that appears, check the box next to "USB Debugging".
โ๏ธ Ready for firmware
Unlocking the bootloader and obtaining root access
Most modern devices come with a locked bootloader (Bootloader), which prohibits the installation of unsigned system images. The unlocking procedure differs for different vendors: on Nexus and Pixel devices this is done with one command, while on smartphones Sony or Motorola you need to obtain a special unlock code from the manufacturer's official website.
First, put your smartphone in Fastboot mode. This is usually done by turning off the phone and then pressing the button combination Volume Down + Power. Connect the device to your computer and open a terminal or command line in the platform tools folder.
adb reboot bootloader
After entering bootloader mode, enter the command to unlock it. On devices with pure Android it looks like fastboot oem unlock or fastboot flashing unlock for new versions of Android. The phone screen will warn you about the loss of warranty and data deletion - confirm the action with the volume buttons.
Nuances of unlocking Samsung
On Samsung devices, the procedure is different: instead of Fastboot, Download Mode is often used, and unlocking the bootloader may require resetting the Knox counter, which irreversibly blocks the operation of Samsung Pay and the protected folder.
After successful unlocking, the device will automatically reboot and reset to factory settings. Now you need to install a custom recovery, for example TWRP (Team Win Recovery Project). This is a special recovery environment that allows you to install unverified zip archives and make full backups of partitions.
Installing custom TWRP recovery
Stock Recovery menu has limited functionality and checks the digital signature of firmware, not allowing installation CyanogenMod. Replacing it with TWRP is a mandatory step. Download the image file twrp.imgdesigned specifically for your smartphone model.
Switch the phone back into mode Fastboot and connect it to the PC. Enter the command to flash the recovery image into the appropriate memory section:
fastboot flash recovery twrp.img
Important point: after executing this command, you cannot immediately reboot the system in the usual way, otherwise the stock recovery may overwrite the custom one. Immediately, using the volume buttons to navigate, select the mode Recovery and press the power button to confirm.
โ ๏ธ Attention: If after flashing TWRP the phone booted into a normal system, then the stock recovery was restored automatically. Repeat the procedure and immediately enter recovery mode without waiting for Android to fully load.
In the TWRP menu you will see a touch interface. First of all, it is recommended to go to the settings (Settings) and disable signature verification (Disable Signature Verification) to avoid problems when installing modified kernels or firmware.
Make a full backup (Nandroid Backup) in TWRP before installing the firmware. This will save an exact copy of the current state of the system, which can be restored in a couple of minutes in case of failure.
The installation process of CyanogenMod and GApps packages
Now comes the most crucial moment. Copy the files cm-xx.x-nightly.zip and gapps.zip to the phoneโs internal memory or SD card. In the TWRP menu, select Wipe (Cleanup), then Advanced Wipe.
You need to format the following partitions: Dalvik / ART Cache, System, Data and Cache. The Internal Storage section does not need to be touched, otherwise you will delete the firmware files themselves. Swipe to confirm cleaning (Swipe to Wipe).
| Memory section | Purpose | Need to be cleaned? |
|---|---|---|
| System | Contains operating system files | Yes (required) |
| Data | Custom applications and settings | Yes (required) |
| Cache | Temporary system files | Yes |
| Dalvik / ART | Application optimization cache | Yes |
| Internal Storage | User files (photos, firmware) | No |
After cleaning, return to the main menu and select Install. Find the archive with the firmware CyanogenMod and add it to the installation queue. Do not click the confirm button right away - add the archive with GAppsas the second file. Only after this, swipe to start the installation.
The process will take from 3 to 10 minutes depending on the speed of the flash memory of your device. In the installation log you will see messages about mounting partitions and unpacking archives. Upon completion, a button will appear Reboot System.
First download and initial setup
The first launch after installing custom firmware always takes longer than usual. This is due to the fact that the system ART optimizes all applications for the new environment. The logo CyanogenMod can hang on the screen from 5 to 15 minutes - do not panic and do not try to forcefully reboot the phone.
After loading, you will be greeted by a welcome screen with Cyanogen's corporate style. The setup wizard will prompt you to select a language, connect to Wi-Fi, and configure privacy settings. You will notice that the interface differs from the stock one: there are no unnecessary graphics, and the settings menu is structured more logically.
Be sure to check the operation of the basic functions: calls, mobile data, camera and Bluetooth. In rare cases, additional patches or fixes may be required, which are installed in the same way as firmware via TWRP. If the sound is too quiet or the microphone does not work, look for specific mods for your model.
โ ๏ธ Attention: Menu interfaces and item names may differ in different versions of CyanogenMod. If you do not find the setting you need, use the search in the options menu or check the documentation for a specific nightly build.
Possible problems and methods for solving them
Despite careful preparation, errors may occur. The most common problem is Bootloop (cyclic reboot). If the phone constantly reboots at the logo, go to TWRP and try doing Wipe Dalvik / Cache, and then flashing GApps again.
If the device turns on, but the touch screen does not respond or does not work correctly, you may have installed firmware that is not intended for your screen revision or model. In this case, only returning to the stock firmware via Fastboot or restoring from a previously made backup will help.
Problems with the network (lack of IMEI or base station) are often solved by flashing the modem (baseband). The modem file is usually supplied separately for devices using Qualcomm chipsets. It must be installed before flashing the system itself or immediately after cleaning the partitions.
The stability of custom firmware depends 90% on the correctness of the selected recovery version and compliance of the GApps version with the Android version.
Frequently asked questions (FAQ)
Is it possible to return the stock one firmware after installing CyanogenMod?
Yes, it is possible. You will need to download the official firmware image (Factory Image) for your device from the manufacturer's website. Unzip the archive on your computer, put your phone in Fastboot mode and run the firmware script (for example flash-all.bat for Windows). This will completely return the device to its factory state, but will lock the bootloader again.
Will Root access work immediately after installation?
In older versions of CyanogenMod, root access was built into the developer settings. In new builds (and in the successor to LineageOS), you need to separately download and flash the archive via TWRP with superuser rights, for example Magisk or SuperSU. Without this step, applications that require root will not work.
Why does the camera or flashlight not work?
Custom firmware uses standard drivers that may not interact correctly with the proprietary camera software of a particular manufacturer. Try installing a Google Camera (GCam) port customized for your processor. This often solves problems with photo quality and flash performance.
Is it safe to use banking applications on CyanogenMod?
No by default. Banking apps see an unlocked bootloader and root access and consider the device to be compromised. To get around this, you need to hide root through the Magisk settings (Magisk Hide) and possibly change the system fingerprint, replacing it with a certified Google one.