yashsingh1/xdaforums huggingface dataset:
[LG V40 ROMs, Kernels, Recoveries, & Other Developm] iannisb:
HEll

Hello there how are you ?

Today i came accross this problem.

i was listening to music (had installed viper4android through Magisk.)

I went for a run and used a running app to measure distance. The app froze and reboot the phone.

After the rebootthe phone stuck at LG V40 screen so i went into twrp and chose fix recovery bootloop.

The phone booted normally but i lost root , magisk didnt work..

Whenever i flashed magisk again , the phone gets stuck at LG V40 so i have to run ''fix recovery bootloop'' to boot into android..but then i lose root magisk...again!
[LG V40 ROMs, Kernels, Recoveries, & Other Developm] AsItLies:
sorry haven't much of an idea on that, don't use viper4android nor any app to measure distances.

Can you get back to where u were before installing these apps? Always a good idea to do a twrp backup prior to installing, just in case. If u can get back, or start over, do backup and then just one app at a time, to determine which one is problem, assuming it is one of those.

cheers
[LG V40 ROMs, Kernels, Recoveries, & Other Developm] iannisb:
Yes i reinstall android the phone works but i dont have root..

i use viper4android for better musik and runtastik app for running.

i believe it has something to do with magisk and viper4android.

I tried to re do everything.

Flash TWRP in slot A and then android but everytime i flasj Magisk the phone bootloops the LGV40 screen and the only way for the phone to work is to fix bootloop recovery through TWRP.

I dont understand how is it possible that the root was lost in the first place???
[LG V40 ROMs, Kernels, Recoveries, & Other Developm] AsItLies:
Afraid I've no idea. First though, when the phone bootloops, that's obvious, it's a problem. But u say you 'lost root'... how did u check that? How do u know it was 'lost'?

If you're 'starting over', with new flash kdz and flash boot+twrp to correct slot, then we know it will work to flash magisk and dm_verity, it's worked for many many people. Of course it works.

if you're trying to keep things installed, and not formatting, then it's not starting over, it's trying to make something work that hasn't worked. I don't think yer gonna narrow down what the problem is unless go all the way back to beginning.

cheers
[LG V40 ROMs, Kernels, Recoveries, & Other Developm] ctl999999:
I am using V405EBW with bootloader unlocked, just upgraded to 30d firmware. Are the below steps able to flash the twrp without erase the phone apps/data ? I dun care if I can see the data in twrp or not, just wanna keep the old data.

1. Reboot to bootloader

2. fastboot boot judypn_TWRP_bootable-metadata.img

3. install twrp-installer-3.4.0-0-judypn.zip in twrp

4. reboot to recovery once

5. install magisk

6. reboot to system

Thanks a lot.
[LG V40 ROMs, Kernels, Recoveries, & Other Developm] AsItLies:
Good question, don't know. May have to try to find out, be sure to save your original boot partition first, in case u have to revert. (pretty sure the installer zip installs to both a & b boot).

The 'reboot to recovery' prob won't be needed, as that's for recognizing your formatted 'data', which u don't want to do.

So you'd have magisk but couldn't back up data. Worth trying I guess, if it suits yer needs.

cheers
[LG V40 ROMs, Kernels, Recoveries, & Other Developm] sumDewd:
Hi there,

I've been lurking on this thread a while, waiting news on a 10-friendly twrp boot image. I got up to 30c, (ATT model) then that must have been when I unlocked the bootloader and rooted, as I can no longer get OTA updates beyond that.

I was hoping the 30e-twrp boot image provided by @AsItLies would work, but unfortunately the phone hangs at the LG boot logo. I don't suppose anyone would be kind enough to patch a 30c boot image from an ATT device? I couldn't find a tutorial that wasn't a bit over my head :(
[LG V40 ROMs, Kernels, Recoveries, & Other Developm] AsItLies:
Hi, first try this one, it's for 30c but can't remember if that was at&t or not.

It won't hurt anything so long as you remember to backup your current boot image, if it doesn't work after flashing it with qfil, just replace it with original.

This one is at&t 30b and the usual procedure, when a new rom comes out, is to use the previous one (that would be this one), flash it with qfil, then boot straight to recovery. Once in recovery go to advanced and use 'dd' commands to copy the backup you made of 30c boot and copy it back to the boot partition. You can then use the twrp you just booted to 'ramdisk install' twrp to the 30c partition you just dd'd over.

I'll patch yer 30c image tomorrow if the above doesn't get u going.

cheers
[LG V40 ROMs, Kernels, Recoveries, & Other Developm] AsItLies:
Okay, here is your patched boot loader for att 30c.

Remember, flash this with qfil or fastboot, but be sure to then go directly to recovery, don't boot the device. Once in recovery;

1) format (don't wipe) data

2) reboot to recovery

3) flash magisk

4) flash dm-verity

then u should be all set

cheers
[LG V40 ROMs, Kernels, Recoveries, & Other Developm] sumDewd:
Yes! You are the man - thank you!

I was unable to boot using either the 30b or 30c you initially provided. Flashed to both slots, tried alternating active slots but no dice - couldn't boot or get into recovery. The 3rd one (patched from the .img I provided) did the trick.

Like the other guy you helped, I was unable to boot into recovery after flashing that 3rd patched boot, trying both via button method and 'fastboot reboot recovery'. However, I was able to boot the system (after having to adjust active slot) and then 'adb reboot recovery' which got me in.

I will have to say, the V40 is one of the fussier of the handful of devices I've unlocked/rooted/installed custom roms on. This is my second V40...the first one I effectively bricked by doing some stupid stuff after Lineage started acting up. Back on Lineage now and don't think I'll be touching anything for a while!
[LG V40 ROMs, Kernels, Recoveries, & Other Developm] AsItLies:
You're welcome, no probs.

But, a couple of things; It's really easy to go directly to recovery from qfil (after flashing boot image). To get out of qfil you have to press vol dn + pwr, and hold. Continue to hold them until the phone shows the LG screen, then release both buttons and immediately reapply them. Boom, you now have selections to get to recovery, which will be twrp.

The reason you don't want it to boot is that booting could fail, and it could immediately switch slots, and you wouldn't even know it, and it would mark the other slot unbootable.

So, your bricked v40... it's probably not bricked. You almost have to **try** to brick it, to actually brick it. There are specific files you can flash (unbrick files they are called), that will give you download (lg up) mode, and you can flash a kdz and start over.

Yes, treble enabled devices are more complicated. But we have to get used to them, we're not going backwards ;)

cheers
[LG V40 ROMs, Kernels, Recoveries, & Other Developm] AsItLies:
also, this is the procedure to 'unbrick' a v40 - not that hard really.

Use this link to download the needed files, then follow this procedure (directly copied from the v40 tele group - thnks Lucky, SGMarkus, XSavi, etc).

v40unbrick:

Download (https://drive.google.com/drive/folders/1WQaaM35SWiF_UbXAM8hiRB95D2CDkIEq) the backup. Unzip it to find 7 luns (0-6).

1. Open QFIL

2. Select Flat Build

3. Click load xml and select the rawprogram(#) XML that is in the lun(0-6) folder.

4. If it asks you for a patch xml, click cancel. It's not needed to flash this backup.

5. Click download

6. Repeat steps for each lun folder.
[LG V40 ROMs, Kernels, Recoveries, & Other Developm] sumDewd:
Thanks again for the tips - this is my first 'slotted' device and I'm still getting used to it.

BTW, the ATT version does not have .kdz files available like other models. When I attempted to unbrick the first V40 I instead got ahold of the complete set of partion binaries for my build. Flashed all those back via Qfil, save a few partitions that are IMEI or otherwise unit-specific that you need to keep original. I still could not get that to boot. To be fair, I was a doofus and did not back up my own stock partitions, so some of those phone-unique partitions might have been blown away....it's been a while

BUT - I may have missed this 6-step process with the LUNs. I'll check this out down the road for sure. Seems like this method may be a more automated method of flashing the partitions en masse, rather than manually/individually via partition manager...
[LG V40 ROMs, Kernels, Recoveries, & Other Developm] AsItLies:
You're welcome, any time.

Yes, att and sprint, the 2 that don't provide kdz. I can find both Pie and Q for att if you want them. Yes, having the rawprogram xml is a big help. Another tool 'bkerler edl' is a python based tool (it was used to make the backup with the xml), it can be used to flash it back also. I like it much better as it runs under linux.

mainly, don't despair, you basically can't brick a v40, not when you have the firehose.

cheers
[LG V40 ROMs, Kernels, Recoveries, & Other Developm] nikothebarber:
So last my I did something stupid I thought I was working in the same set up as a v 30 and I had formatted the system partition now I have RI Flash the ATT 30 e boot image and now I need to find someone who has the system partition to flash I guess thays what i need so I can have my operating system back to boot
[LG V40 ROMs, Kernels, Recoveries, & Other Developm] nikothebarber:
So I messed up last night and had formatted system partition I need someone who has system. Image partition for ATT 30c to please send it to me so I can have operating system to boot back
[LG V40 ROMs, Kernels, Recoveries, & Other Developm] nikothebarber:
I need system_a.bin but as a img Please for ATT 30c
[LG V40 ROMs, Kernels, Recoveries, & Other Developm] AsItLies:
niko I think Lucky already showed u where to get that right? Remember, qfil backups are always *.bin, but all you have to do is rename it to *.img

it's the same

cheers
[LG V40 ROMs, Kernels, Recoveries, & Other Developm] Hienthecat:
Can you make me a patched boot image for 30f or instruct me on how to patch the boot image with twrp as I have the extracted boot image here
[LG V40 ROMs, Kernels, Recoveries, & Other Developm] AsItLies:
30f what? at&t? sprint? korean open? ebw?
[LG V40 ROMs, Kernels, Recoveries, & Other Developm] Hienthecat:
Sorry, Korea open
[LG V40 ROMs, Kernels, Recoveries, & Other Developm] AsItLies:
Follow this link for that KR Open version 30f with twrp in the boot partition.

cheers
[LG V40 ROMs, Kernels, Recoveries, & Other Developm] Hienthecat:
thank you, you saved my day
[LG V40 ROMs, Kernels, Recoveries, & Other Developm] Hienthecat:
Also, how did you do it, can you show me so that next time I can do it myself ?

Thanks
[LG V40 ROMs, Kernels, Recoveries, & Other Developm] AsItLies:
Sure, be happy to explain it.

Your device (or a device) has to already have twrp working. Once booted into recovery (twrp), you use the dd commands in adb shell (that's part of twrp). Use dd to copy the original boot image to the devices boot partition (so obviously, you overwrite what's there - which means you have to save off what's there prior to overwriting it - also with dd commands).

Now, in twrp, you go to advanced and choose 'inject recovery ramdisk'. Select the twrp.img (where you saved it on your sd card), and then boot a partition will get twrp ramdisk injected into it.

next, use dd commands to save the newly injected boot image and put the old one you saved off back.

here's an example dd command:

dd if=/dev/block/bootdevice/by-name/boot_b of=/dev/block/bootdevice/by-name/boot_a

that copies boot_b image to boot_a image. There are many variations of the dd command you would use depending where the files you're moving are.

cheers
[LG V40 ROMs, Kernels, Recoveries, & Other Developm] Aden82:
Another way of getting a boot.img backup is using the partition backup.apk .

My problem is i crossflashed from 9 us unlocked to 10 verizon i didnt lose fastboot but whenever i booted to fastboot it says erasing and my phone got formatted i managed to patch my boot with magisk and flash it using 9008 mode but can't get to inject my 30b boot.img with twrp.
[LG V40 ROMs, Kernels, Recoveries, & Other Developm] elricwinkler:
Does anyone know how long does it take to boot the ROM? I'm stuck on the Lineage logo for about 15-20 mins several times and it just stays like that.
[LG V40 ROMs, Kernels, Recoveries, & Other Developm] AsItLies:
yeah, that's too long. that's a problem.

when u first boot lineage I believe yer suppose to go to recovery and format data, did u do that?
[LG V40 ROMs, Kernels, Recoveries, & Other Developm] elricwinkler:
Yes, I've tried formatting both slot A and B and then flashing to either A or B, then installing Gapps to the appropriate slot and I never got any of the ROMs to boot

I'm currently trying to get it back to stock with LGUP but I get a cross flash error, is there anyway to avoid it? I don't have access to the original Sprint KDZ
[LG V40 ROMs, Kernels, Recoveries, & Other Developm] AsItLies:
This is from the v40 tele group re lgup and crossflashing issues:

lgup:

Attached zip contains LGUP 1.14

- Uninstall pre-existing LGUP and any dll packages

- Extract the attached zip

- Install LGUP

- Copy the LGUP folder to replace the path LGUP is installed to. Typically it is C:\Program Files(x86)\LG Electronics

Do NOT use the Chip Erase option in LGUP. Recommended options to use are Partition_DL, Refurbish and Upgrade.

LGUP 1.16 is available here (https://drive.google.com/drive/folders/10WbT1fCHNh6UTJxzur9ErOjst_UN3qLm)

- Not suitable for cross-flashing. Stick to 1.14 for that.

- Install the LGUP 1.16 installer and DLL package

- Copy the contents of LGUP116AllOptions.zip to the installation path of LGUP for all options to be available.

Noe note, when crossflashing and using partition download, select all partitions but ftm (don't overwrite that one). Then, after the phone reboots, use lgup again, select same kdz, but do a 'refurbish'. Should be all set after that.

good luck
[LG V40 ROMs, Kernels, Recoveries, & Other Developm] elricwinkler:
Thanks! I actually managed to do it with 1.14 using command line to skip the cross flash error, so I have a working ROM with unlocked bootloader but no Root access yet
[LG V40 ROMs, Kernels, Recoveries, & Other Developm] Cookies_crumbly:
I'm on Lineage 18(Android 11)

Flashed Lineage 18/Gapps successfully

my recovery is on slot b (lineage recovery).

Everything works fine except I cannot install magisk

I tried factory reset and adb sideload but gives me following error:

E:footer is wrong

E:Signature verification failed

Installation aborted

How do I change active slot? or reboot into twrp? or can I disable signature verification?

restarting into bootloader just restarts the phone

restarting into recovery only boot into lineage recovery, not twrp
[LG V40 ROMs, Kernels, Recoveries, & Other Developm] venhow:
Hello man, can you provide a new TWRP for this version? V409N30f_00_LGU_KR_OP_0126

Thnaks a lot...
[LG V40 ROMs, Kernels, Recoveries, & Other Developm] FreeSoftwareServers:
@SGCMarkus I just bought a new V40 which came with Android 8 (Sprint). I unofficially unlocked bootloader and adb is working but when I boot twrp it just boots once (fails) then reboots to OS. Any suggestions?

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot boot TWRP-judypn-boot.img
downloading 'boot.img'...
OKAY [ 1.344s]
booting...
OKAY [ 5.125s]
finished. total time: 6.485s

C:\Program Files (x86)\Minimal ADB and Fastboot>adb reboot bootloader

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot oem unlock
...
FAILED (remote: Device already : unlocked!)
finished. total time: 0.016s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot boot TWRP-judypn-boot.img
downloading 'boot.img'...
OKAY [ 1.253s]
booting...
OKAY [ 5.127s]
finished. total time: 6.397s
[LG V40 ROMs, Kernels, Recoveries, & Other Developm] FreeSoftwareServers:
Does this require Android 9? Guide didn't make that clear? If my goal is LOS should I bother trying to crossflash or just upgrade same firmware to 9? I looked under OTA but no updates available.
[LG V40 ROMs, Kernels, Recoveries, & Other Developm] FreeSoftwareServers:
I cross flashed to 9 then had to nuke LAF and TWRP is booted... only took >10hrs lol, but its a learning curve, Ive only worked w/ Samsung and Pixel devices before. Thanks for all the work!
[LG V40 ROMs, Kernels, Recoveries, & Other Developm] jatanjid:
how to unlock bootloader on lg405qa? step by step
[LG V40 ROMs, Kernels, Recoveries, & Other Developm] jogai:
[GUIDE] Unlock your LG V40 via 9008 mode (Every Variant except T-Mobile)

This Guide will explain how to unlock your LG V40 (Every variant except T-Mobile) Unlock Prerequisites: Make sure you have "Enable OEM Unlock" enabled in developer options, along with adb debugging. Very important. You'll be stuck with the red...

xdaforums.com
[LG V40 ROMs, Kernels, Recoveries, & Other Developm] quearte:
Thanks, but unfortunately for me, that TWRP does not react to touch. Touching screen is missing.

EDIT: you can use a OTG mouse. ;)
[LG V40 ROMs, Kernels, Recoveries, & Other Developm] offremike0887:
Hello. I've been trying to skim on and off for the past 3-4 years and I was hoping someone would have a HELPFUL set of instructions for rooting the T-Mobile V40 (LM-V405TA)?

I've been in and out of XDA since the Note 4, so I know sometimes these threads will have a super straight forward set of instructions and sometimes you'll end up needing 4 different threads in order to do it without bricking your phone.

Oddly, the community for rooting the V40/V50/V60 is lacking now a days. It feels weird to me mainly because the sound quality alone should bring in more people. It's a relatively cheap DAC and DAP that happens to also take pictures, surf the web and makes call at a pretty high rate.

If the issue is more on the LG side when it comes to bootloaders, then I can genuinely say I'm wrong for assuming the community is small for weird reasons but still. Still trying to get T-Mobile to allow me to unlock my Spring V50, but for now I badly want to root and add a custom rom to V40 (V60 doesn't seem to be that amazing DAC wise, but I'd need more documentation on that).
[LG V40 ROMs, Kernels, Recoveries, & Other Developm] quearte:
I just discovered a fix for this.

Go to engineering menu *#546368#*405# (405 is the number of your phone variant, aka 405N)

Go to SVC Menu

Go to MID Info

There you can see and modify IMEI, WIFI MAC, BT MAC... and NT Code.

(is from my V35, but it works for my V40 too)

Check the proper code on the list below for the firmware u got flashed, and overwrite it.

https://drive.google.com/file/d/1QL-DTXcI8iI5d0W0SQ_uA-zUfzvE0_dC/view?usp=sharing

After done, reboot and no more error msg. :)
[LG V40 ROMs, Kernels, Recoveries, & Other Developm] blowtorchhonor:
Guys... I messed up big time. I somehow flashed the v35eng fastboot to seemingly EVERYTHING. The only thing working is edl. List of things I have tried:

Device:

Verizon LG V40 crossflashed to Q via EBW kdz (was working fine prior to this whole s---show)

Flashing in QFIL:

V35eng.img to abl_a

ablpiestock.img to abl_a

pie_abl_a.img to abl_a (From here)

pie_abl_b.img to abl_b (From here)

pie_laf_a to laf_a (From here)

pie_laf_b to laf_b (From here)

Commands I have tried in V35 fastboot (using latest platform-tools):

fastboot boot TWRP-judy-pn-boot.img

fastboot flash abl_a TWRP-judy-pn-boot.img

fastboot reboot (takes me back to fastboot)

fastboot boot_a ablpiestock.img

fastboot flash abl_a ablpiestock.img

fastboot --disable-verity --disable-verification flash vbmeta_a blank_vbmeta.img (unknown option -- disable-verity)

fastboot --set-active=b (unknown option set-active=b)

fastboot getvar all

(bootloader) eio_count:0

(bootloader) dm_count:0

(bootloader) lock_count:0

(bootloader) unlock_count:1

(bootloader) unlocked:yes

(bootloader) off-mode-charge:0

(bootloader) charger-screen-enabled:0

(bootloader) battery-soc-ok:yes

(bootloader) battery-voltage:4209

(bootloader) version-baseband:

(bootloader) version-bootloader:

(bootloader) variant:SDM UFS

(bootloader) partition-type:userdata:ext4

(bootloader) partition-size:userdata: 0xB980F4000

(bootloader) partition-type:system_a:ext4

(bootloader) partition-size:system_a: 0x11B800000

(bootloader) has-slot:modem:yes

(bootloader) has-slot:system:yes

(bootloader) current-slot:a

(bootloader) has-slot:boot:yes

(bootloader) slot-retry-count:b:0

(bootloader) slot-unbootable:b:no

(bootloader) slot-successful:b:no

(bootloader) slot-retry-count:a:4

(bootloader) slot-unbootable:a:yes

(bootloader) slot-successful:a:no

(bootloader) ufs-bootlun:1(a)

(bootloader) slot-count:2

(bootloader) secure:yes

(bootloader) serialno:LMV3501c4e007f

(bootloader) product:QC_Reference_Phone

(bootloader) max-download-size:536870912

(bootloader) kernel:uefi

all:

finished. total time: 0.034s

Key combos I have tried that boot me back into v35 fastboot:

power

power (plus) volume +

volume + (plus) usb

volume - (plus) usb

Other things:

when I tried to boot into download [volume + (plus) usb], the phone says 'your device has failed a routine safety check and will not boot'

EDL still works fine

I also think that I was switching between different USB 2 ports (I ONLY used USB 2 ports)

I tried different cables too: (Samsung OEM [S8 era], Samsung OEM [from Galaxy S20FE], Google Pixel cable [from Google Pixel Buds 2], and an OnePlus Nord N200 cable

What I think the issue is:

I think I accidentally flashed ablstockpie.img to the mpt partition on QFIL.
[LG V40 ROMs, Kernels, Recoveries, & Other Developm] chris_groessler:
Which exact image of TWRP did you use?

I did the same using TWRP-judypn-boot.img and was able to install LOS, but then was in a boot loop where it only booted into TWRP. Couldn't get it to boot the installed system.

And yes, I did it your way because fastboot didn't work/didn't detect the phone.
[LG V40 ROMs, Kernels, Recoveries, & Other Developm] newonsh:
Hi all. Hope someone is still listening. I've read most of this thread but haven't found an answer to my problem and hoping I'll find it. I have a V405UA with the bootloader unlocked. My next step is to get twrp installed and then a custom ROM. I followed this guide and get as far as the ramdisk step. I've copied the twrp boot img to both internal storage and my micro SD but when I press Install ramdisk it brings up a different file system and no matter what folder I search in, I cannot find the file. I also cannot access the micro.sd. What am I missing? I'd greatly appreciate some guidance. Thanks.
[LG V40 ROMs, Kernels, Recoveries, & Other Developm] kuapao:
Hi, I was hoping someone can help me. I feel so silly asking but, what is the difference between the metadata and non-metadata images in the OP? Should I be using one vs the other?

I am trying to install TWRP recovery on my LG LMV405QA. I believe it is correctly bootloader unlocked, and I had restored the abl_a and abl_b backups I took after I flashed v35eng to both and issued the fastboot oem unlock command. When I view the Developer Options, it indicates that bootloader is already unlocked, which is why the Allow OEM Unlock option is grayed out. Additionally, my software info is as follows: Android 9, software version V405QA20e, sec patch level Jan 1, 2020.

The issue I am encountering is, I tried fastboot boot with the metadata image first, but it just boots right back to the OS. Secondly, I tried the non-metadata image, and I finally booted into TWRP but now, when trying to install recovery ramdisk, I am unable to view ANY files on my SD card, and even my internal storage shows 0MB. I have not set any encryption on the SD card, nor have I set up any screen lock fingerprint, pattern, faceid nor PIN.

I am certain it is something I am overlooking. Please excuse my ignorance.