[ROOT] EU LMV405EBW - Magisk

Search This thread

DLS123

Senior Member
Aug 20, 2013
78
66
I couldn't find any guide for rooting the V40, so I thought I'd write down the steps I took to root my new EUR V40 - LMV405EBW. Maybe it will help others. Sorry if this is somewhat confusing, I didn't have time to make a polished version. It's basically made from my notes during the process with the commands copied from bash history.

-First, unlock the bootloader following LG's instructions here: https://developer.lge.com/resource/mobile/RetrieveBootloader.dev
There's no TWRP for the V40 and the one made for G7 doesn't work. I don't have the time and knowledge to even attempt to compile TWRP for the V40, so I proceeded with just patching an original boot image with Magisk.
You can get the patched boot images that I used from here:

Oreo 10e: boot_a_magisk_patched_10e.img
Oreo 20f: boot_a_magisk_patched_10f.img
Pie 20a: boot_a_magisk_patched_20a.img
Pie 20b: boot_a_magisk_patched_20b.img
Pie 20f: boot_a_magisk_patched_20f.img
Pie 20g: boot_a_magisk_patched_20g.img
Q 30b: boot_a_magisk_patched_30b.img (this requires flashing to the active boot partition).
Q 30c: boot_a_magisk_patched_30c.img (this requires flashing to the active boot partition)
Q 30d: boot_a_magisk_patched_30d.image (this may or may not work with "fastboot boot" and could require flashing to the active boot partition. I haven't tested if live boot still works. I just did fastboot flash boot_x img_file).

You can try to boot it with with fastboot if you have a LNV405EBW and skip the KDZ extraction part.

Installing Magisk:
Flashing this image isn't necessary, just straight boot should be sufficient and safe.
First install Magisk Manager 7 on the phone then connect the phone to the PC and run:
Code:
adb reboot bootloader
fastboot boot boot_a_magisk_patched_10e.img
After the phone boots the OS with the external boot image, open Magisk Manager and tap on Install. Select the option to Direct install to the active slot. I played it safe and decided to NOT flash also on the inactive slot. I've left it alone so I can use it in case of need of recovery.
You'll probably notice that you don't have a connection to the carrier. Just ignore it, it will back once the phone is booted normally.
Reboot and you will have permanent root until you switch the A/B slots.

In case my patched boot image doesn't work, you can just make your own.

Tools needed:
  • Magisk Manager 7.0.0 installed on the phone
  • LG Bridge installed on a Windows machine.
  • a Linux machine or VM (I used the latest ubuntu desktop), python3 with the zstandard module installed and kdztools from steadfasterX's repo. Maybe kdztools would work on Windows too, I haven't tried it.
  • adb, fastboot

You need to procure an original ROM file for your phone model. It can be downloaded easily with LG Bridge. Just connect the phone to a Windows PC, start LG bridge, go to the Software update tab and click on Update error recovery. Wait for the download to start and disconnect the phone. Ignore LG Bridge complains about not being able to flash after the downloading stage is completed. Don't click anything in Bridge and before closing it go to C:\Users\<your_username>\AppData\Local\LG Electronics\LG Bridge\SWUpgrade and copy your KDZ somewhere else. Preferably send it to the Linux VM to the LG work folder, it'll be needed there.

On Linux open a terminal:
Code:
cd ~/Documents
mkdir LG
cd LG
git clone https://github.com/steadfasterX/kdztools.git
cd kdztools
nano undz.py -c

For kdztools to be able to extract the V40 images, I needed to edit undz.py and comment the lines 88-90. So, this block should all be commented or undz will fail to extract the boot partitions.
Code:
                #if len(dz_item['pad']) != 0:
                #        print("[!] Error: pad is not empty", file=sys.stderr)
                #        sys.exit(1)

To extract, with the KDZ copied to ~/Documents/LG/
Code:
cd ~/Documents/LG/kdztools
./unkdz.py -f ../V405EBW10e_00_OPEN_EU_DS_OP_0109.kdz -x
cd kdzextracted/

List the partitions contents and look for the IDs of boot_a and/or boot_b. In my case they were 44 for boot_a and 63 for boot_b
Code:
../undz.py -f V40510e_00.dz -l
Extract boot_a or boot_b or both, they're identical:
Code:
../undz.py -f V40510e_00.dz -s 44
../undz.py -f V40510e_00.dz -s 63
You can find the extracted boot images in the dzextracted subfolder. Get boot_a.image or boot_b.image or both from there and send them to the phone in a location accessible by Magisk Manager. The Download folder should do fine.
Open Magisk Manager and tap Install, select Patch Boot Image file and patch the image file(s) you extracted. Get the patched_boot.img that Magisk Manager saves in the Download folder and send it to a PC where you have adb and fastboot.

Go to the beginning of the post to the Installing Magisk section.
 
Last edited:

Einsteindks

Senior Member
Feb 10, 2011
839
192
If anything, at least a way to unlock the bootloader via legitimate channels! Gonna be generating that string, next chance I get, to be ready.

Sent from my LM-V405 using Tapatalk
 

Mersaci

New member
Mar 20, 2019
2
0
Hey do the unlock codes online work for $ 12-15 on sprint? I used to flash phones back in the day and got a great deal on a bad IMEI sprint lg v40, but so far I can see there isn’t a way yet. On top off all that I m in Europe and don’t want to get the error message that I m out of the Region. I would have to go to USA just to unlock the phone.
 

DLS123

Senior Member
Aug 20, 2013
78
66
Getting a boot image like that works but I find it stupid to not upload it so that the others don't have to do it. Besides only one model can be bl unlocked so there won't be any model mismatch (except firmware versions but keeping up with them is not that hard)

Or I could find you stupid for not noticing the patched image is in my first post.
 
Last edited:
  • Like
Reactions: TPMJB

DLS123

Senior Member
Aug 20, 2013
78
66
I recommend labeling the boot images with their firmware since future firmwares won't be able to run the same boot image but other than that I'm really sorry.

I mentioned in the description 1 line below the link that it's for 10e. There was no other update in a long time. I don't think there can be any confusion for now. I can edit and label the file when there's will be another fw update.
 
  • Like
Reactions: Ainz_Ooal_Gown

DLS123

Senior Member
Aug 20, 2013
78
66
It looks like unlocking the bootloader breaks Widevine L1 on the V40 and downgrades is to L3. No more HD or UHD Netflix.
I couldn't find any other solution than to re-lock the bootloader to restore L1.

This doesn't happen on the V30.
 
  • Like
Reactions: Ainz_Ooal_Gown

daphix

Member
Mar 13, 2009
49
7
@DLS123
Thank you for all!
I ask you for more details; i'm stuck at flashing first image in adb; it returns an error; have LMV405EBW with 10f. unlocked bootloader of course
Thx again for your support!
 

DLS123

Senior Member
Aug 20, 2013
78
66
@daphix what do you mean by flashing the first image? You're not supposed to flash my patched boot image. Just boot it without flashing and Direct install Magisk from it with Magisk Manager.
 

daphix

Member
Mar 13, 2009
49
7
@daphix what do you mean by flashing the first image? You're not supposed to flash my patched boot image. Just boot it without flashing and Direct install Magisk from it with Magisk Manager.

Thx for answer; i not have too much experience in working with Magisk;
i just folowed your steps:

First install Magisk Manager 7 on the phone then connect the phone to the PC and run:
adb reboot bootloader
fastboot boot patched_boot_a.img

when i run fastboot comand for flash, is runing, but is returning "an error at line x"
i suppose is something wrong in this instructions.
 
Last edited:

daphix

Member
Mar 13, 2009
49
7
Thx for answer; i not have too much experience in working with Magisk;
i just folowed your steps:

First install Magisk Manager 7 on the phone then connect the phone to the PC and run:
adb reboot bootloader
fastboot boot patched_boot_a.img

when i run fastboot comand for flash, is runing, but is returning "an error at line x"

Anyway; understand now what to do;
Steps are below:
- first install magisk manager
- download magisk zip from magisk site or from magisk manager himself on phone
- download patched_boot_a.img to phone from our good contributor
- use magisk manager and select inslall image of patched_boot_a.img from phone
- magisk manager will generate a magisk patched image
- transfer this magisk patched image (not patched_boot_a.img) to pc in ADB folder
- flash with Adb this magisk patched image from pc to phone.

Thx to our friend!

---------- Post added at 09:53 AM ---------- Previous post was at 09:21 AM ----------

@daphix what do you mean by flashing the first image? You're not supposed to flash my patched boot image. Just boot it without flashing and Direct install Magisk from it with Magisk Manager.

Hi;
using Magisk mamanger and your file was generated a file: magisk_patched.img

pls support; trying to flash that image from PC with adb not work:
fastboot flash partition_a magisk_patched.img
 
Last edited:

DLS123

Senior Member
Aug 20, 2013
78
66
@daphix
Whatver you're trying to do, is nowhere in the procedure I used. If you already booted with my boot image why are you making another boot image with Magisk and why are you trying to flash that? I never wrote anything of the sort.
if you booted with my patched image you already have temporary root and can use Magisk Manager to Direct install Magisk itself.
 

daphix

Member
Mar 13, 2009
49
7
@daphix
Whatver you're trying to do, is nowhere in the procedure I used. If you already booted with my boot image why are you making another boot image with Magisk and why are you trying to flash that? I never wrote anything of the sort.
if you booted with my patched image you already have temporary root and can use Magisk Manager to Direct install Magisk itself.

Hi , thank you for reply;
I tried many combinations of your commands;
maybe due that am noob, but succesion below simply is not working:

First install Magisk Manager 7 on the phone then connect the phone to the PC and run:
adb reboot bootloader
fastboot boot patched_boot_a.img
 

Top Liked Posts

  • There are no posts matching your filters.
  • 13
    I couldn't find any guide for rooting the V40, so I thought I'd write down the steps I took to root my new EUR V40 - LMV405EBW. Maybe it will help others. Sorry if this is somewhat confusing, I didn't have time to make a polished version. It's basically made from my notes during the process with the commands copied from bash history.

    -First, unlock the bootloader following LG's instructions here: https://developer.lge.com/resource/mobile/RetrieveBootloader.dev
    There's no TWRP for the V40 and the one made for G7 doesn't work. I don't have the time and knowledge to even attempt to compile TWRP for the V40, so I proceeded with just patching an original boot image with Magisk.
    You can get the patched boot images that I used from here:

    Oreo 10e: boot_a_magisk_patched_10e.img
    Oreo 20f: boot_a_magisk_patched_10f.img
    Pie 20a: boot_a_magisk_patched_20a.img
    Pie 20b: boot_a_magisk_patched_20b.img
    Pie 20f: boot_a_magisk_patched_20f.img
    Pie 20g: boot_a_magisk_patched_20g.img
    Q 30b: boot_a_magisk_patched_30b.img (this requires flashing to the active boot partition).
    Q 30c: boot_a_magisk_patched_30c.img (this requires flashing to the active boot partition)
    Q 30d: boot_a_magisk_patched_30d.image (this may or may not work with "fastboot boot" and could require flashing to the active boot partition. I haven't tested if live boot still works. I just did fastboot flash boot_x img_file).

    You can try to boot it with with fastboot if you have a LNV405EBW and skip the KDZ extraction part.

    Installing Magisk:
    Flashing this image isn't necessary, just straight boot should be sufficient and safe.
    First install Magisk Manager 7 on the phone then connect the phone to the PC and run:
    Code:
    adb reboot bootloader
    fastboot boot boot_a_magisk_patched_10e.img
    After the phone boots the OS with the external boot image, open Magisk Manager and tap on Install. Select the option to Direct install to the active slot. I played it safe and decided to NOT flash also on the inactive slot. I've left it alone so I can use it in case of need of recovery.
    You'll probably notice that you don't have a connection to the carrier. Just ignore it, it will back once the phone is booted normally.
    Reboot and you will have permanent root until you switch the A/B slots.

    In case my patched boot image doesn't work, you can just make your own.

    Tools needed:
    • Magisk Manager 7.0.0 installed on the phone
    • LG Bridge installed on a Windows machine.
    • a Linux machine or VM (I used the latest ubuntu desktop), python3 with the zstandard module installed and kdztools from steadfasterX's repo. Maybe kdztools would work on Windows too, I haven't tried it.
    • adb, fastboot

    You need to procure an original ROM file for your phone model. It can be downloaded easily with LG Bridge. Just connect the phone to a Windows PC, start LG bridge, go to the Software update tab and click on Update error recovery. Wait for the download to start and disconnect the phone. Ignore LG Bridge complains about not being able to flash after the downloading stage is completed. Don't click anything in Bridge and before closing it go to C:\Users\<your_username>\AppData\Local\LG Electronics\LG Bridge\SWUpgrade and copy your KDZ somewhere else. Preferably send it to the Linux VM to the LG work folder, it'll be needed there.

    On Linux open a terminal:
    Code:
    cd ~/Documents
    mkdir LG
    cd LG
    git clone https://github.com/steadfasterX/kdztools.git
    cd kdztools
    nano undz.py -c

    For kdztools to be able to extract the V40 images, I needed to edit undz.py and comment the lines 88-90. So, this block should all be commented or undz will fail to extract the boot partitions.
    Code:
                    #if len(dz_item['pad']) != 0:
                    #        print("[!] Error: pad is not empty", file=sys.stderr)
                    #        sys.exit(1)

    To extract, with the KDZ copied to ~/Documents/LG/
    Code:
    cd ~/Documents/LG/kdztools
    ./unkdz.py -f ../V405EBW10e_00_OPEN_EU_DS_OP_0109.kdz -x
    cd kdzextracted/

    List the partitions contents and look for the IDs of boot_a and/or boot_b. In my case they were 44 for boot_a and 63 for boot_b
    Code:
    ../undz.py -f V40510e_00.dz -l
    Extract boot_a or boot_b or both, they're identical:
    Code:
    ../undz.py -f V40510e_00.dz -s 44
    ../undz.py -f V40510e_00.dz -s 63
    You can find the extracted boot images in the dzextracted subfolder. Get boot_a.image or boot_b.image or both from there and send them to the phone in a location accessible by Magisk Manager. The Download folder should do fine.
    Open Magisk Manager and tap Install, select Patch Boot Image file and patch the image file(s) you extracted. Get the patched_boot.img that Magisk Manager saves in the Download folder and send it to a PC where you have adb and fastboot.

    Go to the beginning of the post to the Installing Magisk section.
    2
    Added 20f and 20g to OP if anyone still needs them.
    2
    I couldn't find any guide for rooting the V40, so I thought I'd write down the steps I took to root my new EUR V40 - LMV405EBW. Maybe it will help others. Sorry if this is somewhat confusing, I didn't have time to make a polished version. It's basically made from my notes during the process with the commands copied from bash history.

    -First, unlock the bootloader following LG's instructions here: https://developer.lge.com/resource/mobile/RetrieveBootloader.dev
    There's no TWRP for the V40 and the one made for G7 doesn't work. I don't have the time and knowledge to even attempt to compile TWRP for the V40, so I proceeded with just patching an original boot image with Magisk.
    You can get the patched boot images that I used from here:

    Oreo 10e: boot_a_magisk_patched_10e.img
    Oreo 20f: boot_a_magisk_patched_10f.img
    Pie 20a: boot_a_magisk_patched_20a.img
    Pie 20b: boot_a_magisk_patched_20b.img

    You can try to boot it with with fastboot if you have a LNV405EBW and skip the KDZ extraction part.

    Installing Magisk:
    Flashing this image isn't necessary, just straight boot should be sufficient and safe.
    First install Magisk Manager 7 on the phone then connect the phone to the PC and run:
    Code:
    adb reboot bootloader
    fastboot boot boot_a_magisk_patched_10e.img
    After the phone boots the OS with the external boot image, open Magisk Manager and tap on Install. Select the option to Direct install to the active slot. I played it safe and decided to NOT flash also on the inactive slot. I've left it alone so I can use it in case of need of recovery.
    You'll probably notice that you don't have a connection to the carrier. Just ignore it, it will back once the phone is booted normally.
    Reboot and you will have permanent root until you switch the A/B slots.

    In case my patched boot image doesn't work, you can just make your own.

    Tools needed:
    • Magisk Manager 7.0.0 installed on the phone
    • LG Bridge installed on a Windows machine.
    • a Linux machine or VM (I used the latest ubuntu desktop), python3 with the zstandard module installed and kdztools from steadfasterX's repo. Maybe kdztools would work on Windows too, I haven't tried it.
    • adb, fastboot

    You need to procure an original ROM file for your phone model. It can be downloaded easily with LG Bridge. Just connect the phone to a Windows PC, start LG bridge, go to the Software update tab and click on Update error recovery. Wait for the download to start and disconnect the phone. Ignore LG Bridge complains about not being able to flash after the downloading stage is completed. Don't click anything in Bridge and before closing it go to C:\Users\<your_username>\AppData\Local\LG Electronics\LG Bridge\SWUpgrade and copy your KDZ somewhere else. Preferably send it to the Linux VM to the LG work folder, it'll be needed there.

    On Linux open a terminal:
    Code:
    cd ~/Documents
    mkdir LG
    cd LG
    git clone https://github.com/steadfasterX/kdztools.git
    cd kdztools
    nano undz.py -c

    For kdztools to be able to extract the V40 images, I needed to edit undz.py and comment the lines 88-90. So, this block should all be commented or undz will fail to extract the boot partitions.
    Code:
                    #if len(dz_item['pad']) != 0:
                    #        print("[!] Error: pad is not empty", file=sys.stderr)
                    #        sys.exit(1)

    To extract, with the KDZ copied to ~/Documents/LG/
    Code:
    cd ~/Documents/LG/kdztools
    ./unkdz.py -f ../V405EBW10e_00_OPEN_EU_DS_OP_0109.kdz -x
    cd kdzextracted/

    List the partitions contents and look for the IDs of boot_a and/or boot_b. In my case they were 44 for boot_a and 63 for boot_b
    Code:
    ../undz.py -f V40510e_00.dz -l
    Extract boot_a or boot_b or both, they're identical:
    Code:
    ../undz.py -f V40510e_00.dz -s 44
    ../undz.py -f V40510e_00.dz -s 63
    You can find the extracted boot images in the dzextracted subfolder. Get boot_a.image or boot_b.image or both from there and send them to the phone in a location accessible by Magisk Manager. The Download folder should do fine.
    Open Magisk Manager and tap Install, select Patch Boot Image file and patch the image file(s) you extracted. Get the patched_boot.img that Magisk Manager saves in the Download folder and send it to a PC where you have adb and fastboot.

    Go to the beginning of the post to the Installing Magisk section.

    Can you please provide us with original boot.img of Pie 20a version.
    It will be helpful in restoring boot image while getting future update.
    It will immensely save data as well as time.

    The peoples like you make the XDA what it is today.
    Thanks :)

    ---------- Post added at 03:35 PM ---------- Previous post was at 03:33 PM ----------

    Forgive my lack of knowledge, but any help is appreciated. I have a LM-V405EBW with Android version 9 (Pie), security patch level 1 July 2019. My software version is V20a-IND-xx. Which patched boot image should I use?

    Pie 20a : https://drive.google.com/open?id=1iJmZV4-t6rBCMve29cqP0wWoWk4gCYB3 <-- this one
    1
    Getting a boot image like that works but I find it stupid to not upload it so that the others don't have to do it. Besides only one model can be bl unlocked so there won't be any model mismatch (except firmware versions but keeping up with them is not that hard)
    1
    Getting a boot image like that works but I find it stupid to not upload it so that the others don't have to do it. Besides only one model can be bl unlocked so there won't be any model mismatch (except firmware versions but keeping up with them is not that hard)

    Or I could find you stupid for not noticing the patched image is in my first post.
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone