Skip to content

Instantly share code, notes, and snippets.

@pparaxan
Last active March 3, 2026 22:33
Show Gist options
  • Select an option

  • Save pparaxan/bb552c15b06624a88f4f5b974e7007b8 to your computer and use it in GitHub Desktop.

Select an option

Save pparaxan/bb552c15b06624a88f4f5b974e7007b8 to your computer and use it in GitHub Desktop.
How to [unlock/root/flash a GSI] for your LG Stylo 6.

last updated 29/7/25

^ NOTE: LG has shutdown their servers that hosted the firmware, making it very difficult to locate a firmware file for your specific model. However, some members in The Bootloader Locksmiths Discord server may have it still on their computer, which in that case, ask.


ATTEMPT THIS AT YOUR OWN RISK, PLEASE READ THE DAMN FULL TUTORIAL BEFORE YOU START. I AM NOT RESPONSIBLE FOR ANY BRICKED DEVICES! THIS PROCESS IS NOT FOR THE INEXPERIENCED.

Download these stuff first

Installation

  1. Install Python (select "Add Python to PATH")
  2. Install USBDK
  3. Download mtkclient, while in the mtkclient folder hold shift and right click and select Open PowerShell window here. Run these commands in the same PowerShell window:
pip3 install -r requirements.txt
pip3 install setuptools
python setup.py install

NB: You must remove every loader from mtkclient\Loader except MTK_AllInOne_DA_5.2136.bin.

  1. Extract SP Flash Tool and run flash_tool.exe. Download the scatter and the preloader file provided. (backup link)
  2. Install LGUP Installer, to make sure the MTK VCOM drivers are installed

Downgrading your firmware

LG pushed a update that messes up mtkclient, to fix that you'll have to install a update that's older than December 2021. (If you don't want to install this specific version, DON'T INSTALL THE FIRST FIRMWARE, IT WILL BRICK YOUR DEVICE*)

Install the firmware provided:

Reboot into download mode (shut down your phone with the usb cable plugged out, hold the volume up button and plug in the usb cable in your phone before the logo appears) then open LGUP, you should see your device on the list.

Add the .kdz file and just flash. Once the process is done, congrats, you just downgraded your firmware.

Unlocking your OEM

I'm sure everyone knows how to do this. Go into Developer mode and turn on OEM Unlocking

Unlocking your bootloader

The part you've been waiting for, this is the part where you'll have total control of your phone.

NB: This is the part where some devices could somewhat get bricked, make sure to backup your partitons before unlocking the bootloader: python mtk rf flash.bin, to restore the partitions, do python mtk wf flash.bin

Make sure to shut down your phone and make sure it isn't connected to the computer

Extract the .zip file that contains the scatter and preloader files, Open SP Flash Tool and load in the scatter file. Once the scatter file is loaded, click the Download button

Then open the PowerShell window and run this command:

python mtk e metadata,userdata,md_udc

when mtkclient is asking to plug in your phone, plug in your phone to the computer (again the phone has to be off). SP Flash Tool is gonna error out, that's alright.

You should see that the command went without any errors, if so, great.

Plug out your phone from the computer (don't turn on your phone just yet..), go back to SP Flash Tool, and click the Download button again. (Yes, you'll have to do this every time you're trying to use mtkclient)

Open back the same PowerShell window and run this command:

python mtk xflash seccfg unlock

If that command went without any errors, your bootloader is now unlocked!

Rooting your phone

Rooting your phone is really simple, in the same PowerShell window, run this command:

python mtk r boot_a,boot_b boot_a.img,boot_b.img

(again, you'll have to click the Download button in SP Flash Tool before doing this command)

this will pull both boot.img files.

DO NOT MIX UP YOUR BOOT_A AND BOOT_B FILES YOU WILL LOSE WIFI OR BLUETOOTH IF YOU FLASH THEM TO THE WRONG SLOTS

Patch the two boot images and rename them to patched_a.img and patched_b.img, just so that you don't get confused. Copy the two boot images back to your computer, in the same folder that the mtkclient tool is located and run this command:

python mtk w boot_a,boot_b patched_a.img,patched_b.img

if the command went without any errors, your phone is now rooted!

Flashing a GSI

If you hate the stock ROM and want to use Android 15 for example ||(please don't, your phone will cry)||, well you're in luck.

But first, download these stuff

(Make sure you extract your GSI (.tar.xz))

fastboot method

adb reboot fastboot
fastboot delete-logical-partition product_a
fastboot create-logical-partition product_a 6000
fastboot flash product_a product_gsi.img
fastboot erase system_a
fastboot flash system_a <your gsi>.img
fastboot erase userdata
fastboot erase metadata

mtkclient method

Unknown, too lazy to find out.

[..] Then go into recovery mode and perform a factory data reset.

Reverting back to stock ROM

Well this process is a little tricky, since LG's firmware flashing process is shored on the system's partition (of the stock ROM).

Since the stock ROM is in the .kdz file format, we need to extract it's contents via a tool called KDZ Extractor.

Image of KDZ Extractor

Make sure to select the .kdz file in the KDZ File section, only choosing the .dzfile, then press Extract KDZ. After that's done, close the program.

Image of File Explorer

Open cmd in the same directory and run the following command:

copy /b super_*.img_* super.img

This command will take all of the super_ .img files and put it in one file, so that you can flash it to your phone.

Fastboot method

After that's done, copy super.img to the platform-tools folder, open cmd in the same directory and run the following commands:

fastboot erase system_a
fastboot flash system_a super.img

Shut down your phone while the USB is plugged in, then quickly hold the volume up button to go to the firmware update UI, there you can flash back the stock ROM via LGUP.

mtkclient method

Unknown, too lazy to find out.

To lock back the bootloader, do the same process as Unlocking your bootloader, but run this command instead:

python mtk xflash seccfg lock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment