[GUIDE][ROOT][BUMP][TWRP] ImageprepGUI: Auto-script GUI Root+Bump+TWRP for LG G3

Search This thread

p4nts

Senior Member
Apr 30, 2011
94
16
Afraid this killed my factory supplied D855 refurb. No boot screen, no LEDs. Messaged OP at start of December, but there was no response.
 
Last edited:

sithi.w

Member
Nov 30, 2015
17
0
Imageprep said TWRP successful, but boot into stock recovery

Hi;

Anyone has some suggestion, please?

In post #920 I asked for some advice about Imageprep's failure to root my LG G3 D855 (Lollipop V21a) because of its failure to capture COM port. However, with Topet2k12001's kind suggestion in post #787, I finally succeeded in rooting my phone using 'https://xdaforums.com/lg-g3/general/guide-root-method-lg-devices-t3129197' by digital-bug (https://xdaforums.com/lg-g3/general/guide-root-method-lg-devices-t3129197). I then continued to use Imageprep to downgrade aboot, laf, and install TWRP; all of which were reported by Imageprep as successful (as evident from the image I posted at https://imgur.com/a/ktbFz). The phone even automatically rebooted (must be via Imageprep's script) into recovery; but instead of being TWRP, it still was merely the LG stock recovery.

Some advice, please?


Remarks:

My Phone: LG G3 D855, 2 GB RAM, 16 GB ROM; Lollipop Version: 5.0; Software Version: V21a-ESA-XX; Kernel Version: 3.4.0.

1) As also mentioned by Topet2k12001 in his post #787, I'm interested in using jac10000's method '[D855] [GUIDE] One Click ROOT+TWRP Recovery for Lollipop Stock Firmware [20H/20P/20G]' at https://xdaforums.com/lg-g3/general/d855-one-click-root-twrp-recovery-t3072767. The reason is that his script looks like that of digital-bug that succeeded in rooting my phone (when serial port cannot be found, digital-bug's script will pause at 'waiting for device', with instruction for user to put the phone into download mode by disconnecting the USB cable and turning off the phone. Then press and hold the volume up and reinsert the USB cable). However, digital-bug does only offer rooting but lacks TWRP nor kitkat stack bootloader in the script, whereas jac10000's script also offers the missing options.
Still, I have some concerns. As far as I observed from jac10000's post; 20H, 20P, and 20G each use different file. Moreover, there is an additional kernel fix file for each 20P, and 20G. Since my phone is 21a, I am not sure is it advisable to try to use jac10000 method? Any expert opinion? If it is expected to be 'reasonably' safe (the probability of unrecoverable hard brick is reasonably low), I'm willing to take the risk.

2) How about AutoRec, as suggested by jac10000 himself? Although, I don't think AutoRec is still available in Play Store, there are quite a few sites that still host it. However, to my knowledge, there are 2 versions of AutoRec for D855 (Lollipop); and I believe that only the older version can be found presently. Anyway, even if the newer version can be located, I'm not sure it will be so up-to-date as to cover Lollipop 21a. Anyone has some suggestion?


Thanks

Best Regards

The following has been added by editing:

Jusf for my curiosity, I just observed that jac10000's method push boot.img to the phone and flash the file (in addition to aboot.img, laf.img, and recovery.img), why Topet2k12001's method does nothing about boot.img?
 

Attachments

  • d855_twrp.JPG
    d855_twrp.JPG
    47 KB · Views: 142
Last edited:

Suncatcher16

Senior Member
Oct 15, 2011
239
21
Kyiv
Samsung Galaxy S9
OnePlus 8
Thank you all, guys, who created this tool! You saved my life with this certificate error!:)
After applying Sharpening Script Mod my phone has booted. Can you kindly explain what is the cause of this error and what this mod do?
I got such a (mis)conception that it changes screen sharpness only))
 

rk2612

Senior Member
Mar 30, 2010
153
41
...
applying Sharpening Script Mod ... what this mod do?

Ever heard of Bump!?

Instead of a signed boot image, LG G3 boot images had a set of characters appended to them and this served as verification for the locked bootloader. SharpeningMod script does what it says but in order to do that it has to unpack and repack the boot image. After repacking, it needs to append these set of characters to the repacked boot image. The developer who discovered this verification process called it Bump! Every time you unpack and repack a boot image for LG G3, you need to do this. This weakness was patched in LP/MM release and to exploit this, you need to have a bootloader from KK, I think.
 
  • Like
Reactions: Suncatcher16

rk2612

Senior Member
Mar 30, 2010
153
41
Thanks for info. Interesting, but I run MM and my bootloader is probably MM too, so it's not gonna work for me.

Should be possible to downgrade to KK bootloader and then upgrade to MM by flashing only the system and boot partitions (...and not the full kdz). Refer some guides here on the forums for how to extract partitions from kdz files. For MM (...not for LP, I think), you'll need to upgrade the modems as well.
 

wrwolf2

Senior Member
Nov 24, 2014
120
22
Ottawa
RESOLVED

QUOTE: " [ANNOUNCEMENT][SCRIPT] Imageprep: One-click solution for TWRP and BUMP v 1.5
Hi Friends,
New version 1.5! Please visit Post #1 "

Please note: POST #153 isn't accurate and no longer updated . we may still want to use deprecated method with imageprep vers. 1.5 , when doing all the works on LG G3 ( for instance when no windows PC is avail. )



UPDATE : to resolve the problem when custom recovery ( i.e: TWRP ) not booting amid boot certificate error or "Secure boot " error; to install/flash TWRP ( custom recovery ) on your rooted handset ( LG G3 ).

ADD/INSTALL autorec for your LG G3 model and according to android version ( e.g: https://apkpure.com/d855-lg-g3-autorec-lollipop/b007.autorecd855. )
RUN AutoRec app and TAP appropriate option then every problem will be sorted , LG G3 will now reboot into custom recovery correctly ( when rooted and after ADDing flashify app or TWRP official app from play store, RUN either app and SELECT reboot into recovery )
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 84
    OWNERS OF OTHER LG G3 VARIANTS ARE WELCOME TO TRY!
    IMAGEPREPGUI: AUTO-SCRIPT (GUI) FOR LG G3
    Tested on: LG G3 D858HK


    FEATURES:
    1. Rooting of your LG G3
    2. Automatic (no-touch) extraction of aboot.img and laf.img from your KDZ or TOT firmware via the KDZ and TOT Extractor Tool by @bullghost
    3. Download and installation of "bump'd" TWRP custom recovery for certain LG G3 models/variants
    4. Sharpening Mod Script of Skin1980 included (to be manually flashed upon reboot to TWRP Custom Recovery) - this will "bump" your Kernel (boot.img) and will apply your desired sharpening level of the LG G3's display
    5. "Bump" your boot.img (as part of the TWRP installation process of ImageprepGUI)
    6. (Experimental): optionally "bump" your "un-bump'd" TWRP custom recovery.img

    REQUIREMENTS:

    1. Installed LG G3 Drivers for your device
    2. Enabled Developer Options and USB Debugging on your LG G3
    3. Backed up all your important files to your external storage or computer
    4. Downloaded a copy of your KITKAT Firmware (in KDZ or TOT format)
    5. Your custom recovery (TWRP) for your respective LG G3 model (Imageprep has download feature but only for certain models)

    DOWNLOAD LINK:

    ImageprepGUI v2.6: "installer" format. Double-click it to run. It will detect any previous installations of ImageprepGUI and delete them (as in ALL files within).

    Imageprep Folder in Google Drive: this contains sub-folders of various LG G3 variants/models where you can manually download aboot.img, laf.img, and "Bump'd" TWRP custom recovery (recovery.img). Users can also download previous versions from here as well as corresponding video tutorials.

    Downloadable Video Tutorial
    Video Tutorial on YouTube

    HOW TO USE:

    1. Navigate to C:\ImageprepGUI and you will see ImageprepGUIvx.x.exe (where x.x is the version number). Run this app. It is recommended that you create a shortcut to your desktop or Windows taskbar for easy access.
    2. Follow the step-by-step instructions.

    DETAILED STEP-BY-STEP (HOW TO USE):

    At the first screen with selections (radio buttons):

    1. Acquire aboot.img and laf.img: you can choose to...
    a. download from my Google Drive, or
    b. have the full KDZ or TOT firmware handy and let ImageprepGUI extract them for you, or
    c. manually run the KDZ and TOT Extractor tool and manually extract them

    IMPORTANT: DO NOT SKIP THIS STEP IF YOU'RE GOING TO INSTALL TWRP. YOU MUST MAKE A SELECTION. SKIPPING THIS STEP IS OKAY IF YOU ARE ONLY ROOTING THE DEVICE.

    2. Acquire "Bump'd" TWRP (recovery.img): you can choose to...
    a. download from my Google Drive, or
    b. have your own "bump'd" TWRP (recovery.img) handy

    IMPORTANT: DO NOT SKIP THIS STEP IF YOU'RE GOING TO INSTALL TWRP. YOU MUST MAKE A SELECTION. SKIPPING THIS STEP IS OKAY IF YOU ARE ONLY ROOTING THE DEVICE.

    At the next page:

    1. You can choose to...
    a. root ONLY (there are 2 methods available), or
    b. skip rooting (if you are already rooted prior) and then proceed to TWRP installation, or
    c. root+install TWRP in one go (there are 2 methods available, since there are 2 ways to root)

    What's new:
    June 24, 2015:
    1. Fixed: COM Port not detected completely (reported by @re_di)
    2. Fixed: pushing of BusyBox and Sharpening Script Mod happens only if user selects rooting, so those who select to ONLY install TWRP will not get BusyBox and Sharpening Script Mod (and without BusyBox, boot.img will not be "bump'd")

    Older versions:

    June 10, 2015:
    1. There's a new rooting method by @digital-bug. It's supposed to address an issue for newer Lollipop firmwares that don't work well with rooting methods that make use of a Linux Shell Script. The effect is the same though. As the author notes, if you are already rooted prior, please DO NOT re-root. If you want to try this new method of if you want to switch between rooting methods, please back up your files and re-flash your device.
    2. ImageprepGUI version 2.5 already includes the new rooting method. Users now have two choices of rooting.
    3. Re-enabled the option for users to try and "bump" their un-"bump'd" TWRP Custom Recovery (recovery.img). This is not a 100% guarantee, but choice is always good so I put it back there.

    June 08, 2015:
    1. GUI Enhancement: added "Select Options"
    2. GUI Enhancement: search for file window (no longer need to navigate to Windows File Explorer to copy-paste Image Files)
    3. Additional options for acquiring KITKAT Image Files (aboot.img, laf.img): users are not tied to only one method of acquiring these Image Files. They can choose to download them or use their own copy
    4. Users can now open a new session of the KDZ and TOT Extractor Tool (for manual operation)
    5. Users can select various options to manipulate how ImageprepGUI will behave to their liking, such as skipping certain sections of the process

    June 01, 2015:
    1. Changed the order of steps. Extraction of firmware (for aboot.img and laf.img) and recovery.img (TWRP "bump'd" custom recovery) come first before rooting and TWRP installation.
    2. Put back "installer mode".
    3. Pushing of files is in GUI mode. Only the actual booting to Download Mode and rooting are the ones that remain in DOS (command line) mode.

    May 26, 2015:
    1. Rooting portion of the script is non-GUI for the moment (GUI is not rooting the device properly and is currently being investigated)2. Disabled "installer" and delivering the file via "zip" file instead (after downloading, extract the entire "ImageprepGUI" folder to your Drive C:\)
    2. Disabled "What do you want to do today?". This means that users will have to go through the entire "complete" process, start-to-finish

    May 22, 2015: addressed (hopefully) an issue where the LG G3's COM port is not detected, causing ImageprepGUI to quit/exit. Please test and let me know if this release works now.


    Update Notes:

    June 10, 2015 Update: ImageprepGUI v2.5 Released

    Thanks to @digital-bug for sharing the new method of rooting the LG G3. This new approach has the same end-result and effect as the existing methods. Where it's different is how it is being executed. Instead of a Linux Shell Script, it makes use of an "indirect" input (like "piping"), as if the user manually entered the command via a keyboard.

    AS ALWAYS, BACK UP FIRST BEFORE TRYING!

    Update Notes for Previous Versions:
    June 08, 2015 Update: ImageprepGUI v2.4 Released
    Thanks for all your feedback and support!

    This new release has some GUI Enhancements as well as an added window: "Select Options". This way, users can now influence how they want ImageprepGUI to behave. For example, if users only want to root their device, they can simply select "Skip this step" under "Image Files Acquisition" as well as "TWRP Custom Recovery Download". Mix-and-match to your liking!

    There is also a new rooting method, which aims to address rooting issues for LG G3's that sport the newer firmware versions. We'll see if this new method can be added to ImageprepGUI.

    Video tutorial is still in the works for this new version. I inadvertently deleted a copy of my LOLLIPOP KDZ firmware so I have to download it again in order to reflash and record a new video.

    June 01, 2015 Update
    :
    ImageprepGUI v2.3 Released

    Again thanks for those who have tried and provided feedback!

    Some users reported that the rooting phase/portion of the script will continue towards completion, even if the device was not booted to Download Mode properly. I have tested since version 2.2 and didn't encounter the issue. Nevertheless, I modified it a bit so that only the rebooting to Download Mode, and the actual rooting, will be run in MS-DOS (command line) mode.

    Also, I have reversed the order of steps. Extraction of image files (from a full KDZ or TOT firmware) as well as TWRP download (or manual copy-paste to the "twrp" sub-folder) will come first. Once these two steps are done, then "Rooting" and "TWRP installation" will be the next steps. This seems to be a more logical order: prepare the needed files first, and then run the rest automatically.

    May 26, 2015 Update
    :
    ImageprepGUI v2.2 Released

    Thanks for those who tried ImageprepGUI (a.k.a. Imageprep v2.0) and for reporting issues with it.

    The rooting script does not run properly in GUI mode. Since I don't want you guys to wait, I stripped down the GUI piece of the "rooting" stage for the meantime until I get it all figured out. There's a lot going on (personal life) at work so I anticipate my progress to be slow.

    Also, I momentarily removed the option of running only portions of the "complete" process. In version 2.2, users will have to go through the entire process from start to finish. I'm going back to the drawing board to design a better flowchart of events so as to further reduce problems that may inadvertently be caused by human error.

    In version 2.2, there is no "installer" mode. It's just going to be a plain ".zip" file. When you open the ".zip" file, you will see a folder named "ImageprepGUI". Extract the folder itself to your Drive C:\ (so effectively, all the contents will go along with it).

    May 11, 2015 Update:
    Back on Track: ImageprepGUI (Imageprep v2.0)

    I've been out for quite a while due to family (personal matters) and work (gunning for a promotion!) and would like to apologize for my absence. But rest assured I continuously worked on Imageprep whenever I had the time. And so, I now present to you ImageprepGUI. This is my first attempt at programming for a GUI app/software so please go easy on this. :)


    DISCLAIMER:

    This product is not an official LG software and is therefore not endorsed by LG Electronics in any way. As such, this is a 'try-at-your-own-risk' approach. Please make sure to back up your important files when trying this for the first time. I take no responsibility for any undue outcomes resulting from the use of this software.

    ABOUT IMAGEPREPGUI:

    Imageprep is NOT a one-click application, and it is intentionally created to be so. Because its objective is to support multiple models/variants of the LG G3, it is developed in a way that the process will pause or exit if something is "off", so expect that there will be pop-up messages every now and then. Think of them as "security measures" to reduce the mistakes from a user point-of-view. In other words, Imageprep takes a balanced approach to automation, features, and "mistake-proofing" in order to provide a virtually seamless experience.

    In order to support multiple LG G3 models/variants, Imageprep involves the ability to download TWRP Custom Recovery (recovery.img) for your specific LG G3 model/variant. If you are not comfortable with what is being downloaded, or if your device is not listed, there is an option to place a copy of your TWRP custom recovery (recovery.img) manually. Other image files (aboot.img and laf.img) will be extracted via the "KDZ and TOT Extractor Tool" which will be done automatically.

    Outside of downloading and/or extracting, the rest of the actual rooting process is done automatically, just like how Imageprep was in its early stages.

    FINAL WORDS:

    Having no prior background in programming, this is my first-ever attempt to create a GUI application. While I have tested this application extensively and to the best of my abilities, nothing is perfect. Hence as a general rule: always back up your important data before embarking on activities such as this!

    Imageprep is continuously evolving and is therefore a work-in-progress so I am open to suggestions, requests to add more LG G3 models/variants, and even small talk via chat or forums. I always strive to visit the XDA forums to respond to queries or Private Messages whenever time allows me.

    I hope this application helps you in every simple way. Enjoy!

    With kind regards from the Philippines,

    - topet2k12001 @xda[/URL]

    CREDITS:

    @Chainfire for SuperSU.
    @autoprime for his tutorial on “Manual Firmware Update” to keep root/”bump’d”, and for guiding and giving clarity by explaining what happens in the background when I conducted my experiment.
    @Skin1980 for allowing me to use the commands from his Sharpening Script Mod (for sharpening options) as well as the commands for "live bumping" ("bumping" on-the-fly) of the boot.img.
    @jcase for putting up the the “Stump” thread. Without “Stump” we would not have enjoyed “root” functionality of the LG G3.
    @thecubed for “Bump”. Such a wonderful tool. It opened the doors of customization for the LG G3.
    @bullghost for the “KDZ and TOT Extractor” tool. This nifty tool allowed us to extract the important components (partitions) of the LG G3’s firmware.
    @mronly1love for “Bump Windows version”. It is through this tool that I was able to “bump” my TWRP 2.8.4.0.
    @hoangnova for his post about the partition layout of the LG G3. It helped me confirm how I should flash aboot.img.
    @itsbighead for his post that helped me understand what aboot.img, laf.img, and sbl1.img meant, and for the same post that explains what causes the LG G3 to boot into an error screen that says “certificate verify”.
    @gzkenny from bbs.gfan.com for “D858HK TWRP 2.8.4.0”. It is a purely Chinese website and I actually spent time understanding everything even with Google Translate. I’m not sure if he/she will able to read/understand this but I thank him/her too.
    @6ril1 for sharing to me how to "bump" a boot.img. Also thanking him for sharing a secret/tip, which actually inspired me to start learning how to program (I'm starting with simple scripts for now). This is the reason why I was able to come up with "imageprep".
    @Unjustified Dev for sharing a method of rooting the Android Lollipop without downgrading to Kitkat.
    @zurny for proof-reading the guide and pointing out clerical errors or any other errors that may cause future problems for the readers.
    @DE52 and @ ravi.vydianathan for spreading the word about this thread and helping to explain the logic to fellow XDA members
    @avicohh for automating the rooting commands via a script
    @jac10000 for modifying the scripted rooting commands to add TWRP
    @somboons for One Click ROOT+TWRP Recovery for Lollipop Stock Firmware
    36
    [ANNOUNCEMENT][SCRIPT] Imageprep: One-click solution for TWRP and BUMP v 1.5

    Hi Friends,

    New version 1.5! Please visit Post #1


    Old/Previous Method is archived below for reference purposes.

    I noticed that some users have some difficulty and/or confusion with manually having to enter commands in the Android Terminal Emulator. Manually having to type commands using a mobile device is not an ideal scenario as it creates opportunities for people to make mistakes. As a result, some of us encounter mishaps like:

    • "Certificate Verify" errors
    • "Security Error"
    • Loss of "Download Mode"
    I thought hard about it and committed myself to making a solution that will somehow automate all of the things we need to do in order to achieve "Bump'd" TWRP and "Bump'd" boot.img. I took effort, as a non-programmer, to read online and learn how to make simple "shell scripts". I learned that you can create a simple file that will contain all the commands needed. This way, we will type or enter only one command in the Android Terminal Emulator.

    I present to you: "imageprep"! (Sorry I can't think of a name, I know it sounds corny...)

    Video Tutorial (includes rooting, how to extract a KDZ, and how to use "Imageprep"...version 1.4 was used): https://mega.co.nz/#!FYNF2Qya!bMo2C4ZzhPEX5dfEXz32rXcajl2e10mKZuyi8MiSyts

    Version Updates

    (March 15, 2015) 1.0: Initial Release
    (March 15, 2015) 1.1:

    • Added requirement for user to make selections: reminder and confirmation for end-user, flashing of Kitkat "entire" Boot Stack or just LAF partition only
    • Added Sharpness Adjustment (selection of sharpness value)
    (March 16, 2015) 1.2:

    • Fixed folder order. Version 1.1 is extracting directly to the Internal Storage. Should extract instead to a folder named "imageprep" (i.e. should be /sdcard/imageprep/(the corresponding sub-folders)
    (March 16, 2015) 1.3:

    • Visual and wording clean-up
    • Found a "bug" where the selected sharpness level does not take effect. Click here for the explanation/finding.
    (March 18, 2015) 1.4:

    • Added security feature: script will check if "Kitkat" image files and custom recovery image file are present in the correct location.
    • Added security feature: Kitkat version laf.img will be flashed by default. This will ensure that once the "bump'd"(signed with Kitkat signature) boot.img is flashed, the device can boot to Download Mode.
    • Sequence of events:
      • Prepare essential files for "bumping" the boot.img
      • A reminder will be shown. You need to confirm that you have read and accomplished all requirements by typing "yes".
      • The script will not believe you. It will still check. If the ".img" files are not in their correct locations, the script will exit.
      • The script will back up your Lolliopop BOOT (kernel), ABOOT (Android Bootloader), LAF (LG Download Mode), and RECOVERY (stock recovery) partitions and will create backups.
      • The script will wipe your recovery partition and will replace it with your "bump'd" custom recovery (TWRP).
      • The script will wipe your stock (Lollipop) ABOOT (Android Bootloader) and LAF (Download Mode) partitions, and will replace them with Kitkat version. This is needed because once the boot.img is bump'd later in the script, it will be signed with a Kitkat "signature" and you will get a "certificate verify" error. Once ABOOT is replaced with a Kitkat version, then the signature that is used to sign (bump) boot.img will now match that of ABOOT, and will therefore "pass" the signature check. You will now be allowed to boot into Android.
      • The script will back up your Lollipop Boot Stack (SBL1, RPM, PERSIST, TZ, AND DBI).
      • The script will let you adjust your preferred sharpness level.
      • The script will "bump" (sign with a Kitkat signature) your boot.img.
      • The script will wipe your BOOT partition and will will replace it with the "bump'd" Lollipop boot.img. Congratulations!
      • "Post-Install option": the script will ask you if you want to wipe your Lollipop Boot Stack partitions and replace them with Kitkat versions. IMPORTANT: select "no" the first time around. Reboot the device and try Download Mode. If it does not work, then it means you need to do this step. Run the script again and when you get to this part of the script, select "yes".
      • Type "exit" to end the script and then reboot via the Power button.
      • For sharpness of display: upon reboot, turn off the display (power button) and then turn on again.
    What does it do (features)?

    • Backup, wipe the recovery partition, and flash a custom recovery (TWRP).
    • Backup, wipe the stock boot.img, "bump" it (credits to @Skin1980 for giving permission to use his original work/commands and @6ril1 for also sharing his version of the commands), and then flash it.
    • Backup, wipe the Lollipop "Boot Stack", and replace with Kitkat "Boot Stack".
    • Allows you to set your preferred display sharpness (with permission from @Skin1980).
    • Allows you to choose whether you want to replace the entire Lollipop Boot Stack with Kitkat, or just the LAF partition (only the Download Mode). Some users reported that they needed to replace the entire Lollipop Boot Stack; some reported that they only need LAF. So I am giving this as an option.
    What are the requirements?

    • A "freshly-flashed" Stock Android Lollipop (either by fully flashing a KDZ or TOT, or by OTA update) - strongly recommended, to ensure that there is no "mix" of Kitkat and Lollipop files
    • Root - please follow the rooting guides from the other threads like this one
    • Extracted Kitkat Boot Stack (aboot.img, dbi.img, rpm.img, persist.img, sbl1.img, laf.img, tz.img) - use the KDZ and TOT Extractor Tool to get them. If you don't know yet how to extract the needed ".img" files, or if you need a refresher, please visit Post #2 of this thread.
    • "Bump'd" TWRP Custom Recovery
    • Android Terminal Emulator
    • Busybox - make sure to open the app and you will see a loading progress indicator at the top portion. Once it completes, please click on "Install" at the bottom portion.
    • Root Checker - to make sure that you have Root and Busybox properly installed
    Where to get a copy and how do I use it?

    • Download it from the attachment of this post
    • Extract it to your Internal Storage (the "main" /sdcard, NOT /external_SD!)
    How to use it?

    • Once extracted, open the folder (the name is "imageprep")
    • You will see more folders and will place the necessary files:
      • "kkimagefiles" - place your extracted Kitkat Boot Stack files here. Make sure that they are named with "kitkat-" before the filename. Make sure also that you not only change the file name, but also the file type (from ".bin" to ".img"). So, your "kkimagefiles" sub-folder should contain the following ".img" files and they should be written like this:
        • kitkat-aboot.img
        • kitkat-laf.img
        • kitkat-dbi.img
        • kitkat-rpm.img
        • kitkat-sbl1.img
        • kitkat-persist.img
        • kitkat-tz.img
      • "limagefiles" - this is empty. The script will back up your Lollipop Boot Stack files and it will place them here.
      • "tmp" - DO NOT TOUCH!
      • "twrp" - place your "bump'd" TWRP Custom Recovery here. Rename it as "twrp.img" (without the quotes).

    • Open Android Terminal Emulator
    • Type the following commands:
    Code:
    su
    sh /sdcard/imageprep/imageprep1.4.sh
    Take note of the command...I always change the filename of imageprep.sh to the latest version. This is to ensure that you won't mistakenly use an old version of the script (Android Terminal Emulator will give you a "Not Found" error). This is intended as a safety feature.

    • The script will run automatically
    • Somewhere along the script, you will be prompted to select your preferred display sharpness (this is the Sharpness Script Mod)
    • Type a value from 0 to 40, where: 0 = disable oversharpening effect; 40 = default sharpness of LG G3
    • Press Enter to apply your selected sharpening level
    • Also somewhere along the script, you will be asked if you wanted to replace the entire Lollipop Boot Stack with Kitkat Boot Stack, or only the LAF partition (laf.img). The LAF partition is the partition that holds the "Download Mode". Some users reported that they needed to replace the entire Lollipop Boot Stack; some reported that they only need LAF. So I am giving this as an option.
    • Select "yes" (without the quotes) to replace the entire Lollipoo Boot Stack with Kitkat. Select "no" (without the quotes) if you want to replace only LAF. If you're not sure, just select "yes". :)
    • Remember: upon reboot, turn off your display (power button), wait for a few seconds, and turn on the display again so that the selected sharpness will take effect
    I have tested this on my LG G3 D858HK, so I need folks who are willing to test this on their respective LG G3 variants and let me know!

    NEW!!! Pre-packed (Repackaged) Imageprep Downloads: some good members of XDA have uploaded Imageprep pre-packed with the needed files for certain LG G3 models/variants. Big thank you!

    30
    1. EXTRACT

    This is a "sub" tutorial or how-to on extracting the necessary image files from an LG G3 firmware (KDZ or TOT)

    In this example, we are extracting Lollipop system.img, boot.img, and modem.img based on the "Kitkat Downgrade" method.
    For the "No Downgrade" (Manual and/or "Imageprep) method, it's the same procedure...only different files to extract.

    1. Extract “system.img”, “boot.img”, and “modem.img” from your Android Lollipop firmware via the “KDZ and TOT Extractor”.
    a. Download the KDZ and TOT Extractor from @bullghost’s thread.
    b. The file is in .zip format. Extract/uncompress it to a folder/location of your choice. This will be your working folder.​
    001%2B-%2BExtract%2BKDZ%2Band%2BTOT%2BProgram.png

    c. Put a copy of your Android Lollipop firmware in the working folder. At this point, the working folder should look like this:​
    002%2B-%2BSet%2Bup%2BWorking%2BFolder.png

    d. IMPORTANT!!!! Make sure that your File Explorer is set up to show “File Name Extensions”. In Windows 8, click on “View” and check “File name extensions”.​
    003%2B-%2BEnable%2BFile%2Bname%2Bextensions%2Bin%2BWindows%2BFile%2BExplorer.png

    e. Run the Extraction Program and select the Android Lollipop firmware.​
    004%2B-%2BRun%2Bthe%2BKDZ%2Band%2BTOT%2BExtractor.png

    f. Extract the contents of the KDZ file. Basically, we want to get the DZ file from within it.​
    005%2B-%2BExtract%2Bthe%2BKDZ.png

    g. Now we will extract the contents of the DZ file. Notice that your working folder will be filled with files, ending in “.bin”.​
    006%2B-%2BExtract%2Bthe%2BDZ.png

    007%2B-%2BWorking%2BFolder%2BFills%2BUp%2Bwith%2BFiles.png

    h. Next is to merge the “system” partial files to create “system.img”.​
    008%2B-%2BMerge%2BSystem%2BPartial%2BFiles.png

    i. The resulting “system.img” file is inside a newly-created sub-folder named “merge-output”.​
    009%2B-%2BResulting%2BSystem%2BFile.png

    j. Copy boot_xxxxxx.bin and modem_xxxxx.bin and paste them inside the “merge_output” sub-folder.
    NOTE: the numbers may vary on different LG G3 variants. It doesn’t matter; just do it!​
    010%2B-%2BExtract%2BModem%2Band%2BBoot%2BImage%2BFiles.png

    k. Rename those files to “boot.img” and “modem.img”. You’re done with Step 1!
    NOTE: If you missed Step 1.d, you will end up renaming only the file name as boot.img or modem.img but the file extension will still be “.bin”. That’s why you need to follow Step 1.d!!!​
    011%2B-%2BRename%2BModem%2Band%2BBoot%2BImage%2BFiles.png

    23
    Troubleshooting and Q&A

    Q: No radio signal (wifi, 2G/3G/4G/LTE)

    A: The Lollipop modem.img was not flashed because you forgot to rename the modem_XXXXX.img as modem.img. Or, you forgot to put modem.img in the "flash2" folder. Remember, the Flash2Modem.zip script is programmed to look for modem.img in the "flash2" folder.

    A: You have various versions (Kitkat and Lollipop) of boot.img, modem.img, and system.img and you accidentally mixed them up. Make sure that you organize your files properly (put them in folders) and then try the process again.

    Q: I get the “certificate verify” error when booting to Android.

    A: The Lollipop boot.img was flashed successfully, but was not “bump’d” because you forgot to flash the Sharpening Script Mod BEFORE booting to Android as per the tutorial. Also, make sure as well that at the end of the Sharpening Mod Script, un-select the box for rebooting. You should reboot from TWRP’s main reboot menu and not from the Sharpening Script Mod.

    A: You have various versions (Kitkat and Lollipop) of boot.img, modem.img, and system.img and you accidentally mixed them up. Make sure that you organize your files properly (put them in folders) and then try the process again.

    A: You got adventurous and flashed the Lollipop aboot.img to the device.
    1. Hopefully you had a “bump’d” TWRP before you followed this procedure.
    2. Extract the Kitkat aboot.img from your Kitkat KDZ (the Kitkat version that you were on prior).
    3. Power off the device.
    4. Boot into TWRP (yes you can boot to TWRP even with that error – as long as you had TWRP installed prior).
    5. Plug the device to your computer. The device will open/show in Windows File Explorer. Transfer the Kitkat aboot.img to your Internal Storage.
    6. Power off and then boot to TWRP again, and then reflash aboot.img.
    7. You may end up booting properly to Android but losing “bump’d” hence, you will lose TWRP. That’s fine.
    8. Assuming you are able to boot properly to Android, install Android Terminal Emulator.
    9. While in Android, install the “bump’d” TWRP via Terminal Emulator, following the steps from the “Bump” thread.
    10. Power off the device and boot into TWRP.
    11. Flash the Sharpening Mod Script. It will “bump” your Lollipop boot.img properly.
    12. Reboot to Android.​
    Q: After following the procedure, the phone boots to LG "Life's Good" but after that, I don't see the splash screen/boot animation. Instead, I just see a black screen with "security error" written in the middle of the screen.

    A: The Lollipop boot.img was not flashed because you forgot to rename the boot_XXXXX.img as boot.img. Or, you forgot to put boot.img in the "flash2" folder. Remember, the Flash2Boot.zip script is programmed to look for boot.img in the "flash2" folder.

    Q: I seem to go into a “boot loop” to TWRP.

    A: Common mistake is that people accidentally flash recovery.img to the “Boot” partition, or flashing boot.img to the “Recovery” partition. Reflash the proper Image file to the appropriate partition. If the problem persists, @autoprime created a flashable zip that will fix this problem.

    Q: I get the “certificate verify” error when booting to Download Mode, or I can’t boot to Download Mode.

    A: You got adventurous and flashed the Lollipop aboot.img, laf.img, or sbl1.img (or other partitions that were not covered in this tutorial) to the device. See long answer from above.

    Q: How do I "bump" my custom recovery (TWRP)?

    A: D858HK users: you can download a copy from the "Requirements" section in Post #1. Popular variants: the more popular variants (like the D855 - International variant) are very well supported; please search for TWRP as a keyword under the LG G3 section. Less popular variants: there are two (2) tools that you can use. One is "Bump Windows version" and another is "Open Bump". It's easy; just drag-and-drop your custom recovery image (TWRP) to bump.exe (for Bump Windows) or open_bump.py (for Open Bump).

    Q: Okay, now I have "bump'd" my custom recovery. How do I install it? I obviously can't flash it via TWRP because I don't have it installed yet.

    A: There are two ways to do it. One is done manually. You need to be rooted (Kitkat) and should have Android Terminal Emulator installed. And then you will have to enter some commands. The other way is to do it via "Flashify" (it's an app). For details and instructions, please visit the official "Bump" thread; Post #1.

    Q: Do I need to have a custom recovery (TWRP) installed? There are not a lot of custom ROMs for the D858HK anyway so it doesn't make any sense.

    A: Yes, you do. Even if you do not intend to install custom ROMs. Installing custom ROMs is just one of the features of a custom recovery such as TWRP, but remember - its main purpose is to provide you with advanced options of recovering your device in the event of a "brick" situation. I have had many instances when I totally "bricked" my device and was saved because I created a full system backup using TWRP. Oh, and make sure that you have installed TWRP and created a full system backup while you are in Android Kitkat!

    Q: Do I need to "bump" my current (Kitkat) boot.img and flash it to the device too, before I follow this tutorial?

    A: So I downgraded back to Kitkat and tried upgrading again. One with a Kitkat "bumped" boot.img, and another without (stock). In both scenarios, the device was upgrade properly (with root, "bump'd" boot.img, and "bump'd" TWRP). I therefore conclude that it doesn't matter. When you update to Lollipop as per this tutorial, you will end up overwriting the Kitkat boot.img with the Lollipop boot.img and "bumping" anyway (at the part where you flash the Sharpening Script Mod).

    Q: There are new threads for rooting Lollipop without downgrading. Here and here. How is your method different?

    A: Yes I have read them as well. Great guides, actually. :) However, those are strictly for rooting only. No custom recovery, no "bump". If you want to maintain "bump'd" boot.img and "bump'd" recovery.img (custom recovery such as TWRP), you will still end up having to follow the steps in this guide - downgrade to Kitkat first, extract Lollipop KDZ firmware, and flash only system.img, boot.img, and modem.img. If you are not tinkering around and are confident enough that you won't do adventurous things with your device, it's okay not to have a custom recovery. Therefore, merely rooting your device would be sufficient. In my case, I have "bricked" my device multiple times and was saved by custom recovery, so I would say I need it.

    I asked the question in one of the threads: http://xdaforums.com/showpost.php?p=59328257&postcount=9

    But eventually, I already saw the answer. Fellow XDA member (Recognized Contributor) @6ril1 also confirms this: http://xdaforums.com/showpost.php?p=59325441&postcount=55
    Bumps (kernel and recovery) needs KK bootloader (aboot partition and maybe others little partitions that constitute bootstack in KK version :aboot,tz,sbl1,rpm,persist,laf,dbi) for booting. And if you downgrade bootstack you have to bump kernel too for being able to boot firmware from KK bootsack.
    You can extract LP recovery(with kdz extractor tool) and reinject it for returning to LP rooted , as you were before trying to inject bumped TWRP, or you can try to downgrade bootstack and bump kernel for being able to use custom recovery on the stock LP.

    So, I created another guide (within this thread - see First Post for the link) on how to achieve that. :)

    Q: After following the how-to guide, I lost my Download Mode! Whenever I try to go to Download Mode, it just hangs and show a "Certificate Verify" error!

    A: This happens when you followed the "No Downgrade" approach and did not flash Kitkat versions of the "Boot Stack" (persist.img, dbi.img, laf.img, sbl1.img, rpm.img, and tz.img). The how-to guide for "No Downgrade" approach has been updated accordingly to include this step. Those who followed the "Kitkat Downgrade" approach do not need to flash these image files anymore because they are already on Kitkat version.

    There is an easy way to do this. XDA member @6ril1 created a TWRP-flashable zip file to automate it. The zip file was originally created for the D855, but you can replace its contents with ".img" files for your LG G3 variant. Just follow the instructions in the link provided.
    18
    3. Flashing

    March 15, 2015 Update: these are the steps from the original "No Downgrade" Manual Approach. There is now an automated script called "Imageprep" that makes the process more convenient for you by entering only a single command in the Android Terminal Emulator. Head over to Post #153 for the details!

    3. Flashing
    a. Power off the device
    b. Boot to TWRP
    i. Press/hold volume down and power.
    ii. At the “LG Life’s Good” boot screen, release for 1 second and then press/hold volume down and power again. You will see a “Factory Reset” screen.
    iii. Select “Yes”. You will do this twice.
    iv. Device will boot to TWRP custom recovery.​
    c. Flash the “.img” files
    i. In TWRP, select “Install”. Look for Flash2System.zip and flash it. This will take some time.
    ii. Repeat for Flash2Boot.zip.
    iii. Repeat for Flash2Modem.​
    d. Flash the Sharpening Mod script. Select your preferred sharpening level. At the end of the wizard, the script will “bump” your Android Lollipop boot.img.
    e. At the screen where it says “Finished”, click “Next”.
    f. In this screen you will be asked to reboot. Un-select the box for rebooting and exit the script! If you do not un-select, it’s possible that TWRP will skip the prompt to install SuperSU!​
    012%2B-%2BSharpening%2BScript%2BMod.png
    g. Exit the TWRP custom recovery by selecting “Reboot” and then “System”.
    h. You will be prompted that “SuperSU is not installed” and you will be offered to install it. Swipe the slider found at the bottom to install it.
    i. It might take a while for the first reboot especially if you have a lot of user apps installed prior.
    j. You’re done. Congratulations!​