[LeEco Le 2 Guides, News, & Discussion] PojntFX:
[GUIDE 3] Unbrick, Unlock the LeEco Le 2 (X52x/Snapdragon) and Install LineageOS 15.1

Flash the Recovery (TWRP)

Editor's Note: You may use GNU/Linux from now on. Just be sure to prefix the fastboot and adb commands with sudo to use them, as they would not be able to see the device otherwise. Yay, UNIX permissions!

If you are using Windows, copy the twrp-3.2.1-0-s2.img to the installation directory of "Minimal ADB and Fastboot" (in my case, that is C:\Program Files (x86)\Minimal ADB and Fastboot). Then open up "Minimal ADB and Fastboot" using the start menu. GNU/Linux users don't have to do this - just be sure that you are in the directory in which the twrp-3.2.1-0-s2.img file is (for example ~/Downloads - enter it by typing cd ~/Downloads).

First, enter Fastboot mode as described above.

In the terminal (or command promt on Windows, which should have opened up when opening "Minimal ADB and Fastboot" using the start menu), type the following (on GNU/Linux, make sure that you are in the directory in which the twrp-3.2.1-0-s2.img file is):

fastboot oem onlock-go
fastboot boot twrp-3.2.1-0-s2.img

The phone will now reboot into TWRP. If it asks for changing the system partition, don't do that - if it asks for an encryption password, click Cancel.First, wipe the data by clicking on Wipe, then Format Data and typing yes. Afterwards, click on the home key at the bottom of the screen, then Reboot and then Bootloader. This will put you into Fastboot mode again.

Now, run this:

fastboot oem unlock-go
fastboot flash recovery twrp-3.2.1-0-s2.img

Then, reboot into Recovery mode as described above.

Flash the Modem

As you might have noticed, WiFi and cellular have probably not worked when you've tried out the stock ROM. If they did - that's great, you can simply skip this step!

First, while you are in Recovery mode, plug the phone into your computer. Using the file manager (Files on GNU/Linux or Explorer on Windows), copy and paste the MSM8976.TA.2.0.0.c18-00004-8976_GEN_PACK-1.65238.1.66782.1.zip file to the phone's internal storage. I prefer to create a ROMs folder on the phone and paste it into there for clarity, but this is certainly not necessary. Once you've copied the file to the phone's internal storage, in TWRP, click on Install, and select the file. Flash the modem by swiping the bar on the bottom. Afterwards, put the phone into Normal mode and try out whether you can use WiFi and cellular.

Flash LineageOS 15.1

Until now, you've been using the proprietary LeEco stock ROM. Of course, in order to stay safe, have the freedom to do whatever we want with our devices and to stop the spying, we want to wipe it of the phone. Thankfully, since a long time now, Android custom ROMs exist for such reasons - they give you the freedom to do whatever you want with your system. One such free (as in freedom)/libre distribution of Android is LineageOS, so this is what we are going to install. LineageOS gives you the following four essential freedoms:

Editor's Note: Yes, array's start at 0. This is not Lua.

The freedom to run the program as you wish, for any purpose (freedom 0).

The freedom to study how the program works, and change it so it does your computing as you wish (freedom 1). Access to the source code is a precondition for this.

The freedom to redistribute copies so you can help others (freedom 2).

The freedom to distribute copies of your modified versions to others (freedom 3). By doing this you can give the whole community a chance to benefit from your changes. Access to the source code is a precondition for this.

As of my experience, LineageOS 15.1, which is based on Android 8.1 Oreo, is very stable, in fact much more so than the stock ROM. It also is much more up-to-date and thus much more secure. Fingerprint, Camera, ... everything is working perfectly fine!

Editor's Note: This sounds nice, so let's do it!

Put the phone into Recovery mode

Wipe the phone again. This will not wipe the modem however, which is intentional. To do so, in Recovery mode, click on Wipe, then Advanced, and select every option except for USB OTG and Boot. Swipe the bottom bar to confirm the wipe.

Copy the lineage_s2-2018-08-13-12-03-21.zip and Magisk-v16.7.zip files to the phone's internal storage (preferably by creating a ROMs folder and copying the file into there). The Magisk-v16.7.zip will give you the freedom to have full root access to the device.

Tap the home key, select Install, select lineage_s2-2018-08-13-12-03-21.zip, click on Add another zip, select Magisk-v16.7.zip and swipe the bottom bar to confirm the installation. This might take some time.

After the installation has finished, click on Reboot System. This will put your phone back into Normal mode.

Editor's Note: Some guides recommend you to install something called "GAPPS", or Google Apps, right after the LineageOS installation. This used to be necessary back when proprietary software (such as "GAPPS") where necessary for all basic functionality, but this has changed dramatically over the last year. No worries - you'll still be able to install proprietary software in case you rely on it (I do for example depend on WhatsApp). You just won't have to install it through the proprietary Google Play Store, but a free/libre software alternative. Running proprietary software on top of a free/libre and open source operating system is still better than a) the other way round or b) proprietary software on a proprietary OS.

Setting Up LineageOS 15.1

Out of the box, LineageOS comes as a minimal distribution (which is a thing I really appreciate about it). No bloatware at all - just the basics! One essential part of a modern OS however is missing - the package manager (or "App Store/Play Store") to install and update apps. In order to install it, do the following:

Windows: Open "Minimal ADB and Fastboot"

(Also Windows): Copy the FDroid.apk file to the directory in which "Minimal ADB and Fastboot" is, in my case C:\Program Files (x86)\Minimal ADB and Fastboot. If you are using GNU/Linux, make sure that you're in the directory in which the FDroid.apk file is (in my case, that is ~/Downloads - enter it by typing cd ~/Downloads).

Plug your phone into your computer using a USB cable

Run adb install FDroid.apk (you might have to accept the computer's fingerprint on your phone in a dialog that will pop up)

Now that you've installed F-Droid, you can install apps on your phone! The first one, I guess, should be a web browser. To install it:

Open up F-Droid

Search for Fennec (a liberated version of the Firefox browser)

Click on the first result and then on Install

Great, now you've got a web browser! F-Droid really is a nice package manager. You should always use it when possible - every app in it is Free/Libre and Open Source Software. In fact, most apps the average user needs are available in it - I personally really enjoy using the Simple Mobile Tools, the NewPipe YouTube client as well as Open Camera, which are all available in F-Droid.

But what if you need to install proprietary/non-free/non-libre software like WhatsApp or Spotify? Well, sure, technically you could just download the APK with Fennec from something like UpToDown or APKMirror, but this way you won't have any updates. Well, guess what, someone wrote another Free/Libre and Open Source Software to solve your problem, and it's called APKUpdater! Unlike what it's name suggests, it's actually a bit more than "just" and updater - it is able to download apps from many different sources, even the Play Store - without a Google account! To install it, do the following:

Open apkmirror.com/apk/rumboalla/apkupdater/ with Fennec, download and install the APK (you might have to enable Fennec as a "trusted source" for software during the installation)

Open "APKUpdater" from your home screen

Using APKUpdater, you can search and use an infinite amount of APKs (app packages) - in fact, far more than there are on the Google Play Store! Consider also checking out the settings of the app - there are even more sources that you can enable. Since your phone is now rooted, these apps can also update themselves in the background without any user interaction - very useful!

Maintaining LineageOS 15.1

It should be noted that the version of LineageOS that is being used in this guide is still unofficial (the official version for the Le 2 is 14.1, which is based on Android 7.1), but not only can you expect OTA updates (you'll get a notification an can update without any data loss), but also there might be an official LineageOS 15.1 for the Le 2. Consider contributing on the ROMs GitLab project.

Editor's Note: Yay, that's it! You're done!

Thanks a lot for reading my little tutorial! I hope it helped you in some way - after all, not everyone has two days to spend on unbricking a phone, so it's great that I'm still a student ;) If you've appreciated my work here, consider clicking the "thanks" button - and as always, feel free to leave a comment, suggestion or correction in the thread! You might also be interested in some of my other free/libre and open source software and hardware projects, although they might be a little more obscure: consider following me on my GitLab, GitHub or Twitter accounts.

Copyleft 2018-08-18 @pojntfx under the CC-BY-SA-4.0 license.