FORUMS
Remove All Ads from XDA

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

383 posts
Thanks Meter: 338
 
By weakNPCdotCom, Senior Member on 20th February 2019, 09:18 PM
Post Reply Email Thread
Announcement from weakNPCdotCom: New Tool for Building TWRP Zips from KDZ Files

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
The Following 9 Users Say Thank You to weakNPCdotCom For This Useful Post: [ View ] Gift weakNPCdotCom Ad-Free
 
 
21st February 2019, 02:03 AM |#2  
Ken C's Avatar
Senior Member
Thanks Meter: 182
 
More
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
The Following User Says Thank You to Ken C For This Useful Post: [ View ] Gift Ken C Ad-Free
21st February 2019, 02:17 PM |#3  
weakNPCdotCom's Avatar
OP Senior Member
Flag Atlanta
Thanks Meter: 338
 
Donate to Me
More
Quote:
Originally Posted by Ken C

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.
The Following 2 Users Say Thank You to weakNPCdotCom For This Useful Post: [ View ] Gift weakNPCdotCom Ad-Free
21st February 2019, 02:24 PM |#4  
Ken C's Avatar
Senior Member
Thanks Meter: 182
 
More
@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
The Following User Says Thank You to Ken C For This Useful Post: [ View ] Gift Ken C Ad-Free
23rd February 2019, 03:15 AM |#5  
hawknest's Avatar
Senior Member
Thanks Meter: 12,993
 
Donate to Me
More
Good job bud will make it easier on us developers, any plans for a Linux version??

Tia,
Hawk
The Following User Says Thank You to hawknest For This Useful Post: [ View ] Gift hawknest Ad-Free
23rd February 2019, 09:38 PM |#6  
BaCkkk's Avatar
Senior Member
Flag LAhore
Thanks Meter: 7
 
More
very CooL
The Following User Says Thank You to BaCkkk For This Useful Post: [ View ] Gift BaCkkk Ad-Free
23rd February 2019, 09:41 PM |#7  
weakNPCdotCom's Avatar
OP Senior Member
Flag Atlanta
Thanks Meter: 338
 
Donate to Me
More
Quote:
Originally Posted by hawknest

Good job bud will make it easier on us developers, any plans for a Linux version??

Tia,
Hawk

Thanks!
I can actually use the same code, just move it over to .NET Core. So that should be pretty simple. I can try to do that asap.
24th February 2019, 10:37 AM |#8  
Senior Member
Flag kolkata
Thanks Meter: 145
 
More
working for h930ds aka lg v30 plus
The Following User Says Thank You to sankhauaa For This Useful Post: [ View ] Gift sankhauaa Ad-Free
26th February 2019, 03:21 PM |#9  
Senior Member
Flag kolkata
Thanks Meter: 145
 
More
Quote:
Originally Posted by weakNPCdotCom

Thanks!
I can actually use the same code, just move it over to .NET Core. So that should be pretty simple. I can try to do that asap.

How to create firmwire json file for lg v30
26th February 2019, 06:16 PM |#10  
weakNPCdotCom's Avatar
OP Senior Member
Flag Atlanta
Thanks Meter: 338
 
Donate to Me
More
Quote:
Originally Posted by sankhauaa

working for h930ds aka lg v30 plus

awesome!

Quote:
Originally Posted by sankhauaa

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.
    extracted binaries
  • 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.
4th March 2019, 05:07 PM |#11  
Markosv76's Avatar
Senior Member
Flag Pinerolo
Thanks Meter: 79
 
Donate to Me
More
Is it possible mod also original system.img?
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes