Root ANY LG G4 Variant 100% Success Directives | Root Injection | Less Bricks

hackarchive

Senior Member
Mar 15, 2012
987
1,214
133
Qingdao
hackarchive.weebly.com
Hi everyone. As I found out there's root for the G4 but doing this isn't easy especially if your variant is hard to find or has less users. This may result in you waiting for longer than you should. This thread is for those who can take things into their own hands and do it themselves. The tools are available everywhere but I'll give you the best order and steps. I'm using the China LG G4 H818 Dual SIM variant but this method is UNIVERSAL FOR ALL LG G4s.

The process will involve extracting a system image, injecting root and reflashing this image. Most of the steps are effortless and need just copy and paste with keen eyes. Do it slowly. You need an Ubuntu installation for step 2 of this 3-step tutorial. I used universal USB installer and put in on my 8GB USB. Anywhere will do so far as it boots&works. Beware this thread is not dumb-proof but this will not wipe your data or void your warranty if done successfully.

Step 1 -> Getting the proper system image.

Check here and skip to step 3 if you have your rootedsystem.img
>Don't worry because this doesn't require searching. It is from your device. Every device has a system partition and this method will pull it out as an image without root required.

1--Make sure all drivers are installed properly. I'll not be talking about this. We're on XDA not kindergarten.
2--Download the LG_root file or send command file from here and extract it. US Carrier specific check here
3--Put your device in download mode and connect it to your PC.
4--Open(double-click duh) port.bat and make sure to write down the number after com. There maybe different com numbers but choose the com on the
DIAG1 line and write down that number. This is important.
5--Hold shift and right-click in any empty space in the extracted folder. Choose open command windows here.
6-- In that copy and paste this
Code:
[FONT=Lucida Console][COLOR=#ff8c00]Send_Command.exe \\.\COM[/COLOR][COLOR=#00ff00][*insert your number here][/COLOR][/FONT]

7--Now you're in send command mode. Nothing looks different on your phone but that's ok. It should just remain in download mode.
8-- On the computer screen in the window you now see
#.
9--Now in this post copy the Backup system to internal storage command specific to your device model number. Check in you settings >general >about if in doubt. This is the most important step. Copy the whole line of code. Highlight with your mouse, select everything on the line and copy.
10--You didn't come all this way to fail so do it. Remember it is device model specific.
11-- Paste it in the command window and hit enter. It should take a while so wait until you see
#reappear.
12--Now type
LEAVEall in capital letters. Your device will reboot. Check using the file manager if you have a file called system.img in your internal storage. If yes step 2 is next and you did well. If no repeat it and follow the steps properly. Make sure drivers are installed especially windows 10/8/8.1 users. Check device manager


Step 2 -> Root injection.

1--Prepare your Ubuntu USB or virtual machine or computer.
2--Download inject_root zip from here and extract.
3--Copy the system.img from your phone to the extracted inject_root folder on your PC.
4-Reboot into Ubuntu.
5--Here open a terminal.
6--Gain root access on Ubuntu by typing or copy and paste
sudo -i
7--You should either be asked for your password which you have to enter or if you used a USB drive like me you'll see the name change to[email protected]
8--Navigate to the inject_root folder by using cd commands. This can also be done by typing cd then [space] then dragging and dropping the folder into the terminal and hitting enter.
9--You'll now see the name in the terminal become longer with the name of the folder in it.
10--Now type
chmod +x autoroot.sh
11--Hit enter then sudo ./autoroot.sh
12--If you get any thing like command not recognized or something of the sort use sudo sh autoroot.sh
-That worked for me.
13--If you're successful the name of the file should change from
system.img torootedsystem.img
-Please note don't rename the files. Leave them as they are.
14--Now go back to Windows let's finish this.



Step 3 ->Root

1--Transfer the rootedsytem.img to your phones internal storage.
2--Put your phone in download mode and connect it to your PC.
3--Get into send command mode as in step one.
-Put your device in download mode and connect it to your PC.
-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.
-Hold shift and right click in any empty space in the extracted folder. Choose open command windows here.
- In that copy and paste this
Send_Command.exe \\.\COM[*insert your number here]
-Now you're in send command mode. Nothing looks different on your phone but it's find. It should just remain in download mode.

4-Now grab your command to flash system.img line of code from this post. It isn't the same as step one. Copy that an paste in the command window. Make sure it is for your device. They are model specific.
5--This should take a while so wait until you see the # again.
6--After that
LEAVEand upon reboot you should have root.


To Un-root just flash a KDZ file compatible with your device here.

Testimonies

Rooted H812 10g for my fellow Canadians. Enjoy!
https://www.androidfilehost.com/?fid=24052804347821979
This root method works for my G4 purchased in Singapore (H815 SEA)
Thanks to @hackarchive, H818p10f done with tut.
Fantastic. This method will also ease devs for future rooted firmwares. I really cannot see LG being able to patch this, since this is basically a 3rd party LG Flashing tool. If they block this method, then their own tool will ultimately die with it.
Fantastic! I had almost given up hope of root on my EE LG G4. Have just used this method and now rooted perfectly!

hackarchive You rock! Have a thanks!
everything worked fine and i successfully got my g4 rooted
my variant is H815TR
all steps easy only the ubuntu part was a bit hard especially for a windows user ( finding an ubuntu version and usb install etc. not root injection part)
ty ty ty again :))
if it were for me to decide if we should delete the low effort root method, i'd totally delete it.

"The more 'manual', the better"
Only method that roots my device successfully...I updated to 10e of the H815P and using this method (and only this!0 I was able to root my phone...ah felt so good...

The other 1-click rooting methods I came across in other parts of this forum just fail on the G4...


Marshmallow and root situation read here

Hit thanks if you appreciate. Hope I helped.

Credits to them whom without this won't be possible :good:
Thecubed
Team Codefire
ManhIT
 
Last edited:

antus

Member
Mar 15, 2010
41
44
0
This is a good method, thanks for writing this up.

I would like to add a few points....

I recommend you do keep your original system.img on your phones regular internal storage. If you encounter any boot issues you can then re-enter download mode and write the original system.img over the top of the failed root attempt. Use the same command from "step 3: root" but replace rootedsystem.img with system.img. This should still be on your phone from step 1 and will recover your phone from a failed root injection attempt. Note that it will not recover your phone if you messed up the dd command and overwrote other partitons. Be sure to use the right dd command and cut n paste to prevent seek/offset typeos.

I also recommend that you keep a backup of your system.img on your pc. When you run autoroot.sh in step 2 the copy on your pc will be renamed and patched. I suggest copying system.img somewhere else first, or re-copy it off your phone.

Additional credits to blog.lvu.kr. This is the blog of the hobbyist who reverse engineered the download mode protocol, created send_command.exe and gave it to the world. Kudos to you.
 
Last edited:

deboze

Member
Oct 10, 2013
18
5
0
Very nice thread, thank you. The steps were short, few, and fairly concise.
I was waiting for something like this where I could modify my own image and I wouldn't have to wipe everything or replace it with a new image.

One thing you might want to mention is that if your phone is encrypted, you'll need to unencrypt it first.

Can anyone link me to some instructions on how to disable OTA updates for an unlocked/international H815T?
 

the_scotsman

Assistant Forum Admin / Moderator Committee
Staff member
Jan 30, 2006
30,984
24,172
253
NSW, Australia
How is this any easier than the original method....if anything this requires even more work
This is what XDA is all about. It tells you how to inject root into your OWN system image. it's the opposite of spoon feeding. it's about teaching members how to do things for themselves. Too many people come here expecting to be spoon fed and have thigns done for them. This thread teaches people how to do their own work, while learning something at the same time.

Good work OP! :good:
 

hackarchive

Senior Member
Mar 15, 2012
987
1,214
133
Qingdao
hackarchive.weebly.com
This is what XDA is all about. It tells you how to inject root into your OWN system image. it's the opposite of spoon feeding. it's about teaching members how to do things for themselves. Too many people come here expecting to be spoon fed and have thigns done for them. This thread teaches people how to do their own work, while learning something at the same time.

Good work OP! :good:
Thanks. I guess people don't know what XDA is about. Seeing noobs and others trying to spit on hard work when I used my time and device as Guinea pig. Also people don't know this is almost brick-proof because the system image if from their devices. Unless they use wrong commands but all here is just copy and paste. They see lot's of text and get cold feet. Anyways will be updating the OP with system images. If yours is available please share. If you see your image available and you have drivers and LG_root downloaded proceed to step 3.
 

Weetbix

Senior Member
Feb 1, 2010
606
290
0
Kariong
The only downside is that I have to drag out my windows laptop instead of doing everything on the ubuntu machine I use at work.

But if that's the biggest of my problems then I don't really have a problem :)
 
  • Like
Reactions: DsturbD

optiplex2012

Senior Member
May 23, 2012
224
19
0
hi, thx for this tutorial, looks good

when flashing back the rooted img,does it wipe everything ? apps, data ... etc

thx

EDIT: just correct me if im wrong
using this method WILL NOT wipe everything on my device cause im rooting my system with everything on it
correct ???
must make sure before i go ahead

thx
 
Last edited:
  • Like
Reactions: cercelcremene

antus

Member
Mar 15, 2010
41
44
0
Is there a possibility of any personal data being written to /system on a phone during normal use? I can provide 10c Optus AU (carrier 505-02) if I can be sure its not identifying, but ive been using the phone a couple of weeks.

Download link:
https://www.androidfilehost.com/?fid=24052804347799013
 

Attachments

Last edited:
  • Like
Reactions: AUSTAB2012

antus

Member
Mar 15, 2010
41
44
0
using this method WILL NOT wipe everything on my device cause im rooting my system with everything on it
correct ???
correct.

---------- Post added at 06:01 PM ---------- Previous post was at 05:29 PM ----------

Can this be used to inject Xposed as well for those of us with locked BLs.
How to calculator extractly bs/seek/count ?
I would also like to know this. You can resolve system by running the following. Note that this is for the H815T and is not the same on all variants.

# ls -lZ /dev/block/bootdevice/by-name/system

You'll get something like:
lrwxrwxrwx root root u:eek:bject_r:block_device:s0 system -> /dev/block/mmcblk0p47

Which tells you the actual block device (partition its on).

And you can see the size of that with:

# cat /proc/partitions

where you see:
major minor #blocks name
<snip>
259 15 4239360 mmcblk0p47
<snip>

However I dont know how to identify how large a block is or how to calculate the start offset in the main partition.
 
  • Like
Reactions: optiplex2012

psycho_asylum

Senior Member
Jul 10, 2012
283
94
0
Just used flash fire it worked rocking xposed now on 810!
I know it's kind of going off topic, but I figured I'd mention that Flash Fire doesn't work on VS986. It just goes to a black screen and sits there forever. I left it sit for almost an hour. I saw elsewhere it has something to do with automount, I'll have to mess with it further.
 
Last edited: