Security Alert(2018-01-18): Please follow the advice ofBOb (see comment section below) and use the latest version of LineageOS, as severe security flaws have been fixed since I originally wrote this blog article!
(I won’t update this article though as it represents a snapshot of the installation procedure at the time of writing.)
I’d like to „briefly“ share my experience I had when I tried to install the Custom ROM „LineageOS 14.1“ (the successor to CyanogenMOD after the developers closed their business) on my Samsung Galaxy S4 mini (GT-I9195).
I don’t take any responsibility for the things you do with your phone! Do it at your own risk!
It took me easily a whole day to find out all the things I wrote down here, so be patient, don’t loose your mind if something doesn’t go as planned. What also takes a lot of time is the search for the correct Stock ROM for the case you break anything. In my case I have a Swisscom branded Galaxy S4 mini. This maps to the type „serranoltexx“ (basic type) and the Stock ROM file SWC-I9195XXUCNK1-2014120315311.zip. You can find out more about the Firmware Code Convention and the Version Numbers and possible rooting of the Stock ROM by CF-Auto-Root (XDA-Thread).
Why did I decide to try that in the first place?
Well, I wasn’t satisfied with the stock Android 4.4.2 anymore at all. After getting quite clogged up it became very slow and sometimes terribly unstable, like during a whole week the System.UI application would crash every time I wanted to change apps.
Lessons learned about the Samsung Galaxy S4 mini
- Samsung doesn’t like you to tamper with the firmware of their phones, AT ALL! So they made it especially hard to change anything. Every Android device has several systems and thus partitions to boot into. These are at least
- the normal Android system partition of your every day OS.
- the recovery partition that allows you to perform emergency actions like clearing the systems caches and resetting the phone to factory state.
- Access it by either holding the HOME+POWER+VolUp buttons before the Samsung logo is displayed when starting up, OR use the ADB command „adb reboot recovery“ when you have enabled ADB debugging in the developer menu and connected the phone via USB to your computer.
- The stock recovery system doesn’t allow you to make complete backups of the whole device or overwrite the system with a custom OS, so we need to replace the recovery partition with a custom one that allows us to do so.
- The two most popular custom recovery systems for this purpose are ClockWorkMod (CWM) and Team Win Recovery Project (TWRP).
- I had no luck trying to install TWRP. With every version I found on the internet either the flash tool (ODIN) failed to transfer the image to the recovery partition or the phone would hang on booting TWRP.
- If you’re trying to install CWM, you’re going through hell, too – but eventually it works. There seems to be nowhere a repository that lists every image and version that is available for your phone.
- CWM does have an App called ROM Manager that should make the right choice of recovery image for you and installs it for you. The sad news is that a) the app needs root and b) the Galaxy S4 mini is not among the supported devices. Bummer. No luck here.
- Almost every web site that mentions CWM links to a subpage of theirs, but at the time I tried the Custom ROM install it wasn’t available. You might try it though: http://clockworkmod.com/rommanager
- Finally my workaround was to simply flash the recovery image that developers mention in conjunction with the Custom ROM. Don’t try to look for the latest CWM version somewhere else, you’ll drive yourself mad!
- As long as you have the stock system on your phone, every time it starts and detects that the recovery partition has been altered it reflashes it with the original stock recovery partition. So make sure that you immediately boot into recovery mode when you have flashed it. There seems to be a way to make it permanent though, but I haven’t tried it. My workflow was to simply boot to Odin mode (see below), turn off auto-reboot, quickly flash CWM to recovery, and then reboot to recovery using the
- the fastboot (for non-Samsung devices) or Odin (Samsung) partition
- Access it by either holding the HOME+POWER+VolDown buttons before the Samsung logo is displayed when starting up, OR use the ADB command „adb reboot fastboot“ (non-Samsung) resp „adb reboot download“ (Samsung) when you have enabled ADB debugging in the developer menu and connected the phone via USB to your computer.
- on non-Samsung devices the fastboot system allows you to overwrite every other partition, including the system and recovery partition. All you need is to connect your device via USB and use the fastboot tool of the Android SDK to flash your desired images to the devices.
- Samsung seems to dislike the thought that you could flash your system so easily, so they replaced the fastboot system with their own, locked down. They call it Odin mode and the administration tool that talks to that system is called Odin, too. I read that it was never meant to be released to the public but luckily it was leaked. Nowadays we find several versions of the tool on the internet.
- If all goes well the tool recognizes your phone when it’s connected via USB and display a message like <ID:0/004> Added!! in the log.
- Click „AP“ and choose the file that need to be flashed.
- Early versions of the Odin tool (like 3.09) use .tar files (not .img) directly
- More recent versions require you to provide signed packages with the .md5 extension. There is also a tool available that converts any image file to a .md5 package.
- In the options you might want to uncheck „Auto Reboot“ so the phone doesn’t reboot into the normal system immediately after the flash. You can then turn it off manually by holding the POWER button a long time, then start it into the mode you like (using the appropriate button combination mentioned earlier).
- Don’t change any other options!
- Click start to begin the flash process. Pray. If all goes well Odin will report „SUCCESS“.
- Copy the .zip file of the Custom ROM of your choice on your phones microSD card. (my choice: lineage-14.1-20170211-UNOFFICIAL-serranoltexx.zip)
- If you need some Google apps (which I assume you do, they are not included in the LineageOS ROM, especially the Play Store!), go to the Open GApps website and download the package that suits you most. Copy the .zip file to the microSD card as well. (my choice: ARM, 7.1, aroma)
- Reboot into Odin mode (hold down HOME+POWER+VolDown before the Samsung logo).
- Flash the recovery system that the developer of the Custom ROM of your choice provided. (my choice: recovery-clockwork-18.104.22.168-serranoltexx.tar.md5)
- Use the Odin tool (v3.09 for use with .tar and v3.12.3 for use with .tar.md5) to do it. Turn off autoreboot or be quick to press HOME+POWER+VolDown before the Samsung logo is displayed.
- DIRECTLY reboot into the freshly flashed recovery system (HOME+POWER+VolUp).
- Make a complete system Backup (also known as a NANDROID), save it to the external microSD card.
- Optional: reboot to normal system and transfer the backup to your computer. You’ll need to repeat the flashing of the recovery system.
- Perform a factory reset (otherwise the Custom ROM installer will fail).
- Choose „install ZIP from sdcard/sdcard1“ or the like. Locate the .zip file of the Custom ROM.
- DON’T reboot into the Custom ROM yet! We need to install the GApps first!
- You might have to reboot into recovery as in my case I couldn’t go back in the menu of CWM with the hardware buttons.
- Choose „install ZIP from sdcard/sdcard1“ and locate the GApps .zip file.
- Now you can reboot into the Custom ROM (simply turn the phone off and an as usual with the POWER button).
- The first boot can easily take 10-20 minutes. Be patient.
First impression after half a week of daily use:
- LineageOS 14.1 works very fluent! 🙂
- No major Bugs or crashes yet.
- Battery life is abysmal! 🙁
- Raiffeisen PhotTAN App crashes on setup.
- Camera might have a problem with focusing (needs more attention to confirm).
Tags: Android, Custom ROM, CyanogenMOD, Galaxy S4 mini, GT-I9195, Informatik, LineageOS, Odin, Samsung