yashsingh1/xdaforums huggingface dataset:
[G4 General] blake_spector:
I added a picture of 3rd step, the partition images should be in the root of the internal storage and accessible with the stock LG file manager.

I'm not sure what you might have missed, as I composed the guide from a continuous screengrab and video record of me doing the process. :confused:

The dd commands for drm, misc, persistent shouldn't take longer than 1sec (as they are only 8, 16 and 2 MB), the dd command for full_dump (~6 GB) might take a few minutes.

That could be a problem, in my example the internal storage is/was not encrypted!

You could try to use LGUP and refurbish (!) to a fresh starting point (I used this KDZ https://xdaforums.com/g4/general/kdz-firmware-v20j-united-kingdom-2016-t3518925) before doing the process.

OFC backup all your data first, as this will perform a complete reset of the device.
[G4 General] blake_spector:
Yes, the commands are equivalent.

I recommend checking out this post https://xdaforums.com/showpost.php?p=70189981&postcount=12 to find out why! :good:

You should be able to use those dumps for BL relock!
[G4 General] blake_spector:
Sorry, when I posted the guide I forgot an important footnote (now added to OP) . . .

Credit where credit is due! Thanks a lot to [MENTION=447404]OllieD[/MENTION] (https://xdaforums.com/g4/general/relocking-bootloader-t3380781) and [MENTION=7883776]xVANKO[/MENTION] (https://xdaforums.com/g4/general/h815-relock-bootloader-t3506634) for developing the process!
[G4 General] HallEx:
Hello blake !

Thank's a lot for your tutorial ! After this i've try again for make a dump and yes i was on "refurbished" the first times, after check "upgrade" and disconnect the phone at 9% for stay on "COM" everything work ! Just 1-2sec for drm,misc & persistent but more for full_dump ! And yes all the files are in the "root" folder of the phone ! And mine are like yours 2mb, 8mb,.. and more than 5GB for full_dump !

Looks good ! I'm happy now ! Just to wait tomorrow for flash TWRP and test rom because i'm working tonight.. But for the moment i've make 2 copies of all the files in my computer for security.

(sorry if some people don't understand my bad english .. i'm french lol)
[G4 General] Mess35:
Thank you for you answer !

I did a refurbish and flashed 20j KDZ and it works now. Still had to Ctrl + C the first dd but now I can see the img in my internal space.

So happy to finaly unlock the bootloader :D
[G4 General] Minto107:
I've got some questions if you don't mind ;)

1. Is it mandatory to use kdz(in first step)? I think there was other method to get device COM port or its more about LGUP opening that port?

2. Is it safe(I mean no risk of brick) when just dumping the partitions?(if it works like making backup in custom recovery, that would be awesome ;))

3. Is my phone in the same state after using LGUP and unplugging cable at 9% as before using that? Or will it wipe my data/system?

Ill be really thankful if you can answer all of them(or anyone who has already done that ;))
[G4 General] letama:
Well, yes, it's mandatory, and yes, this is because LGUP enables the COM port when you have MM installed. Lollipop doesn't require LGUP, but MM has extra protection and send_command won't work by just booting to bootloader. Except if you know another way to enable the port? I'd be interested to know if such method exists.

Yes, it's safe as long as you don't make any mistake in the dd command. You can do damage if you reverse in and out for instance.

Yes, nothing is modified if you make sure that refurbish is not checked. I forgot the first time, the factory reset is done right away.
[G4 General] Minto107:
Thanks for answers man! One more question about LGUP. What does it do till that 9%? And yeah I checked, that method without using LGUP was used on LP ;)

Wysłane z mojego LG-H815 przy użyciu Tapatalka
[G4 General] blake_spector:
Step 1 circumvents MM security measures to enable the use of send_command.exe!

For that 9%, as far as we should be concernced . . . let's just say it simply enables stuff to follow the steps.

Because I don't have a better answer, see it as "why does the apple fall from the tree - because gravity". ;)
[G4 General] Minto107:
Thanks man ;) tomorrow it's time to give it all a try ;)

Wysłane z mojego Lenovo TAB S8-50LC przy użyciu Tapatalka
[G4 General] xVANKO:
I have already RELOCKED phones with no backup partitions - not only EU variant.

BTW - im still developing app to make this process automated (for all devices listed here: LINK)

---------- Post added at 04:03 AM ---------- Previous post was at 03:58 AM ----------

blake_spector - great job with this tutorial but: you NEED to include 1 VERY IMPORTANT information ;)

Relocking can be done ONLY using the same OS version!!!

In example: if somebody is using v20b, than he unlock his bootloader, flash v20e HE CANT RELOCK BOOTLOADER TILL HE FLASH v20B back- if he try to flash backup files from v20b into v20e rom, he will brick his phone permamently!
[G4 General] ItzShadowz:
I only have my persistent partition backed up. Is it possible to do the steps without the drm and misc files?
[G4 General] Minto107:
That's interesting, you did that by comparing locked and unlocked partitions then modifying unlocked ones to look like locked?

I was thinking about that either... I guess that partitions must match bootloader version. So if I'm on v20g, as I am now, then backup partitions, so they match v20g bootloader and I guess just don't update it. Flashing custom ROM shouldn't do any difference as if Im right, they do not flash bootloader or modem(or at least I hope so)

Wysłane z mojego LG-H815 przy użyciu Tapatalka
[G4 General] hard74:
I got it with your method, I locked my bootloader, but only on the misc, and cust partitions are saved, and then put it back in, and the way the lock works. Isn't it possible that just the misc partition, the close?
[G4 General] Oxious119:
Great guide, worked very well. I had to CTRL+C the first dd command, too. It worked as it should after that, though.

Finally I can block all those pesty ads again and tweak for better battery without fear of warranty loss.

Thanks a lot!
[G4 General] bongster:
Hi there,

I did the dd backup with a lollipop version and the unlock with marshmallow. To relock i need to downgrade to lollipop, right?

Thanks and regards guys!
[G4 General] Oxious119:
If I got it right then the boot loader version you used during backup of the partitions has to match the version you use when reflashing. E.g. you backup using 20g boot loader you can only reflash these partitions to 20g bootloader. But I'm not entirely sure.
[G4 General] Skyrider:
I assume if you have no backup at all, you are unable to revert back to locked? Still reading through all the posts/replies but can't find any specific answer regarding this.
[G4 General] popy2006:
Also no backup of those partitions.

From what ill read they must match the correct firmware and DEVICE-ID?

Can anybody confirm this?

Have unlocked my phone and now i have this ****ty screen burn in of my status bar.

thx

pOpY
[G4 General] Oxious119:
Shouldn't this "burn-in" vanish after some time. It always did on my Nexus4.
[G4 General] popy2006:
Yep, it pops up when ill use the phone more than ~10mins but it vanish if ill play a video.

Is this normal?

PS: Sorry for OT

pOpY
[G4 General] xVANKO:
MISC partition is like "Database of Switches" which contains only 1 stupid switch related to bootloader called "unlocked" - LG employee which created this method of locking bootloader should be fired - but its good for us.

---------- Post added at 09:14 AM ---------- Previous post was at 09:12 AM ----------

CUST partition contains "Unlock Key" which was used in unlocking process. If device detect that there is a valid Unlock Key, it will unlock your device again - so you need to flash CUST and MISC. Persistent partition is not needed.

---------- Post added at 09:19 AM ---------- Previous post was at 09:14 AM ----------

Im finishing my app to relock lg without backup

For screen burning use this app: https://www.androidpit.com/how-to-fix-screen-burn-in

Keep it enabled for 8 hours with max brightness of screen to makes the pixels "exercise" and that's all
[G4 General] popy2006:
Thx a lot, that's really good news regarding Relook!

Will try that display app.

Gesendet von meinem LG-H815 mit Tapatalk
[G4 General] Skyrider:
Sweet, thanks! What are the risks involved doing it without a backup? Do I need the exact same version of android that was installed? Any bootloop chances? And or will I lose eg, the EMEI? I need to know in regards that I need to return the phone, and I merely wish to remove the unlocked bootloader message. Only have a few days left before I need to return it :) so I really appreciate all the help I can get!
[G4 General] ShadowMax Max:
I just wanna ask about H818P/N Bootloader Unlock, Is it Possible, Did you achieved it ??

Hope you did
[G4 General] xVANKO:
yes

---------- Post added at 03:18 PM ---------- Previous post was at 03:16 PM ----------

No risk "probably" ;)

Yes - you need same version of android installed.

No bootloops

No loosing IMEI

Fastboot returns bootloader state "LOCKED" so its not only visual relock
[G4 General] ShadowMax Max:
I can't wait for it man, i hope the release is soon & Thanks for you hard work??
[G4 General] jopyer:
Need Help! MOdel H815

Hello , I can't finish the online bootloader unlocking operation to get the unlock.bin, because of this error mesage ("Device ID is unmatched. Please check your Device ID. Your account will be locked if you enter the wrong Device ID more than 5 times.") showed after pressing the "Confirm" button.The IMEI was introduced correct and it's coincide with the number showed in *#06# and system status. The phone was sealed. Also i am from Republic of Moldova.

Hope you will help me. Thanks!

funkyimg.com/i/2nm3F.png - I have a screenshot
[G4 General] goorek:
Not only imei is needed.
[G4 General] jopyer:
look at the screenshot bro, i put the device id too in the tab without space....
[G4 General] Minto107:
I guess you can't unlock your phone. It's common with G4. You can unlock some and some can't be unlocked. If you enter correct data and still it says that device id is unmatched it might mean that they don't have your device id in database which means you can't unlock your G4

Wysłane z mojego LG-H815 przy użyciu Tapatalka
[G4 General] Spillunke:
Contact the Support. Maybe they can tell you whats wrong while unlocking. I also had problems with unlocking after a repair where they changed the mainboard.

[MENTION=7883776]xVANKO[/MENTION]: How can i support you? Cant wait to relock my phone with your tool. :) Thanks dir your work!
[G4 General] maver77:
I have one question. If I unlock bootloader and after some time i get bootloop, will it be possible to lock it again and send for warranty?
[G4 General] Minto107:
Most likely yes. You can get your phone to freezer for about 8 hours. It will give you about 1 to 2 hours of working time meanwhile you will restore it to stock

Wysłane z mojego LG-H815 przy użyciu Tapatalka
[G4 General] maver77:
did you try it? Won't it damage phone as much as LG can void warranty?
[G4 General] Minto107:
I didn't as I have bootloop free phone. It's 602 so it won't likely loop but look on YouTube. Many ppl done it already so you should be fine ;)

Wysłane z mojego LG-H815 przy użyciu Tapatalka
[G4 General] maver77:
I'm using 507, on reddit and here I read that is isn't so common to bootloop on H815. But in G4 everything is possible.
[G4 General] Minto107:
New G4s has new motherboard, aka 1.2 which doesn't loop anymore. Your is pretty old and it will loop 100%

Wysłane z mojego LG-H815 przy użyciu Tapatalka
[G4 General] equiliym:
This kind of suck, i had bootloop and they told me they changed the board, imei the same, dev-id different and its locked, didnt have time to check yet tho.. Does support actually help regarding this issue?
[G4 General] sperelli:
yes, they do. surely more than with screen issues.
[G4 General] drewster1978:
Lock my bootloader

How much would someone charge me to re-lock my bootloader,i dont want to have a go a brick my phone,im in uk.
[G4 General] Minto107:
only if you have backup of neccessary files. You wont brick your phone unless you write commands in incorrect way or you lose power/connection during flash, but in the both conditions you can always reflash backup files if you notice you're doing it wrong(until you reboot your phone).
[G4 General] sammidrew:
I might have a go,just a shame there isn't software that could do it all for you.
[G4 General] Minto107:
There is nothing that software can do for you [emoji14] look you have to physically unplug phone from computer. Can any software do this for you? Maybe it can be replaced with command like taskkill after a specific period of time but I'm not 100% sure if it would work. The only thing you have to do is 'flash' kdz, at 9% I unplug then enter send command backup 3 partitions and then you're unlocking with official way. I don't think it's that hard ;)

Wysłane z mojego LG-H815 przy użyciu Tapatalka
[G4 General] Ganjax:
Maybe u'll create automatic tool that will do all for us, we're waiting!

Wysłane z mojego LG-H815 przy użyciu Tapatalka
[G4 General] sammidrew:
Maybe i will try.
[G4 General] saksoo:
Hi, is someone preparing a tool for unlocking/relocking or should I go by the manual method ? I cannot wait to unlock and try some custom roms!! Many thanks for your effort guys.
[G4 General] Xetter:
Waiting for xVANKO

Nearly 2 weeks ago, I contacted xVANKO . Asked him if he could help me relocking my phone again (I don't have a backup from the original firmware before unlocking the bootloader). He told me to flash a fresh kdz and make some dumps. Then to let him have this files. I've done all he asked for and sent him 2 PM's since than.

Never recieived an answer again...

:(
[G4 General] Engelm:
Well, we are waiting for two months now.

But maybe he can finish it soon
[G4 General] saksoo:
Yeah or to inform us if he will implement it in the end or not. Otherwise, not to wait all of us and find another way.
[G4 General] drewster1978:
files

Quick question i unlocked my bootloader last yr so havent got the backup files to restore so i can relock my ootloader,how can i do it without the files.
[G4 General] Loulou-13:
:eek: very very big congratulation for to have relocked a bootloader ! Thank so much for this big exploit ! You are a king :good:

If you have a very strong knowledges ,nothing to do with a bootloader.....a big request .

can you find a solution for to have a fm-radio (by the air) for customs roms ? It's a big challenge^^
[G4 General] Minto107:
FM radio? On LG based ROMs you can use stock FM radio app, I even used it, works fine. On lineageOS or AOSP based ROM, install spirit2 app and you will have FM radio back ;)

Unless you meant something else with 'by the air' that I don't fully understand

Wysłane z mojego LG-H815 przy użyciu Tapatalka
[G4 General] saksoo:
According to xVANKO it is possible and he can do it yes, but no news from him yet.
[G4 General] Loulou-13:
Thank for reply ,it'nice ;)

By the air ,i want to say the real fm-radio...not web-radio by datas ..

You can confirm that spirit2 work fine on customs roms ???
[G4 General] Minto107:
I used that for years on my Galaxy S3 with CM10 and 11 so yeah it should work just fine ;)

Wysłane z mojego LG-H815 przy użyciu Tapatalka
[G4 General] re_di:
FM Radio is a big challenge? So how you name unlocking bootloader in LG g4 dual sim (i.e. 818p)? ?

Wysłane z mojego LG-H818 przy użyciu Tapatalka
[G4 General] Xetter:
Quick answer: you can't - right now...
[G4 General] Minto107:
If you wanted to get bootloader unlocked, then I dont know why you bought dual sim variant [emoji14] it's actually cheaper than single Sim on the market :D

Wysłane z mojego LG-H815 przy użyciu Tapatalka
[G4 General] Engelm:
I've bought it because there WAS a solution to root the Phone (Lollipop)

And I've thought that a unofficial BL unlock ist in the way :laugh:

But now...
[G4 General] Minto107:
I felt that it's unlikely and I went with 815 so if I will want, I will unlock it ;) however development on this phone is pretty bad(not a single proper G5 Port while G3 has only G5 based ROMs now) that's why I miss my Samsung phones so bad. You could do everything and LG is limited crap

Wysłane z mojego LG-H815 przy użyciu Tapatalka
[G4 General] re_di:
I've bought it because I have to have dual sim model and because I had LG G3 dual sim, without any problem with unlocking bootloader...

Wysłane z mojego LG-H818 przy użyciu Tapatalka
[G4 General] Minto107:
G3 never got bootloader unlocked. It's just a hack/exploit/glitch that enabled developers to unlock bootloader... Locking bootloader is most stupid thing I have ever came across in Android

Wysłane z mojego LG-H815 przy użyciu Tapatalka
[G4 General] re_di:
Probably you're right, but from my point of view I had TWRP and I was able to flash MM with root

Wysłane z mojego LG-H818 przy użyciu Tapatalka
[G4 General] FreezyExp:
is there also a command to check the path of the external SD?

this might allow flashing the backup back into a bricked phone

sorry for this seemingly dimwitted question, but LS and CD do not seem to work

fortunately I haven't bricked mine, but I was wondering if this was even possible

as when I tried checking for the file sizes I realized the commands were not working.
[G4 General] letama:
Yes, cd is not working, but ls does. You have to give it the full path though.

Unfortunately, external sd is not mounted if I recall correctly, and I couldn't find a way to mount it in bootloader mode. That's why we're saving to internal storage, not external sd.
[G4 General] ceanth:
My G4 bootlooped and LG sent me a new one with bootloader locked so im going to use this method as I can now create the backup files :)

When I want to lock the bootloader back, should I flash stock rom back? Guessing I would need to.
[G4 General] Minto107:
Yeah you should. I would flash kdz before relock and after just to make sure it's all good to go ;)

---------- Post added at 07:45 PM ---------- Previous post was at 07:44 PM ----------

PS. Remember to flash same bootloader and all the stuff that you had before relocking. You need to be on same SW as you were before unlock ;)
[G4 General] ceanth:
I have a question about bootloader. Once I unlock the bootloader and install lineageOS or which ever custom ROM, can I assume that flashing stock ROM back will revert the bootloader back to what it was?

Could I use TWRP to back up the stock setup, then restore it prior to re-locking?
[G4 General] SavageRobot:
No, you flash your stock ROM back. Then you flash these boot image backups to get bootloader back to what it was.
[G4 General] ceanth:
I am slightly confused...

My device currently has V20G-EUR-XX.

If I unlock the bootloader and flash another rom, when I want to re-lock I need to flash V20G-EUR-XX stock rom back on there.

What I don't understand is:

a) Where do I get V20G-EUR-XX from? From all of the download links I can't seem to locate a flashable .kdz. I found reference to 20G on this link but it says its france:

http://storagecow.eu/index.php?dir=Xda/LG+G4/H815/Marshmallow+6.0/

Can I flash any stock rom version back? i.e C, or D and restore bootloader locked status or does it have to match i.e. be G?

b) How do I know what version bootloader I currently have? If I flash a custom rom will my bootloader change? If does then how do I identify which version I currently have and where do I download that from? My understanding that the bootloader version doesn't change
[G4 General] Minto107:
Nah it doesn't work like that. If you only care about AOSP/LOS ROMs then simply do full nandroid of current firmware. When you will want to relock you will flash that nandroid+stock recovery. AOSP/LOS ROMs can't mess your bootloader for sure. I think that LG ones neither as LG doesn't allow to flash bootloader via recovery
[G4 General] dianxxyyzz:
Never mess aboot , you can brick your phone
[G4 General] popy2006:
guys, i have a replaced MoBo and now running stock 20g on my refurbisched H815 Euro.

When i'll enter "adb reboot bootloader" to enter fastboot, to get my device id my phone just restarts?

Also tried with VolUp+Power -> no download mode?

Any hints?

What i am doing wrong.

thx

pOpY
[G4 General] OllieD:
Wrong Thread but i'll assist anyway :P

Bootloader: Device off --> Hold Volume UP & Plug in MicroUSB Cable. (No Power Button)

Fastboot: Requires you enable developer mode and then check "Enable OEM Unlock" in the developer menu.

(Fastboot on stock device is only there to facilitate Bootloader Unlock, No "Enable OEM Unlock", no reason for you to be in Fastboot --> Reboot device)

Also had my device Mainboard Replaced last week. My Phone Bootlooped during my trip to LA with ASUS during the Echo Fox LCS Game :(

Recovered my data by heating the device with a hairdryer, Flashed Stock ROM and relocked my bootloader.

Now have a 701 Mainboard, Lets see how long this lasts!

Thankfully they didnt restore my IMEI so new 701 Mainboard and new IMEI meant i could straight unlock through LGDEV without having to contact them.
[G4 General] Minto107:
They still make new H815s?
[G4 General] OllieD:
I doubt they make new devices, but to not manufacture replacement parts for a device that suffers hardware failure due to a manufacturing defect is not a wise idea.

Especially given the devices in question are covered by a legal warranty against such issues for up to 2 years after sale.

My serial number starts 701 which means January this year, when i warranty checked the IMEI the site claimed my board was only 20 days old.
[G4 General] PinBot01:
Hi, my second 509 series G4 is bootlooped yesterday, today it was totally dead.

I opened it and make it hot with a heardryer. Now it starts and i have backuped my data with TWRP.

I did not create backup files before unlocking the bootloader. Is it still possible to lock the bootloader again?

Or is it now irrelevant for a warranty repair if the bootloader is unlocked?
[G4 General] Doronmak:
Is this will work on the Israeli version?
[G4 General] popy2006:
thx for the hint.

Didnt know that there is such an option :D

now fastboot is working!

pOpY
[G4 General] popy2006:
thx, now i have a backup of my partitions and can relock my BL :D
[G4 General] Minto107:
Yeah it will. LG doesn't give a damn about security or anything related to it :P
[G4 General] Doronmak:
how i get the unlock.bin ?

it will downloaded from the lg site ? (if does the Israeli version will not be can unlocked)

there is any other way to generate this file ? lg doesn't supported lg H815L :(
[G4 General] Minto107:
You must be on compatible H815 phone. Other variants are not supported and I guess will never be unless someone will do some magic and provide you with Unofficial unlock method
[G4 General] FreezyExp:
how abount copying files though the SendCommand (from PC to Android), as during bootloop there seems to be no way of getting files back onto the device.

kdz flashing seems to work (refurbish), but the android upgrade animation from an earlier factory reset still shows up everytime now.

Yeah this thing is dead, but still I like the challenge of figuring out a way to revive it somehow
[G4 General] zavorrax:
The recursive chmod is a bad idea. It would (it did) prevent the access to subdirs and some app (e.g. "DU Disk Usage") can't no longer access it

I solved the problem issuing a chmod -R '777
[G4 General] QualCZ:
Is there any potentionally way to relock bootloader without a backup of partitions? Or with the backup from other H815 EUR? Thx.
[G4 General] Minto107:
Not really. Maybe if someone would send you files but I don't think anyone would as it contains your phone ID etc
[G4 General] Minto107:
Hey guys. I finally unlocked my G4. I made full dump and I would like to flash my old data partition out of it. Can you tell me how to do it?
[G4 General] PinBot01:
Hi, I own 2 LG H815.

From one H815 I have made a backup with these instructions before the Unlock. Can I use this backup to lock the H815, from which I do not have backup files?
[G4 General] Minto107:
Yep. But LG may notice it as they are from other phone