Placek's corner

Lenovo K5 Note 2018 (L38012) flashing the Global ROM, rooting, and unlocking bootloader

This article will guide you through flashing the global Google ROM onto your Chinese Lenovo K5 Note L38012, rooting and unlocking the bootloader along the way. I've scoured the internet for hours, only finding little nuggets of info, but I've pieced it all together and hopefully by putting everything into one place, I will help you too.

Prequesites

You will need to download this file, which has everything you will need, and extract it somewhere. I recommend you use the torrent, but there is a direct link too. The SHA256 checksum is 277C6EF22061A707529D7BA5F65561A18141742933DE856A99433B0D240DC417.

Torrent download Direct download

The package contains:

You will also need 7zip or WinRAR to extract all of the files.

Before you start any of this, I highly recommend you to log out of any Google accounts you may be logged into (maybe you sideloaded google play services) and do a factory reset of your phone before attempting to do anything below. Also, everything is at your own risk and I am not responsible if your phone bricks or anything.

Installing the USB drivers

Open the executable called "Qualcomm USB Driver v1.0.exe". Allow the app to make changes to your device if prompted. You will be prompted to pick between WWAN-DHCP and ETHERNET-DHCP, just keep that as default (WWAN-DHCP is not used to get IPAddress) and click Next. Accept the license agreement, install, and press Finish when complete.

Installing ADB and Fastboot

Open the executable named "adb-setup-1.4.3.exe" Allow the app to make changes to your device if prompted. A blue command window will appear. When asked if you want to install ADB and Fastboot, press Y, then Enter. When asked to install ADB system-wide, press Y, then Enter. When asked to install device drivers, press Y, then Enter. Click Next on the driver prompt, then Finish.

Installing QPST

Extract the archive named "QPST.WIN.2.7_Installer-00430.1.rar". Open the executable named "setup.exe". You may be prompted to install Visual C++ runtime libraries, install them if you are. Allow the app to make changes, then press Finish when the Visual C++ install is complete. The QPST installer will launch itself afterwards, leave everything as default and install. whenever prompted, then press Quit at the end.

Preparing the firmware files

Extract the "Firmware.7z" file onto your desktop. You will now have a folder called "Firmware", with a lot of files inside. At this point you should decide whether you want Magisk root or not. If you don't, then you don't have to do anything. If you do, there is a file called "magisk_patched_xsZ0A.bin" in the package you downloaded. Inside the "Firmware" folder, rename the file "boot.img" to anything else, for example "bootold.img". Copy the "magisk_patched_xsZ0A.bin" file into the "Firmware" folder, and rename it to "boot.img" Then, continue with the tutorial. Do note that when you do this, you'll get a message before boot. Don't worry about it, it goes away after 5 seconds, and if you press the volume buttons within those 5 seconds you can quickly enter fastboot or recovery mode.

Preparing QFIL

In your Start menu, locate the folder named QPST, then open the application named QFIL. At the top, select "Configuration", then "Firehose configuration". Make sure the device type is set to eMMC, and check the "Always Validate" and "Reset After Download" options just under the device type. Leave everything else as default. Select Flat Build as the build type, then click "Browse" next to Programmer Path. Navigate to the firmware folder on your desktop from earlier, and select "prog_emmc_firehose_8953_ddr.mbn." Then click "Load XML...", navigate to the same folder, select "rawprogram0" and press Open. Then, another box will pop up, select "patch0", and press Open.

Preparing your phone

There are two ways to get into EDL mode. You can use ADB, or you can use a button press combination. Pick whichever way works best for you

ADB

Open Settings, scroll to the bottom and select About phone, and tap on the "ZUI version" or "Lenovo version" box until you are a developer. The developer options are in the System submenu, in there enable USB debugging. Open a command prompt or Powershell by holding shift and right clicking on the desktop, and selecting "Open Powershell window here." Plug in your phone to your PC, then type in "adb reboot edl", and your phone will reboot into EDL mode. You may have to allow your PC to connect on your phone first, if this is your first time connecting via ADB.

Button combo

Power down your phone completely. Hold down Vol+ and Vol- and the power button, until the phone vibrates. When it vibrates, let go of all three buttons. Connect your phone to your PC via a microUSB cable, and Windows should detect and install the device.

Flashing

QFIL should detect your phone automatically, the "No Port Available" will change to "Qualcomm HS-USB QDLoader 9008 (COMxx)" if it does. If QFIL doesn't automatically detect your phone, press "Select port", click on Qualcomm HS-USB QDLoader 9008 (COM xx), and press OK.

With any luck, you should now be able to press the Download button, and wait for a few minutes as the new firmware is flashed over to your phone. The phone will reboot, and after a while you will see the setup intro screen on your phone, and "Download Succeeded" in the Status box. Click the Chinese text in the middle of the screen, and select your langauge. Continue setup as normal, and enjoy your device :)

If you have chosen to root your phone, there is one more step which you will have to do below.

If you get the message "Download Fail: Sahara FailSahara Fail", unplug the USB cable, hold down the power button for 15 seconds, wait for the phone to boot back up, go into EDL mode, and click Download again. That will happen when you unplug the USB cable from your phone after the software detects it.

If you get stuck in the Android setup, then you probably haven't listened to what I said about deleting your Google account at the start ;) Don't worry, the Troubleshooting section tells you how to fix it.

Root-only next steps

If you have installed the Magisk boot.img earlier, you will need to install the "MagiskManager-v8.0.4.apk" onto your phone, which can be found here. After install, run the app and follow the prompts to complete additional setup. The app will download a zip file to flash, your phone will reboot, and you will be rooted.

You don't need to unlock your bootloader, but since you are already rooted you may as well. Unlocking your bootloader will factory reset your phone. You will have to reinstall the Magisk Manager and do the additional setup after this is done, so you might want to unlock your bootloader before doing all of that.

I couldn't find any custom recovery for this phone, if you know of one then feel free to email me. But if you find one, it would probably be installed using fastboot. To do that, you will need to enable USB debugging and OEM unlock in the developer menu. To get to that, open Settings, scroll to the bottom and select About phone, and tap on the "Lenovo version" box until you are a developer. The developer options are in the System submenu, in there enable OEM unlocking and USB debugging. Reboot your phone normally, and press Vol- when the warning appears. From here, select Fastboot, then select it by pressing Power. Wait around 20 seconds for Fastboot to load.

Once you are in Fastboot, open a command window or terminal, and type "fastboot oem unlock". Select Yes on your phone with the volume and power buttons, and your phone will reboot. Your bootloader is now unlocked. If you mess anything up, you can now reset your phone through Fastboot, or load a custom recovery. Keep in mind that doing this will factory reset your phone.

If Magisk Manager gets stuck on "Running environment setup...", then close out of the app, and go somewhere closer to your WiFi router, or switch to celluar data. This happens because it fails downloading the .zip file it needs, in my case it was failing because the WiFi signal in my room isn't great.

Troubleshooting

You may find that after your device boots up, you will be unable to get past the portion of setup where you are asked if you want to start fresh, or restore a backup. Google FRP seems to be a bit broken, and it is crashing at the part it would ask you to login to your Google account. If this happens to you, then I have found this guide to be helpful.

I'll mirror the tutorial in case it goes down. But credit to albastuz3d, no other method I found would work. In case you are curious, I looked it up and the language is Khmer. It's the second one form the bottom of the list.

I followed that guide all the way to the point where you launch the Chrome browser, but then I used this APK to get into the settings. From the settings, I stumbled my way through the menus and found the factory reset option. You have to do it this way if you haven't unlocked your bootloader, as any factory reset command from fastboot wont work otherwise, and the recovery menu in this phone is a bit useless, only allowing you to flash an update.zip file.

I believe this happened because I was logged into my Google account when I flashed the phone a second time, and the FRP lock was activated. Something seems to be broken in the FRP lock part of this ROM, as I couldn't login in any way, not even in Chrome. However, after setup is done I have found no issues with logging into Google, or other things.

The End!

Thanks for reading, and I hope I have helped you get your phone working properly again. These instructions will mostly work for a lot of other Qualcomm devices, but obviously the firmware will be different. It took me a long time to track down the firmware for this phone, which is why I have written this tutorial in the first place. All of the guides I found were a broken mess, but I've managed to cobble it all together. If you have any trouble, or have something to add, then feel free to email me at placekxyz@protonmail.com.