[LG Leon Questions & Answers] hokutojm:
My LG Leon LG-H340n root wiki, using a computer (Windows 10 x64 in my case, should work with Seven).

You need also an MicroSD card (for SuperSU installation and backups):

1)

Make some backups, because my first try doesn't work and my phone was restored to factory default :(

Personally I use backup provided by LG to restore my desktop theme, apps, sms, icons, and Google contacts synchronization.

2)

You have to install LG USB Drivers for your computer:

- Connect usb cable to phone and authorize access

- On the phone click on MTP notification

- Select top right menu “...” and “Install Drivers for PC” (I have a french phone, maybe little different)

- Normally Windows driver installation is automatic, but you can install also manually (windows explorer mount a special folder and drivers are inside).

3)

Download LGLAF python scripts (using “Clone or download” button, Download ZIP):

https://github.com/Lekensteyn/lglaf

You can notice that there is Usage note to enter “Download Mode”, it will be useful later

4)

Download Pyhton software (I use 3.5.3 but latest should work):

https://www.python.org/

5)

Download TeamWin TWRP for c50:

https://dl.twrp.me/c50/

Actually my version is twrp-3.1.0-0-c50.img there is a new one, but I didn't try it (one you are root you can upgrade using adb).

6)

Download SuperSU ZIP

http://www.supersu.com/download

My version is SuperSU-v2.79-201612051815.zip (I don't test latest 2.82)

Put the zip file to your Phone external SD.

7)

Download aboot.bin (if you have LG-H340n). Because there is no TWRP for c50n.

Thanks to cerg2010cerg2010

https://xdaforums.com/leon/how-to/lg-leon-h340n-patched-unlocked-t3503461

https://yadi.sk/d/tpz-nnVcz2Qk2

9) Now get ready !

- Prepare a folder on your computer, for example C:\Temp\LEON

- Inside C:\Temp\LEON, unzip LGLAF python scripts (from step 3)

- Inside C:\Temp\LEON, unzip Python software (from step 4)

- Power Off the phone

- Disconnect usb cable

- Press and hold Volume up

- Connect usb cable (keep holding Volume up)

- Now Leon poweron, and screen is in “Firmware Update” mode

- On computer, start command line cmd.exe and go to your unzip folder:

cd C:\Temp\LEON

- First check connection, type:

python partitions.py --debug –list

result example (most important):

5 5120 2.0 MiB aboot

7 816128 2.4 GiB system

19 191488 24.0 MiB recovery

39 7590094 3.6 GiB userdata

- If connection doesn't work, maybe LG Driver is not correctly installed, or device name is not corresponding to LGLAF tools. You can try to edit lglaf.py file and go to function detect_serial_path(), line 303 :

replace “name.endswith('ANDNETDIAG1'):” by “name.endswith('DIAG1'):”

- Now your connection is working, first make some backup:

python partitions.py --dump aboot.old aboot

python partitions.py --dump recovery.old recovery

- You can notice that all system is available, so you can backup userdata partition (for my part I mount it with a Linux system to extract my angrybirds saves :) )

- Put twrp-3.1.0-0-c50.img inside C:\Temp\LEON (from step 5)

- Put also aboot.bin (from step 7)

10) Now let's start dangerous steps, we have to erase recovery partition:

- go back to your commande line, and type:

python partitions.py --wipe recovery

python partitions.py --restore twrp-3.1.0-0-c50.img recovery

- also aboot.bin if you have LG-H340n model

python partitions.py --wipe aboot

python partitions.py --restore aboot.bin aboot

- check that patition change is ok :

python partitions.py --dump recovery.new recovery

python partitions.py --dump boot.new aboot

- compare file contents (using fc command, you can use also a hexadecimal file editor) :

fc /b recovery.new recovery.old

!!! if recovery.new is the same as recovery.old, that means partition upload doesn't work. Retry the --restore twrp until it's work don't continue to step 11.

fc /b recovery.new twrp-3.1.0-0-c50.img

!!! normaly recovery.new must match to twrp (begin of file, there is a different size between partition and img size)

Check also aboot.new with aboot.old

- then reboot the phone

python lglaf.py --debug -c "!CTRL RSET"

11) Normaly TWRP recovery is installed, so try it (procedure example http://www.android.gs/enter-recovery-mode-lg-g3)

- press and hold Power and Volume down buttons at the same time.

- When the LG logo appears, release the keys.

- Immediately press Power and Volume Down buttons again until the Hard Reset menu will be displayed.

- Press Power button once and confirm the hard reset operation

Sometime is difficult to enter recovery, but keep trying (some apps can have also boot recovery mode function)

12) With TWRP recovery, you can install SuperSU :)

Here is an example with a Moto phone, it's the same way with Leon start at step 3.

https://xdaforums.com/moto-g4-plus/how-to/root-systemless-rooting-supersu-2-74-2-t3405772

The important is to not forget to activate SYSTEMLESS=true, and select the SuperSU zip you put on MicroSD card.

13) Reboot your system, now your are root :)

Troubleshooting / restore factory:

- In case of infinite loop starting system (it's arrived for me for my first attempt), you have to restore recovery backup partition:

python partitions.py --wipe recovery

python partitions.py --restore recovery.old recovery

and use LG recovery mode to restore android to factory default. Then restart step 10.

- In case of brick, you can use LG firmware software to restore all partitions (it will replace aboot and recovery to factory default), you need to found KDZ and procedure, it's not too difficult. Sometime to enable phone to restart you have to use LG recovery mode after KDZ to make a clean installation.

Hope it will work for xda users :)