[TOOL] KDZZ - Create Flashable Zip from KDZ Files (DISCONTINUED)

Search This thread

weakNPCdotCom

Senior Member
Aug 16, 2018
514
533
Atlanta

KDZZ - Zip Package Creation Tool
For Building Flashable Zip Packages from KDZ Files

This tool is still in development!
This is an Alpha release and there may be bugs.


UPDATE 3/31/2019
Due to a recent KDZ format change, I've hit a wall in the development of this tool.
I started implementing native KDZ and DZ extraction using IronPython.
However, IronPython does not support Python3 which is required in order to properly extract the new KDZs.
With this being said, I am going to start development of a new cross-platform utility, and development of KDZZ will be discontinued.

I apologize for any inconvenience. This tool will still work as designed for old-format KDZs, and I will leave the repo online.
But I will not be working on this utility any longer.
-weakNPCdotCom



Supported Devices
  • H872
  • H930ds
  • H932

Not Supported
  • LG Aristo 3

*Unfortunately, some models like those listed above are not going to be compatible with this program using the procedure documented below.
The KDZ for these models contains persist and/or vendor images that are split into multiple chunks like the system image. The firmware extraction tool used only has the ability to merge system chunks.
If you are able to find a way to merge the persist/vendor binaries into one bin file, then it will work using the merged bin. However, that is above my skill level.


Requirements
  1. Windows PC
  2. H872 or H932 KDZ File you wish to create a package from
  3. Windows LG Firmware Extract Tool
Installation

- Extract the contents of the KDZZ zip file to the directory of your choice.


In Development
  1. Native KDZ/DZ Extraction
  2. System.img extract/repack

Usage Instructions
  1. Extract KDZ Using Windows LG Firmware Extract
    • Set your working directory (i.e. C:UsersJDOEDesktopKDZFiles)
    • Extract the DZ file from the KDZ
    • Extract the bins from the extracted DZ file
    • Merge the extracted System bins
  2. Run KDZZ
    • Open CMD in Windows
    • cd to KDZZ.exe directory or type
      [path to KDZZ.exe] -p "[destination project directory path]" -b "[path to extracted kdz files]"
    • Example: C:UsersJDOEKDZZKDZZ.exe -p "C:UsersJDOEDesktopH87220f" -b "C:UsersJDOEDesktopKDZFiles"
    • Hit enter and follow the prompts

Download
View Source

Additional Information
  • KDZZ uses a JSON file "firmware.json" in order to dynamically build an updater-script and Zip package.
  • Ideally, data can be added to the JSON file to allow support for additional devices.
  • The JSON breaks down the primary file groups such as: bootloader, modem, dlmode/recovery, etc.
  • It also specifies which of them do not have a "bak" partition.
  • To add support for an LG device not listed, you can add another JSON object for your model to this file.
Code:
{
  "devices": [
    {
      "model": "h872",
      "bootloader": [
        "aboot",
        "apdp",
        "cmnlib",
        "cmnlib64",
        "devcfg",
        "factory",
        "hyp",
        "keymaster",
        "msadp",
        "pmic",
        "raw_resources",
        "rpm",
        "sec",
        "tz",
        "xbl",
        "xbl2"
      ],
      "modem": [
        "modem",
        "persist",
        "rct"
      ],
      "primary": [
        "boot",
        "system"
      ],
      "dlmode_recov": [
        "laf",
        "recovery"
      ],
      "nobak": [
        "apdp",
        "factory",
        "sec",
        "boot",
        "system"
      ]
    }
}

I hope you find this tool helpful. If anybody has any issues with it, please contact me by PM or open a new issue in GitHub.


XDA:DevDB Information
KDZZ, Tool/Utility for the T-Mobile LG G6

Contributors
weakNPCdotCom
Source Code: https://github.com/adanvdo/KDZZ


Version Information
Status: Alpha

Created 2019-02-20
Last Updated 2019-03-31
 

Ken C

Senior Member
Mar 5, 2011
848
184
Samsung Galaxy S10
Very cool.

I'll be playing with it. I'm fairly sure I can follow those instructions (not gonna lie, they'll be a learning curve) now to get the wife off my pc to try it out. Lol... Girl fried hers using the wrong cable. I'm liking this though. Have you been talking with nak3d? Last I spoke to him he was working on something like this also, or y'all are in cahoots or something. I do like how your able to work on any device in there.

Again, very cool I'll throw you some feedback when I get a chance to work with it. Stay cool man

Sent from my LG-H872 using Tapatalk
 
  • Like
Reactions: weakNPCdotCom

weakNPCdotCom

Senior Member
Aug 16, 2018
514
533
Atlanta
Very cool.

I'll be playing with it. I'm fairly sure I can follow those instructions (not gonna lie, they'll be a learning curve) now to get the wife off my pc to try it out. Lol... Girl fried hers using the wrong cable. I'm liking this though. Have you been talking with nak3d? Last I spoke to him he was working on something like this also, or y'all are in cahoots or something. I do like how your able to work on any device in there.

Again, very cool I'll throw you some feedback when I get a chance to work with it. Stay cool man

Sent from my LG-H872 using Tapatalk

I will try to post some more detailed documentation today. I was in a rush to get this thing published since it has taken me so long.

No, I didn't work with running on this one. His utility works differently. He actually uses the OTA update files and extracts the update information. My tool creates the entire firmware package without laf and recovery.

You can choose to build a bootloader, modem, fullstock or laf zip package. What it actually does in the background is rename all the bins, arrange them according to the package you want, build the updater script and zip it all up.

Now that the hard part is done I can just work on making it more user friendly and adding features.
 

Ken C

Senior Member
Mar 5, 2011
848
184
Samsung Galaxy S10
@weakNPCdotCom
Very cool man. I was trying to pull that F version you have but it kept stopping at 87% the way it would be cool to just update. I've subscribed to this thread so I'll keep an eye on what your up to

Sent from my LG-H872 using Tapatalk
 
  • Like
Reactions: weakNPCdotCom

weakNPCdotCom

Senior Member
Aug 16, 2018
514
533
Atlanta
working for h930ds aka lg v30 plus
awesome!

How to create firmwire json file for lg v30
the provided firmware json file already includes an h932 entry for the v30. I cannot guarantee that it will work for any other model, but it should.

Quick Steps for creating a firmware entry in firmware.json (After extracting all of your KDZ files and merging the system image...)
  • Ignore the following .bin files
    • PrimaryGPT_X.bin
    • System_XXXXXX.bin
  • Each .bin file represents a block that will be flashed. You may need to do a little research to find out which binaries are a part of your bootloader and which are a part of your modem.
    bins.jpg
  • Take the name only from the .bin file, and add it to the corresponding group in the json file. For example: for the file "persist_68742.bin" (your filename may vary) you would add a "persist" to the modem group since we know belongs with the modem firmware.
  • the entries boot and system will always go in the "primary" group
  • any .bin file that does not also have a "bak" version (i.e. factory_XXXX.bin does not have a corresponding "factorybak_XXXX.bin" file) should be added to the "nobak" group so the program knows we do not need to flash factorybak as it doesnt exist.
  • laf and recovery should always go in the "dlmode_recov" group. We do not want these partitions to be accidentally flashed due to them being placed in the wrong group.
  • the resulting firmware entry for the h932 would be
    Code:
    {
          "model": "h932",  // or the model number/name of your device
          "bootloader": [
            "abl",
            "apdp",
            "cmnlib",
            "cmnlib64",
            "devcfg",
            "factory",
            "hyp",
            "keymaster",
            "logfs",
            "msadp",
            "pmic",
            "raw_resources",
            "rpm",
            "sec",
            "storsec",
            "tz",
            "xbl"
          ],
          "modem": [
            "modem",
            "persist",
            "rct"
          ],
          "primary": [
            "boot",
            "system"
          ],
          "dlmode_recov": [
            "laf",
            "recovery"
          ],
          "nobak": [
            "apdp",
            "factory",
            "sec",
            "boot",
            "system"
          ]
     }

As i said, the existing entry for the h932 should work for your v30. Definitely make a backup before trying to flash any package created.
As more devices come out, i will try to add additional entries to the firmware file.
 
Last edited:

weakNPCdotCom

Senior Member
Aug 16, 2018
514
533
Atlanta
Is it possible mod also original system.img?

This app wont modify the system.img file. However, if you modify it with another program (i.e. debloat it or something) just replace the system.img file in the directory where your bins were extracted with the modified version and it will be used in the zip.

I can look into adding options for modifying the system image. I dont think it would be difficult
 
Last edited:
  • Like
Reactions: Markosv76

Markosv76

Senior Member
Mar 15, 2016
158
82
Pinerolo
This app wont modify the system.img file. However, if you modify it with another program (i.e. debloat it or something) just replace the system.img file in the directory where your bins were extracted with the modified version and it will be used in the zip.

I can look into adding options for modifying the system image. I dont think it would be difficult
I modify system.img removing app and add app, I repack system.img and put into the zip, but if I repack sparse system.img the flash don't works, if repack in ext4 the flash is ok but I take bootloop, for this I asked you for this, or if you know to unpack, modify and repack properly
 

weakNPCdotCom

Senior Member
Aug 16, 2018
514
533
Atlanta
I modify system.img removing app and add app, I repack system.img and put into the zip, but if I repack sparse system.img the flash don't works, if repack in ext4 the flash is ok but I take bootloop, for this I asked you for this, or if you know to unpack, modify and repack properly

I can look into it, no problem. In the mean time, have you tried using a kitchen like the free version of superr's kitchen to unpack/modify/repack the image?
 

weakNPCdotCom

Senior Member
Aug 16, 2018
514
533
Atlanta
No i used imageextractor, I never used a kitchen, superR is free only for Linux or also for Windows?
I think that your tool work on h870

I think the free version is only available for linux.

I cannot guarantee when, but I will add the ability to extract/repack a system image in the future. The first thing I want to do is add kdz/dz extraction to the program to eliminate the need for the windows lg extract tool. Then i will start working on other features.
 
  • Like
Reactions: Markosv76 and Ken C

Markosv76

Senior Member
Mar 15, 2016
158
82
Pinerolo
I think the free version is only available for linux.

I cannot guarantee when, but I will add the ability to extract/repack a system image in the future. The first thing I want to do is add kdz/dz extraction to the program to eliminate the need for the windows lg extract tool. Then i will start working on other features.
Great, and thanks!!!
 

Top Liked Posts

  • There are no posts matching your filters.
  • 12

    KDZZ - Zip Package Creation Tool
    For Building Flashable Zip Packages from KDZ Files

    This tool is still in development!
    This is an Alpha release and there may be bugs.


    UPDATE 3/31/2019
    Due to a recent KDZ format change, I've hit a wall in the development of this tool.
    I started implementing native KDZ and DZ extraction using IronPython.
    However, IronPython does not support Python3 which is required in order to properly extract the new KDZs.
    With this being said, I am going to start development of a new cross-platform utility, and development of KDZZ will be discontinued.

    I apologize for any inconvenience. This tool will still work as designed for old-format KDZs, and I will leave the repo online.
    But I will not be working on this utility any longer.
    -weakNPCdotCom



    Supported Devices
    • H872
    • H930ds
    • H932

    Not Supported
    • LG Aristo 3

    *Unfortunately, some models like those listed above are not going to be compatible with this program using the procedure documented below.
    The KDZ for these models contains persist and/or vendor images that are split into multiple chunks like the system image. The firmware extraction tool used only has the ability to merge system chunks.
    If you are able to find a way to merge the persist/vendor binaries into one bin file, then it will work using the merged bin. However, that is above my skill level.


    Requirements
    1. Windows PC
    2. H872 or H932 KDZ File you wish to create a package from
    3. Windows LG Firmware Extract Tool
    Installation

    - Extract the contents of the KDZZ zip file to the directory of your choice.


    In Development
    1. Native KDZ/DZ Extraction
    2. System.img extract/repack

    Usage Instructions
    1. Extract KDZ Using Windows LG Firmware Extract
      • Set your working directory (i.e. C:UsersJDOEDesktopKDZFiles)
      • Extract the DZ file from the KDZ
      • Extract the bins from the extracted DZ file
      • Merge the extracted System bins
    2. Run KDZZ
      • Open CMD in Windows
      • cd to KDZZ.exe directory or type
        [path to KDZZ.exe] -p "[destination project directory path]" -b "[path to extracted kdz files]"
      • Example: C:UsersJDOEKDZZKDZZ.exe -p "C:UsersJDOEDesktopH87220f" -b "C:UsersJDOEDesktopKDZFiles"
      • Hit enter and follow the prompts

    Download
    View Source

    Additional Information
    • KDZZ uses a JSON file "firmware.json" in order to dynamically build an updater-script and Zip package.
    • Ideally, data can be added to the JSON file to allow support for additional devices.
    • The JSON breaks down the primary file groups such as: bootloader, modem, dlmode/recovery, etc.
    • It also specifies which of them do not have a "bak" partition.
    • To add support for an LG device not listed, you can add another JSON object for your model to this file.
    Code:
    {
      "devices": [
        {
          "model": "h872",
          "bootloader": [
            "aboot",
            "apdp",
            "cmnlib",
            "cmnlib64",
            "devcfg",
            "factory",
            "hyp",
            "keymaster",
            "msadp",
            "pmic",
            "raw_resources",
            "rpm",
            "sec",
            "tz",
            "xbl",
            "xbl2"
          ],
          "modem": [
            "modem",
            "persist",
            "rct"
          ],
          "primary": [
            "boot",
            "system"
          ],
          "dlmode_recov": [
            "laf",
            "recovery"
          ],
          "nobak": [
            "apdp",
            "factory",
            "sec",
            "boot",
            "system"
          ]
        }
    }

    I hope you find this tool helpful. If anybody has any issues with it, please contact me by PM or open a new issue in GitHub.


    XDA:DevDB Information
    KDZZ, Tool/Utility for the T-Mobile LG G6

    Contributors
    weakNPCdotCom
    Source Code: https://github.com/adanvdo/KDZZ


    Version Information
    Status: Alpha

    Created 2019-02-20
    Last Updated 2019-03-31
    2
    Very cool.

    I'll be playing with it. I'm fairly sure I can follow those instructions (not gonna lie, they'll be a learning curve) now to get the wife off my pc to try it out. Lol... Girl fried hers using the wrong cable. I'm liking this though. Have you been talking with nak3d? Last I spoke to him he was working on something like this also, or y'all are in cahoots or something. I do like how your able to work on any device in there.

    Again, very cool I'll throw you some feedback when I get a chance to work with it. Stay cool man

    Sent from my LG-H872 using Tapatalk

    I will try to post some more detailed documentation today. I was in a rush to get this thing published since it has taken me so long.

    No, I didn't work with running on this one. His utility works differently. He actually uses the OTA update files and extracts the update information. My tool creates the entire firmware package without laf and recovery.

    You can choose to build a bootloader, modem, fullstock or laf zip package. What it actually does in the background is rename all the bins, arrange them according to the package you want, build the updater script and zip it all up.

    Now that the hard part is done I can just work on making it more user friendly and adding features.
    2
    making progress with the kdz extraction. should have that working soon. then I will start working on the ability to extract and repack the system image
    2
    No i used imageextractor, I never used a kitchen, superR is free only for Linux or also for Windows?
    I think that your tool work on h870

    I think the free version is only available for linux.

    I cannot guarantee when, but I will add the ability to extract/repack a system image in the future. The first thing I want to do is add kdz/dz extraction to the program to eliminate the need for the windows lg extract tool. Then i will start working on other features.
    1
    Very cool.

    I'll be playing with it. I'm fairly sure I can follow those instructions (not gonna lie, they'll be a learning curve) now to get the wife off my pc to try it out. Lol... Girl fried hers using the wrong cable. I'm liking this though. Have you been talking with nak3d? Last I spoke to him he was working on something like this also, or y'all are in cahoots or something. I do like how your able to work on any device in there.

    Again, very cool I'll throw you some feedback when I get a chance to work with it. Stay cool man

    Sent from my LG-H872 using Tapatalk