[G4 Q&A, Help & Troubleshooting] jen.magnolis:
Root your LG G4S (Model H735)

Tested on Andriod 5.1.1.

Thanks goes to [MENTION=4465149]konsolen[/MENTION] for sharing the method to open up the port (see appendix in this post) and to [MENTION=6895020]dominik-p[/MENTION] for his guide to determine dd parameters (you won't need this to root with the method described, but you can back up your phone if you're worried). And most importantly, thanks to the author of SuperSU for his excellent script updater-binary which worked pretty much out of the box, with only a few workarounds needed (which is what the instructions below do).

First, a few general notes:

The supersu.zip included in this package is version 2.46.

SuperSU can be downloaded here: http://download.chainfire.eu/supersu

If you want to use a new version, just put the zip file in this directory and rename it to "supersu.zip" (delete the old one in this package first of course).

The busybox binary in this package was used successfully to unzip in the LG G4s H735 (Android 5.1.1).

Some time it should maybe be ensured that this is the newest version. Same holds for Send_Command.exe and adb.exe (and attached libraries).

This script uses the "update-binary" script of the SuperSU package to install it on your phone.

The scripts I attached prepare for it to be called (hopefully) successfully.

Instructions to root

Preparation

You MAY want to create a backup of your system beforehand, in case things go wrong.

This is optional, so if you don't want to do this, you may still rely on the .kdz file (see Appendix below) to restore your phone if things go wrong.

You need to calculate the dd parameters and then backup your system partition into a .img file.

There is an excellent guide by [MENTION=6895020]dominik-p[/MENTION] for how to determine your individual dd parameters:

http://xdaforums.com/g4/help/how-to-determine-dd-parameters-lg-g4-t3184867

Keep a copy of your system.img somewhere safe, you can use it to restore

your system if something goes wrong.

Enabling developer options and getting the tools

First, enable developer / debugging mode on your phone:

Navigate to Settings > About Phone > scroll to the bottom > tap Build number seven (7) times.

You'll get a short pop-up in the lower area of your display saying that you're now a developer.

Then, go back and now access the Developer options menu, check 'USB debugging' and click OK on the prompt.

Note: You have to enable USB debugging before plugging your device in to the computer. Unplug device then try to enable USB debugging.

On your computer, install Install and Use ADB (the Android Debug Bridge Utility). Also, download LG Flash Tool.

You can find out how to do both by searching google for it.

Step 1.

Connect your phone via USB (not in download mode yet, just normal).

Then, run Init_Root.bat in order to copy the essential files over to internal storage.

You may do this either by 1) double clicking the file, or 2) executing it from the windows command line.

For Option 2): Open a command line in the folder where you extracted this package. To do this, hold shift while right clicking in the folder opened in the Windows Explorer and select "Open command window here". Then, type

Init_Root.bat

Step 2.

Reboot your phone in download mode and ensure it has opened the port to send commands in download mode.

The port is open if it's displayed on the phone's screen in green letters, like

COMX

(with a number instead of X).

On my LG H735 it was necessary to use "LG Flash Tool 2014" http://lgflashtool.com/ to open the port. So if you don't have the green letters, see instruction pasted below (appendix) on how to open the port.

Step 3.

Open a command line in the folder where you extracted this package. To do this, hold shift while

right clicking in the folder opened in the Windows Explorer and select "Open command window here".

Open a command shell to your phone by typing (replace X with the number displayed on your phone) by typing:

Send_Command \\.\COMX

You should be set to root if the following works:

Typing "ls" returns a long list of file and folder names.

Typing "id" should give you someting like that:

uid=0(root) gid=0(root) context=u:r:recovery:s0

The important bits are the "(root)" uid and gid.

If any of the above is not the case, it will not work, you may search for help in the forum.

Step 4.

Execute the commands below (without the numbering of course).

1. mv /data/local/tmp/busybox /sbin/busybox

2. chmod 755 /sbin/busybox

3. mkdir /tmp

4. mkdir /tmp/supersu

5. /sbin/busybox unzip /data/local/tmp/supersu.zip -d /tmp/supersu

6. mv /data/local/tmp/supersu.zip /tmp/supersu/

7. sh /tmp/supersu/META-INF/com/google/android/update-binary dummy 1 /tmp/supersu/supersu.zip

(Note: Not all commands above may be needed, but this is the conservative approach)

Recommended:

Do sanity checks to see if it's doing its job as expected.

After command 2, type the command ls -l /sbin/busybox to check for sanity.

It must return a line like this (with your own date and time):

-rwxr-xr-x shell shell 1048328 <date> <time> busybox

Command 5 must print several lines containing "inflating" messages, similar to this:

Archive:

inflating: META-INF/MANIFEST.MF

...

Command 7 prints lines like this, and other status messages afterwards:

**************

SuperSU installer

**************

...

Step 5.

Your phone should now be rooted if it all worked ok.

You may now type

LEAVE

to reboot your phone.

Happy rooting!

Troubleshooting

If it doesn't work, for example you phone may be stuck on the boot process displaying the LG logo, then you can use Flash Tool to restore your phone. Use instructions below (how to boot the phone into download mode), but don't pull the USB cable, and just let it run its course. This should restore your phone.

If for some reason this hasn't worked, you may try to "dd" back your system .img which you may have created in the preparation step.

Appendix

How to boot the phone into download mode and open the port

a) Boot the LG G4s in download mode. To do this, first switch it off completely and disconnect USB cable. Then, hold the Volume Up button, and while you keep holding it, plug in the USB cable.

b) Start the LG Flash tool and load the .kdz for your phone. We won't actually complete the flashing, you only need it to start the process, but you should use the kdz for your phone nonetheless.

You can check for your kdz on this link, pasting your IMEI instead of YOUR-IMEI in the link below.

http://csmg.lgmobile.com:9002/csmg/b2c/client/auth_model_check2.jsp?esn=YOUR-IMEI

I did not find any for mine there, but I did find it on

http://devtester.ro/projects/lg-firmwares/

Which brought me to this link where I could find mine:

http://pkg02.azure.gdms.lge.com/dn/downloader.dev?fileKey=FW703UV132GQAUP7A0ED99N/H73510c_00.kdz

c) Now this is very important: Watch your phone while the .kdz is being flashed by the flash tool.

(the flash tool may complain about error connecting to the update server, but you can ignore this with "ok").

As soon as the green letters show up, UNPLUG THE USB CABLE!

The percentage on your phone has to be 0% still (never mind about percentage in the flash tool, it may not even display it).

Then, kill the Flash Tool with the Windows Task Manager (Ctrl+alt+delete).

When it's closed, you can plug your phone back in.

It's now in download mode with open port.