yashsingh1/xdaforums huggingface dataset:
[G4 General] divineBliss:
Like you said, this is a G4 thread and you have a V10. Two completely different phones. Unless someone here has a V10, we can't help you. Have you tried V10 threads?
[G4 General] ivangundampc:
I have asked in V10 forum but seems no one has idea on it.

I only want to know why it keeps showing "FAIL". Is it due to my fault or simply that V10 cannot be rooted by this method?
[G4 General] Dysternaut:
Hey all,

I am picking up my new G4 tomorrow. I am planning on waiting with unlocking the bootloader (via official LG tool) untill I am 100% sure everything is top dollar with the phone, and I want to keep it.

However, I cannot live without my root! So I am planning to use this method to gain root. My question is, what software update version should I "stop at" and do the root? I see a lot of versions being thrown around like 10a, 11a, 20a but I am very unsure what they mean. Also, some mention touch issues which are present in some version?! Some people even seem to regret updating to a certain version, and wished they had stayed on an earlier one! So I am very sonfused here!

I know I can't go to 20a (which is first MM version, right?), as root in MM is not an option without unlocking the phone. So what software version is best to use with this method to get a feel for the phone before taking the big step and voiding the warranty? Thanks a lot in advance!
[G4 General] cowsquad:
I just injected root in my verizon phone using this guide.

Unfortunately, my phone got into a bootloop
[G4 General] HIshan Pavidu:
Can i root v20a H815P
[G4 General] Jens1969:
Only if you manage to unlock your bootloader.

@hackarchive: you should fix the op title, since this method does not root marshmallow.
[G4 General] MEGAX91:
[MENTION=2684188]autoprime[/MENTION]

do you have Pre-Rooted System.img for H815P ?

Edit : i managed to access root
[G4 General] Dysternaut:
For the record I ended up going up to version V10d-EUR-XX on my H815 NEU and using this method to root at that software level. Worked like a charm.

Thanks for a great guide! :)
[G4 General] SixStringSW:
Will restoring the system.img (or rootedsystem.img) revert the phone to those states?

A few weeks ago, I rooted my LG G4 (H815) using the technique described earlier in this thread, which creates system.img (pre-root) and rootedsystem.img (post-root) image files. Are these .img files similar to a "ghost" backup on a Windows machine--i.e. a complete snapshot of the device?

1) My Bluetooth has suddenly stopped working. I tried restoring the rootedsystem.img I created when I rooted the phone a month ago, but everything looks exactly the same (same home screens, apps, call logs, SMS logs, etc.), instead of "reverting" to its state a month ago. (Same BT error, too.) That's not what I expected. Shouldn't it look like it did a month ago, or does writing the .img file simply "overlay" what's already there?

2) If I do a factory reset, then write the rootedsystem.img file back to the phone, will the phone be back in the state it was after I rooted it? I

really

don't want to go through 4 months of installing apps, making folders, laying out the screens, etc.
[G4 General] new2city:
Mate, you got the wrong impression of what the system image is. It's not a backup of your setup, just of the system.

No apps settings are saved or effected during the restore and backup of the image.
[G4 General] SixStringSW:
That's what I was afraid of. Is the only way to get a backup of the entire system to use CWM or TWRP? Is it likely that a factory reset would fix the Bluetooth problem (it turns off after about 5 seconds)? Thanks.
[G4 General] divineBliss:
What flavor/model # G4 are you talking about? For Verizon VS986, stop at 13B :) . N/M, I c u said "For the record I ended up going up to version V10d-EUR-XX on my H815 NEU"
[G4 General] Dysternaut:
Hey, thanks for getting back to me!

Yeah, thats where I ended up, at 10d. Is that bad? Would still like to know if I should have upgraded further before rooting.

It's a H815 NEU.
[G4 General] divineBliss:
Dunno anything about that model - I have a VS986 :) .
[G4 General] Dysternaut:
Ah okay, I see. Cheers anyway man. :)
[G4 General] MountainX:
I would like to know how to do this totally on Ubuntu. I don't have a Windows laptop to drag out.
[G4 General] Leavard:
I haven't tried it (I have the opposite problem) but most of the "Windows" steps only use adb. So long as you can get the drivers to work in Ubuntu you should be fine.
[G4 General] player911:
If you factory reset, you will just reset with a stock prerooted out of the box image. Restoring a system image doesnt affect any app data and settings because they are stored on a different parition

A Nandroid backup from TRWP is a "ghost" backup. Restoring a system image is like restoring a back up just the "windows" folder.

I would factory reset though. I can't imagine bluetooth failing because of an app.
[G4 General] SixStringSW:
Would a factory reset be likely to fix the BT problem?
[G4 General] Raffy98:
Hi Guys,

I'm kinda new to the Android rooting world (better late than never :P) and this is my very first attempt rooting a device so below you may read the stupidest question ever asked.

I want to root my LG G4 but I have seen a strange behaviour from the device: before I install the drivers the phone is detected in the My Computer screen, so I can transfer photos and all kind of stuff, but as soon as I install the drivers the phone won't be recognized anymore by the computer and if I go to Device Managment, it is detected as "LGE Android MTP Device" or something like that with the yellow triangle beside it.

The question is: is it normal? And if not, how can I fix this?

I am freaking out on this and some help is really appreciated! :)

Thank you!
[G4 General] reg66:
Did you install latest drivers from lg website?
[G4 General] Raffy98:
Yep, same.
[G4 General] smason:
Could you try this:

http://xdaforums.com/showpost.php?p=60557353&postcount=454
[G4 General] MountainX:
Thank you! I will try it.
[G4 General] Viridian552:
Thank you Dev. Worked like a charm.

H815P (South Africa) on V10h-ZAF.
[G4 General] divineBliss:
If it doesn't, nothing will aside from a new phone or KDZ back to possibly stock.
[G4 General] Raffy98:
I gave up and changed pc (used my laptop), did it and boom... ROOTED!

Thank you so much! :victory:
[G4 General] Thanofski:
Hello everybody.

I just received my g4 and ofc I just can't stay unrooted.

But I'm reading so many different things about rooting this device that got me worried.

My device got MM WITH LG bridge and is currently on v20a.

My phones package above the imei is saying vfd2 (Vodafone branded probably) but there is nothing about the country of origin.the phone model is h815 so I guess it's the European version? Or am I wrong? Dunno...

So am I able to unlock the boot loader and have a safe root???

And if yes what's the best way currently ?
[G4 General] DoughMucker:
Hello,

I'm trying out this root method and not getting it right. Well, at least I don't think I am as I don't get a supersu or superuser app installed after following all the steps. I tried installing SuperSU from the Play Store and it tells me there is no SU binary installed. Hmmm?

I think the injection step is not working for me as my system.img and rootedsystem.img are exactly the same file size. This seems odd given the additional code injected.

Any thoughts on why this would be?

TELUS LG G4 H81210g
[G4 General] cowsquad:
Thank you for sharing this link man. I really appreciate it

---------- Post added at 10:29 PM ---------- Previous post was at 10:25 PM ----------

You are not the only one. I used this guide to inject root,on my system.img and once I installed my rootedsystem.img I end up with a bootloop. I had to go back to stock.
[G4 General] petalex99:
I used this method one month ago on my LG815 european version H81510D_00 and everything works well on my finally rooted phone. I,m wondering too why the system.img and rootedsystem.img are exactly the same size (4.04 GB (4,341,104,640 bytes)) I don't know why but the phone is rooted and everithing is OK.
[G4 General] DoughMucker:
Thanks for replying. Based on that I remounted the rootedsystem.img and had a look through the files. SuperSU was indeed injected and all the links from the injection script were done. So I tried flashing again from a different computer. The flash was instantaneous but upon reboot I had root! I guess the first flash didn't take.

Thanks to those who developed this!
[G4 General] SixStringSW:
Still no joy. How would I "KDZ back to possibly stock"? Can you point me to a tutorial?

Thanks.
[G4 General] woozzy101:
http://xdaforums.com/g4/general/guide-lg-g4-stock-firmware-to-stock-kdz-t3107848
[G4 General] Jens1969:
Partition Size didn't change. It's like a floppy disk: no matter what you store on a floppy, it's still 1.4MB.
[G4 General] smason:
When you buy, for example, an hard disk of 500 Gbytes and copying on it some files, at the end, it will always remain 500 Gbytes before and after your file operation.

The changes are made into the internal filesystem (ext4) of the "hard disk file" called system.img.

So imagining about it in this way: When you have created the file system.img you have made a raw copy of an hard disk.

The root procedure at the end rename the "hard disk file" with rootedsystem.img name.
[G4 General] deltaf007:
me too[emoji3]

Inviato dal mio LG-H815 utilizzando Tapatalk
[G4 General] Jens1969:
I'd go over to LG Dev and try to unlock the bootloader. They will tell you, if your bootloader can be unlocked. If not, you can't root your phone running MM.
[G4 General] deltaf007:
ok , but warranty? it's possible come back?

Inviato dal mio LG-H815 utilizzando Tapatalk
[G4 General] Jens1969:
No. Warranty is void.
[G4 General] Forum#:
Hi guys,

used this method to successfully root my G4 (H815, V10D-EUR).

I kept my old system_img and rooted_img on the phone. Didnt take any OTA update since.

Can i use the same method (dd) to inject my old system image? Are there any consequences?

Forum

---------- Post added at 02:03 PM ---------- Previous post was at 01:56 PM ----------

Maybe a faster choice : can i delete root from the phone using SuperSu option : complete root delete?
[G4 General] SixStringSW:
No /data/0/media folder to copy rootedsystem.img into

I had to factory reset my LG G4. I tried re-running the steps on Page 13 (creating system.img in /data/media/0/, then injecting root, copying rootedsystem.img back into /data/media/0/, etc.), but discovered after the reset that the /data/ folder is empty. I ran the dd command anyway (dd if=/dev/block/mmcblk0 bs=8192 skip=55296 count=529920 of=/data/media/0/system.img), and it created a system.img file in /sdcard/. The /data/ folder is still empty.

Undaunted, I copied that to my computer, injected root, copied it back to /sdcard/ and tried:

dd if=/sdcard/rootedsystem.img bs=8192 seek=55296 count=529920 of=/dev/block/mmcblk0

but it didn't work, immediately bringing up the # prompt as though it failed to find the /sdcard/rootedsystem.img file.

Can anyone help? How can I get the phone to create the /data/media/0 folder again, or get dd to copy the file from the /sdcard/ location?

This is getting to be phenomenally frustrating.
[G4 General] cowsquad:
Where are you,getting sdcard from. It should be /data/media/0 . the instruction are clear in the root all,variants thread. There is a link on the OP page too
[G4 General] SixStringSW:
As I stated, I ran the command exactly as suggested (I copy/pasted it). The system.img file did NOT appear in the /data/media/0 folder (which is empty) but appeared in the /sdcard/ folder. I found it by using searching using ES File Explorer. I'll try again today, see if I can duplicate the problem.

Update: I just ran the process again. I deleted the system.img file from /sdcard/, ran ports.bat, Send_Command, and dd exactly as described via cut/paste, confirmed the output file location (of=/data/media/0/system.img). The system.img file once more reappeared in the /sdcard/ directory and the directory /data/ is still empty.
[G4 General] smason:
When you made rootedsystem.img copy it with adb:

adb push rootedsystem.img /storage/sdcard0

Notice:

- smartphone state in normal boot

- Do not worry about the directory /data/media/0 because is visible in many way and depend also about smartphone state.
[G4 General] SixStringSW:
I already had the rooted image back on the card, in /sdcard (or, if you prefer /storage/sdcard0). Running adb push simply put it back where it already was and the dd command is unable to copy it from there, apparently. Still, I tried it and tried the command: dd if=/storage/sdcard0/rootedsystem.img bs=8192 seek=55296 count=529920 of=/dev/block/mmcblk0 and it still immediately came back with the # prompt.

I followed those exact instructions a month ago (I even bookmarked them, in case I needed them again) and the process went flawlessly. But my Bluetooth died, so I had to factory reset the phone; now those same instructions don't work. I can create the system.img, inject root, but cannot get it copied over the existing image. Maybe I'm missing something obvious . . .
[G4 General] smason:
OK!

Now the inject operation must be done when the smartphone is in "download mode" state and at this level /storage/sdcard0 and /sdcard isn't available.

# dd if=/data/media/0/rootedsystem.img bs=8192 seek=55296 count=529920 of=/dev/block/mmcblk0

if doesn't work, verify the presence of the file with:

# ls -la /data/media/0

then, if it is present

# mv /data/media/0/rootedsystem.img /data/media/0/Download/rootedsystem.img
# chmod 664 /data/media/0/Download/rootedsystem.img
# chown media_rw:media_rw /data/media/0/Download/rootedsystem.img
# chcon "u:object_r:media_rw_data_file:s0" /data/media/0/Download/rootedsystem.img
# dd if=/data/media/0/Download/rootedsystem.img bs=8192 seek=55296 count=529920 of=/dev/block/mmcblk0
[G4 General] aoprea:
Great news from chanfire with root without custom kernels using supersu v2.62-3

is possible to apply root like inserting in lollipop ?
[G4 General] SixStringSW:
Huh, I didn't realize I could use Linux commands via the PC in that manner. (I guess that's what Send_Commands is all about.) I guess the /data/ directory isn't visible without root.

I did #ls -la /data/media/0 while in download mode and saw both system.img and rootedsystem.img were in that directory. Once more I cut/pasted the command #dd if=/data/media/0/Download/rootedsystem.img bs=8192 seek=55296 count=529920 of=/dev/block/mmcblk0 again, and this time it worked! I have absolutely no idea why when I've gone through this process several times over the last 2 days without success. It's as though the phone refused to admit the rootedsystem file was there until I did the ls command!

Anyway, root is now working. Thank you so very much for your time and assistance!
[G4 General] Forum#:
Any ideas?
[G4 General] smason:
Yes. No.

No.
[G4 General] samlooker:
When running ports.bat, I don't have any line that has "DIAG1" in it. All I have is:

E:\lg\LG_ROOT>ports.bat

E:\lg\LG_ROOT>reg query HKLM\hardware\devicemap\SERIALCOMM

HKEY_LOCAL_MACHINE\hardware\devicemap\SERIALCOMM

\Device\Serial0 REG_SZ COM2

E:\lg\LG_ROOT>pause

Press any key to continue . . .

What I did wrong? Please help!

PS. I was able to transfer the rooted system img to the internal storage before I entered DL mode, so the connection is there.

Thanks
[G4 General] Leavard:
I had this as well. DIAG showed up after I installed the latest drivers from LG.
[G4 General] samlooker:
I installed my drivers from LGUnitedMobile_Win_Driver_Ver_3.14.1, where did u get the latest driver?
[G4 General] reg66:
From LG website
[G4 General] Leavard:
From here LG-Mobile-Driver_v4.0.3.0.zip - 10.77 MB
[G4 General] victorinoxs:
Made a stupid mistake for not keeping a backup copy of the original system image. Now I can't install OTA update, and can't find a matching KDZ file to flash, but I still have the rooted system image, is it possible to extract/remove the injected root files, to revert it back to the original state???

Thanks a million!
[G4 General] woozzy101:
Not that I know of. What model number do you have? On Verizon you can just flash newer KDZ file to upgrade software version and then root.
[G4 General] victorinoxs:
Thanks for the quick reply. I bought my G4 second handed, I think it's the Canadian H812 Bell variant. I found firmware of Telus & Rogers variants.....I'm afraid flashing a different version of KDZ file would mess up my phone....
[G4 General] dark.cod:
Dear friends i have a lg g4 h815 sea varrient i really want to root it. Its really bad that lg is not adding unlocking support for other varrients than eur. Someone please guide me how can i root my phone i am totally a noob. I admit that this tut is so easy to understand but bcoz i am a noob so mistakes are must and one mistake in flashing results in a bricked phone i dont want to brick my phone i am a poor guy i can not aford an other phone so please help me friends i just wanted to know does every command that works with eur version will work with sea version? I'll wait for possitive response. And really sorry for my bad english
[G4 General] Leavard:
I have an Australian H815K (Telstra) on 10d which I have been completely unable to root and I'm hoping that you guys can give me a hand figuring out what's going on.

I can pull the system.img ,transfer it to Fedora and run the root injection with no errors and I push the rootedsystem.img onto the phone, but when I try to boot, it gets stuck at the LG logo with the blue LED on and does nothing. When I push the system.img and bot, it goes through the "Android has been updated" thing, which makes it look like something has happened.

It doesn't boot enough to get into ADB to get a logcat. The md5 of the rootedsystem.img is different to the system.img. I think that I can't push the international H815 because it's 10c and I'm on 10d, but I'm happy to be wrong.

Is there anything more that I can do or check?
[G4 General] smason:
Can you show us which commands are you using to get and put the filesystem image?

GET:

dd ...

PUT

dd ...

Please, check if you are using "seek" parameter instead of "skip" during DD PUT operation.
[G4 General] Leavard:
PUT

dd if=/data/media/0/rootedsystem.img bs=8192 seek=55296 count=529920 of=/dev/block/mmcblk0

GET

dd if=/dev/block/mmcblk0 bs=8192 skip=55296 count=529920 of=/data/media/0/system.img
[G4 General] smason:
Please, check if the previous commands set are right for your smartphone. I show you my device but pay attention it is different that yours.

From adb shell (smartphone normal boot state):

$ adb shell

shell@p1:/ $ mount |grep system

/dev/block/bootdevice/by-name/system /system ext4 ro,seclabel,noatime,data=ordered 0 0

shell@p1:/ $

shell@p1:/ $ ls -la /dev/block/bootdevice/by-name/system

lrwxrwxrwx root root 2015-03-20 12:17 system -> /dev/block/mmcblk0p47

shell@p1:/ $

So follow the link ( my device is different than yours, should be another mmcblck0p# )

Notice: Change the directory accordingly with the right link of your device.

shell@p1:/ $ cd /sys/block/mmcblk0/mmcblk0p47

shell@p1:/sys/block/mmcblk0/mmcblk0p47 $

shell@p1:/sys/block/mmcblk0/mmcblk0p47 $ cat start

884736

shell@p1:/sys/block/mmcblk0/mmcblk0p47 $

shell@p1:/sys/block/mmcblk0/mmcblk0p47 $ cat size

8478720

shell@p1:/sys/block/mmcblk0/mmcblk0p47 $

shell@p1:/sys/block/mmcblk0/mmcblk0p47 $
[G4 General] Leavard:
Here it is for my device. The numbers match yours and those in the command.

u0_a202@p1:/ $ mount | grep system

/dev/block/bootdevice/by-name/system /system ext4 ro,seclabel,noatime,data=ordered 0 0

-la /dev/block/bootdevice/by-name/system <

lrwxrwxrwx root root 2015-05-10 18:29 system -> /dev/block/mmcblk0p47

u0_a202@p1:/ $ cd /sys/block/mmcblk0/mmcblk0p47

u0_a202@p1:/sys/block/mmcblk0/mmcblk0p47 $ cat start

884736

u0_a202@p1:/sys/block/mmcblk0/mmcblk0p47 $ cat size

8478720

u0_a202@p1:/sys/block/mmcblk0/mmcblk0p47 $
[G4 General] smason:
OK! Awesome!

So, with the supplied numbers we can create the right commands set:

Starting point (offset) in byte: 884736*512=452984832

Size of the partition in byte: 8478720*512=4341104640

So the right commands set must be:

skip/seek: 452984832/8192=55296

count: 4341104640/8192=529920

Finally ( Yes... they are the same you have used, but we are here to find some mistake, so... ):

GET: dd if=/dev/block/mmcblk0 bs=8192 skip=55296 count=529920 of=/data/media/0/system.img

PUT: dd if=/data/media/0/rootedsystem.img bs=8192 seek=55296 count=529920 of=/dev/block/mmcblk0

Checking steps:

Verify if the obtained system.img is 4341104640 bytes.

Inject again the SuperSU.

Verify if the obtained rootedsystem.img is 4341104640 bytes. Verify also this size remain the same when you put the image into the smartphone.
[G4 General] Leavard:
Both system.img and rootedsystem.img are 4341104640 bytes.
[G4 General] smason:
Are you sure about the size also into the smartphone? Check the space please.
[G4 General] Leavard:
From the phone:

-rwxrwx--- root sdcard_r 4341104640 2015-12-30 02:28 rootedsystem.img

-rwxrwx--- root sdcard_r 4341104640 2015-05-10 18:13 system.img
[G4 General] smason:
OK! All seems right...

Check if your Inject_Root_G4.zip file is the same of my in attachment. Eventually use it for another try.
[G4 General] Leavard:
Both have an md5 of 4e8f831e8e903de57414c3518149e1d2
[G4 General] smason:
OK!

What is your Linux environment?

Is possible that your Linux environment isn't SELinux aware? Please, check if "chcon" command is present.

Running SELinux under a Linux distribution requires three things: An SELinux enabled kernel, SELinux Userspace tools and libraries, and SELinux Policies.

See the attached log procedure with some check at the end.
[G4 General] Spookymyo:
Thanks for this!

I initially rooted 11a with no issues at all.

I finally decided to flash the official 13b kdz. That went perfectly.

But when I tried to dd any of the rootedsystem images floating around, none of them worked. Some would boot but wouldn't act right and some wouldn't boot at all.

This method worked flawlessly.
[G4 General] hesparado:
Thanks. Took me a while to figure out the Ubuntu stuff but got there in the end.

One question though: Do I have to keep the rootedsystem.img file sitting there in my phones internal storage or is it safe to copy to my pc in case I need it again and delete from my phone now?
[G4 General] Rick299:
It is safe to move it.
[G4 General] woozzy101:
But recommended you keep it on your phone in case something goes wrong. Then you can always re flash the image.
[G4 General] divineBliss:
Leave the img file there for a few days/weeks as insurance until you are confident that the phone is stable. After that, move to PC.
[G4 General] @Mir hosiEn:
Works on 815p 20b???
[G4 General] goran_oh:
Only for bootloader unlock.
[G4 General] luusid:
Hey I have already got a rooted g4 on lollipop with a locked bootloader. I have the Taiwan (twn) version and was wondering if I could do a marshmallow root with locked bootloader using a similar method. Or since I have root access can I force unlock the bootloader?
[G4 General] dadrumgod:
God you find a way to force unlock the boot loader please do tell lol oh and Verizon boot loader , I'd pay to get my vw cracked I want some custom roms to play with
[G4 General] luusid:
Lol I'm trash at the whole rooting thing that's why I'm asking. Plus I'm sure there was some Vietnamese team trying to unlock the bootloader but I can't find what they are doing anywhere
[G4 General] dadrumgod:
Hell I thought I was too but I rooted mine on the first try , once you do it you'll be surprised how easy it was just flash a rooted img And take the lazy way like me lol I do wanna try the injection one day just for the experience though
[G4 General] PalmCentro:
This can't be more easy!!
[G4 General] Kaiser Droid:
Confused...

Sorry, just a dumb newbie rooting for the first time.

I'm confused by "Open port.bat and make sure to write down the number after com. There maybe different com numbers but choose the one that has DIAG1 on the same line as it. Note it down this is important. " How exactly do you open port.bat (pictures would be wonderful), and what does it mean? I think the rest of the steps make sense so far.

Thanks in advance.