Seiteninhalt Home / Know-How / LineageOS

Installing LineageOS 14.1 on Samsung Galaxy S5 (SM-G900F, klte)

Because of very positive feedback about the German version of this guide I have decided to translate it to English. This is the only English page on my German website.

Since there are no more official security updates anymore for my Samsung Galaxy S5 (used at Amazon Warehouse Deals) and the Samsung adapted Android 6.0.1 installed on it, I searched for possibilities to update it to a so-called Custom ROM, in this case LineageOS (formerly CyanogenMod).

Now I have "dared" and want to document everything in detail, because I had to learn that many previous tutorials are incomplete, partly wrong or just badly written. So it's another attempt to make an understandable explanation for a process that has been known for a long time.

For the update I used a Windows PC with installed Windows 10, current build 1703.

 

 

Preparations

  • Check very carefully on the smartphone if it really is the right version by looking at the Settings / Device information and searching there for the device name. Alternatively or additionally you can install the app "CPU-Z" and check under "Device" whether it is really a SM-G900F.
  • On the smartphone under Settings / Smartphone information: 7x tap on the build number to activate the Developer mode.
  • On the smartphone under Settings / Developer Options (now visible): Enable USB Debugging
  • On the smartphone under Settings / Security / Disable reactivation lock (is usually already done)
  • Charge the smartphone as completely as possible (just in case).
  • Perform backups for the most important app data, e.g. (prepare the smartphone carefully so that it can be completely deleted!):
    • Access points (APN) for Internet and MMS: carefully write down all data under Settings / Network Connections / Other Settings / Mobile Networks
    • SMS Short Message Center (SMSC): as a precaution search and write down this phone number under the settings of the SMS app
    • Contacts: Settings / Import/Export contacts as .vcf file, save to SD card
    • SMS: Export SMS Backup&Restore (Carbonite) to SD Card with the App
    • Threema: My backups: ID-Backup + PDF print out the barcode for later reading back of the backup; create data backup, save on SD Card
    • Whatsapp: save to Google Drive or copy the last (automatically or manually created) backup file to SD card
    • and possibly other important data manually, especially in the folder "data" of the internal memory (see also below "excluding storage" for backup with TWRP).

 

  • Download the required software packages to your PC:
    • Samsung USB driver (used here: version 1.5.51.0)
    • ODIN (used here: version 3.12.3), Flash software (important note 1: Please don't download anywhere else, there are also some unofficial versions; important note 2: Heimdall software, which has been described several times as an alternative, doesn't work in combination with the Samsung Galaxy S5 (SM-G900F, klte), I had to work for that painfully and time-consuming!!!)
    • TWRP for Samsung Galaxy S5 (SM-G900F, klte) (here used: version 3.1.0-1), alternative recovery software
    • Magisk as .zip file (used here: version 16.4, also contains the Magisk Manager), Root Software
    • LineageOS 14.1 for Samsung Galaxy S5 (SM-G900F, klte), build from September 13, 2017 corresponds e.g. to Android version 7.1.2
    • Gapps (used here: version arm-7.1-nano-20170918), compilation of required Google apps, here as version "nano" (comparison of the packages)

 

  • On the smartphone place the .zip files of Magisk, LineageOS, Gapps via USB connection on the external SD card.

 

  • Install the USB driver on the PC and restart the PC (as a precaution).
  • Create a folder on the PC and put ODIN in it as well as the TWRP .tar file.

 

 

Installing TWRP and unlock Root access

ATTENTION: Anything below this point will void the warranty. Surprisingly for me: The warranty expires already with the exchange of the recovery software. KNOX counter counts up irrevocably and is later displayed as "KNOX Warranty VOID 0x1 (2) recovery".

My original plan was to install lineage without root access. This is also described as a working option in some tutorials. In view of the fact that installing the TWRP already leads to the loss of the warranty (and a new recovery software is absolutely necessary), I did not consider the root access to be bad anymore. However, when I tried the installation without root access, I noticed that TWRP is always overwritten by the original Samsung Stock ROM. Probably this is due to the still "locked" bootloader. An "unlocking" of the bootloader on my S5 (SM-G900F, klte) is basically not possible to my knowledge (without root access).

An unlock of the bootloader was therefore not successful despite several attempts e.g. with adb (from the Android SDK Tools) and there is no proper manual for it especially for the Samsung Galaxy S5 (SM-G900F, klte, kltexx).

The following steps are:

  • Turn off the smartphone
  • Start the smartphone (not yet connected to the PC) in the so-called "download mode": simultaneously press Volume-Down (1) + Home (2) + Power (3): the smartphone starts with a warning message, confirm with Volume-Up to continue.
  • Connect now your smartphone to your PC
  • Start ODIN and check if there is an "Added" in the list field on the left as confirmation that the smartphone is recognized; in addition a green/blue field appears in the top left corner (if this is not successful there is a problem with USB access).
  • in ODIN, select the TWRP-.tar file in the "AP" field
  • under "Options" only "F.Reset Time" activated, also deactivate "Auto-Reboot"
  • start flashing the TWRP
  • Wait for success message; a blue progress bar runs on the smartphone
  • After the end immediately(!) start into the Recovery mode: press Volume-Up (1) + Home (2) + Power (3) at the same time, the smartphone now starts with the just flashed TWRP software (if you had started the normal system first, it would have been overwritten by the original recovery software)
  • Reject the question about root access when starting TWRP!
  • "Select "Install" and select the external SD card as storage and select the Magisk.zip file.
  • Install
  • At the end of the installation, select "Wipe Cache/Dalvik" and return to the main menu.
  • Boot into the (still old Android 6.0.1) system there.
  • Start takes a long time, 1x boot loop, then at the top of the start screen the note (from now on always!) "Set Warranty Bit: kernel", then long system start with optimization of the apps (probably because of the newly detected root access)

 

We have now a smartphone with new recovery software (TWRP) and also with possible root access (Magisk) and in the best case the original system runs as before. Now is the last chance to check your settings or back up your data.

 

 

Installing LineageOS and the Gapps (nano)

The next steps are now deleting the old system (with root access in the TWRP recovery software) and installing the new Android system and immediately installing the "nano" (minimum) set of Google apps:

  • Turn off the smartphone
  • Start into the Recovery mode: simultaneously press Volume up (1) + Home (2) + Power (3)
  • Select "Backup" and backup of the partitions "Modem", "Boot", "System", "Data" (excluding storage - warning: This does not contain any data from internal memory such as pictures or downloads) on external SD card (approx. 7 GB data volume for me, took approx. 10 minutes)
  • Now delete the system with "Wipe" and then "Advanced Wipe": delete the partitions "Cache", "System" and "Data" and wipe "Swipe to Wipe".
  • Back to the Main Menu
  • "Select "Install" and select the external SD Card as storage and the .zip files from LineageOS and Gapps, both will be installed directly one after the other.
  • Install
  • At the end of the installation select "Wipe Cache/Dalvik" and return to the Main Menu.
  • Boot now into the (new Android 7.1.2) system
  • Longer first start - Patience!

 

We have now a brand new and clean Android 7.1.2, without any bloatware and with only the absolute minimum of Google apps.

This is followed by the usual setup activities, which usually take much longer than updating the system. In particular all the above-mentioned individually created data updates must be restored and necessary additional apps must be installed. Surely there would be work simplifications and tools here, which I unfortunately don't know.

My first feeling is that the system runs very fast. Sometimes even a bit faster than 6.0.1. Especially the system starts are much faster, I estimate about 3 times faster. Some things are a bit unfamiliar and when configuring the start screen there were errors with double superimposed widgets. But this could be solved. It will now become clear in the near future whether this system update was a good idea!

On the horizon are security and feature updates at regular intervals, sometimes even weekly. That would be worlds against the update rhythm of Samsung, which was sometimes several months apart. I'm very curious whether this will go smoothly.

 

 

Post-Processings

USB-PC Transfer: If the smartphone is connected to the PC, drag the taskbar down (unfortunately every time) and select "Transfer files" as option in the USB window. Then the internal memory and the SD card should be ready for access. Otherwise, check the Windows Device Manager to see which driver addresses the USB device and if necessary uninstall or replace the USB driver.

Set up SMS Short Message Center (SMSC) again: After the update the SMS dispatch and the SMS reception didn't work for me anymore. This was because the SMSC was deleted somehow / from something in the settings. This special setting is very hidden and extremely user-unfriendly recoverable:

  • Dial the following "number" on the phone: *#*#4636#*#*
  • "Select "Phone information"
  • a litte further below enter into the very short input field at "SMSC" as "+491710760000",145 (i.e. number of the SMSC of the respective mobile phone provider (with +49, without leading Zero) in quotation marks, without spaces, behind it always ,145)
  • Then click "Update" and then "Refresh"
  • If you leave this information page and enter this information page again, the "SMSC" field is empty again...
  • After that I made a Restart and then it went suddenly...

Contacts: There are several variants of the storage. I.e. one directly on the phone or on the SIM card or remote in the Google account for a synchronization. Unfortunately, the contacts that are only to be stored on the phone or SIM card are (deliberately) cut off in their function. Only if you create new contacts on the Google account (or create them directly in the Google account or import them there) there are data fields for the birthday of the contact, for example. Otherwise this is missing and there is also no possibility to add it manually. Google wants to force us to synchronize the contacts... This cut function has nothing to do with a missing Google app. It can also only be fixed with corresponding additional apps from third parties.
In order to transfer the birthday entered in the Google contacts directly into the calendar, one creates a calendar "Birthdays", which I only managed online in the Google account or it was already automatically created there. If this is not the case, you can select and add it under "More calendars". This birthday calendar can also be synchronized.

 

 

Magisk Manager

With the previously installed Magisk file root access is enabled. In the Magisk Manager you can set different properties, also for each app separately, which you want to give root access to or not. You can also disable root access there, which is highly recommended for daily use. So this is done under Settings / Developer Options!

 

System updates

Currently (September 2017) system updates OTA (Over The Air) come weekly, often on Wednesday evening. Installing these updates is very easy:

  • Check for updates in Settings / About the phone / LineageOS updates (or the updates are announced with a small mobile icon at the top of the start bar)
  • Download the update, it's currently about 316 MB
  • Once the download is complete start the installation by clicking on the mobile phone icon to the right of the respective update.
  • A hint will appear, that you have to boot into Recovery mode and then install it, of course you need a compatible recovery, which we have with the TWRP.
  • In Recovery mode (I have the latest version 3.2.1-0 of TWRP installed) the update installation starts automatically and it is restarted automatically, you don't have to do anything (and has no possibility to do so).
  • The first reboot takes a relatively long time, at my device about 3 minutes.
  • After the restart the system is fully available again.

 

 

OpenGapps updates

The system updates of LineageOS do not (of course) update the OpenGapps as well. It is a good idea to do this from time to time. The Gapps also have an internal mechanisms for an update installation, i.e. the previous versions of the respective apps are removed. Most of these core apps cannot be updated via the Playstore.

  • Download the Gapps, there is also a version-textfile in this directory at Github
  • Save the downloaded .zip file to the SD card of the smartphone in the main directory.
  • Turn off the smartphone
  • Start into the Recovery mode: simultaneously press Volume up (1) + Home (2) + Power (3)
  • "Select "Install" and select the external SD Card as storage and the .zip files of the Gapps.
  • Install
  • At the end of the installation, select "Wipe Cache/Dalvik" and return to the Main Menu.
  • Restart Smartphone (took me as long as after a system update)

 

 

TWRP Recovery update

The version 3.1.0-1 used for the first installation was from April 2017. Now, after 5 months the new version 3.1.1-0 came with bug fixes and adaptation to Android 7.1.2 (which is running on my system).

To update, proceed as follows:

  • Download TWRP for Samsung Galaxy S5 (SM-G900F, klte) again
  • Copy the unzipped file "recovery.img" to the SD card of the smartphone.
  • Boot into recovery (see above)
  • There select "Install" and the file "recovery.img". Therefore choose the button "Install img", because TWRP actually expects a .zip-file. Then the .img file finally appears.
  • As partition select (of course) "Recovery" and not "Boot".
  • "Swipe to Flash"
  • The installation is very fast.
  • Restart, either into Recovery (pressed Volume-Up + Home) to check or immediately into the system (without any keys)

 

 

Upgrade to LineageOS 15.1

Since July 7, 2018 the first version of the new system 15.1, which corresponds to Android 8.1, is available for the SM-G900F (klte). The upgrade is offered via OTA, i.e. in the normal update area of the system 14.1, but has to be installed manually. There are two official instructions for upgrading, which I followed: LineageOS Blog, Changelog 16 and the LineageOS Wiki.

To upgrade proceed as follows:

  • Check very carefully on the smartphone if it really is the right version by looking at the Settings / Device information and searching there for the device name. Alternatively or additionally you can install the app "CPU-Z" and check under "Device" whether it is really a SM-G900F.
  • Charge the smartphone as completely as possible (just in case).
  • Perform backups (during my upgrade (almost) all data was retained, only the mail account data in the mail app are gone)
  • Download the required software packages on your PC:
  • Place the .zip files of LineageOS, Gapps, Magisk on the smartphone via USB connection on the external SD card.

  • Turn off the smartphone
  • Start in Recovery mode: simultaneously press Volume up (1) + Home (2) + Power (3)
  • in TWRP in the Main Menu, possibly under "Backup", perform backups of the System partition.
  • in TWRP select "Advanced Wipe" in the Main Menu under "Wipe" and delete (only!) the partitions "Dalvik", "System" and "Cache".
  • in TWRP select in the Main Menu choose "Install" and select then on the external SD card the .zip file of LineageOS 15.1
  • select the menu item to add further .zip files and select the .zip file of the Gapps on the external SD Card and then the .zip file of Magisk.
  • Install everything in this order, i.e. allow the created stack to be processed
  • At the end of the installation, select "Wipe Cache/Dalvik" and return to the Main Menu.
  • Restart the smartphone (took a relatively long time)

 

After the reboot I had the new system LineageOS 15.1 or Android 8.1 available, all apps and their data (except, as mentioned above, the mail accounts)! The smartphone uses less energy, i.e. the battery lasts a little bit longer. I also felt that the system is a little bit slower than 7.1.2.

With the installed system version of July 9, 2018 you are on the security patch status of July 5, 2018!