Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,802,856 Members 41,615 Now Online
XDA Developers Android and Mobile Development Forum

[GUIDE] How to make your own flashable zip ROMS for CWM/TWRP from kdz

Tip us?
 
k2wl
Old
(Last edited by k2wl; 20th August 2014 at 06:03 AM.)
#1  
Senior Member - OP
Thanks Meter 4,543
Posts: 2,003
Join Date: Apr 2008

 
DONATE TO ME
Default [GUIDE] How to make your own flashable zip ROMS for CWM/TWRP from kdz

hi friends
As you know there is CM-11.0 development going on for our L90
And flashing back to stock is a painful process.
you loose bootloader unlock status/root/recovery.

So i am putting here a guide to make your own flashable zips which can be flashed through CWM/TWRP.

All from your stock KDZ firmware.
Code:
#include  
/*  * Your warranty is now void.  
*  * I am not responsible for bricked devices, dead SD cards,  
* thermonuclear war, or you getting fired because the alarm app failed. Please  
* do some research if you have any concerns about features included in this ROM  
* before flashing it! YOU are choosing to make these modifications, and if  
* you point the finger at me for messing up your device, I will laugh at you. Hard. A lot.  */
GUIDE has following parts
Quote:

1.Preparation/pre-requisites

2. Extarcting IMGs from KDZ

3.Making a flashable zips.
1.Preparation/pre-requisites
you need
a]Windows PC

b]pyton 2.7 installed on it
download link
https://www.python.org/ftp/python/2....thon-2.7.8.msi

c] [Tool][python] LG Compressed KDZ Extractor

download from following thread
http://forum.xda-developers.com/show....php?t=2483250

d]notepad++ installed

download link
http://download.tuxfamily.org/notepa....Installer.exe

e][TOOL] KDZ and TOT Extractor

download from following thread
http://forum.xda-developers.com/show....php?t=2600575

always download latest WindowsLGFirmwareExtract-ver.1.2.1.0

f]Flashable zip template
download the attachment below.

e]Unlocked bootloader with CWM/TWRP installed
for unlocking follow
http://forum.xda-developers.com/lg-l...r-l90-t2852917
this thread

for CWM/TWRP you can download from
http://forum.xda-developers.com/lg-l...g-l90-t2831541

f] Zip software
i use 7zip

2. Extarcting IMGs from KDZ
So now lets get started with real stuff.

extract python tool you downloaded in C:\Python27
then copy your kdz file to C:\Python27

go to
C:\Python27

open Command prompt there by pressing shift+right click

give following command

Code:
C:\Python27>python KDZFileTools.py -l -f D41010c_00.kdz
my kdz file name is D41010c_00.kdz

it may give the error like

Code:
[!] Error: Unsupported KDZ file format.
[ ] Expected: 0x28 0x5 0x0 0x0 0x34 
0x31 0x25 0x80 ,
        but received 0x28 
0x5 0x0 0x0 0x24 0x38 0x22 0x25
.

open KDZFileTools.py file with notepad++

you will see

Code:
"\x28\x05\x00\x00\x34\x31\x25\x80"
change it to

Code:
"\x28\x05\x00\x00\x24\x38\x22\x25"
save the file and exit.

now run the command again

Code:
C:\Python27>python KDZFileTools.py -l -f D41010c_00.kdz
[+] KDZ Partition 
List
=========================================
 0 : D41010d_0.dz 
(1027325284 bytes)
 1 : WX.dll (1303040 bytes)
 2 : ♥WX.dylib 
(243307520 bytes)
now it will show you the file list in kdz file

now run following

Code:
C:\Python27>python KDZFileTools.py -f D41010c_00.kdz -x
it will show the follwoing prompt

Code:
C:\Python27>python KDZFileTools.py -f D41010c_00.kdz -x
[+] Extracting 
all partitions!

 
[+] Extracting D41010d_0.dz to kdzextracted\D41010d_0.dz
[+] Extracting 
WX.dll to kdzextracted\WX.dll
[+] Extracting ♥WX.dylib to 
kdzextracted\♥WX.dylib
Traceback (most recent call last):
  File 
"KDZFileTools.py", line 195, in <module>
    
kdztools.main()
  File "KDZFileTools.py", line 191, in 
main
    self.cmdExtractAll()
  File 
"KDZFileTools.py", line 172, in cmdExtractAll
    
self.extractPartition(part[0])
  File "KDZFileTools.py", line 112, in 
extractPartition
    outfile = 
open(os.path.join(self.outdir,currentPartition['name']), 'wb')
IOError: 
[Errno 22] invalid mode ('wb') or filename: 'kdzextracted\\\x03WX.dylib
'
dont worry it is fine

now we have DZ file in kdzextracted folder

now give following command

Code:
C:\Python27>python DZFileTools.py -f kdzextracted/D41010d_0.dz -x
this will give you following prompt

Code:
C:\Python27>python DZFileTools.py -f kdzextracted/D41010d_0.dz -x
[+] 
Extracting all partitions!

 
[+] Extracting PrimaryGPT_0.bin to dzextracted\PrimaryGPT_0.bin
[+] 
Extracting modem_16384.bin to dzextracted\modem_16384.bin
[+] Extracting 
sbl1_147456.bin to dzextracted\sbl1_147456.bin
[+] Extracting rpm_149504.bin 
to dzextracted\rpm_149504.bin
[+] Extracting tz_150528.bin to 
dzextracted\tz_150528.bin
[+] Extracting sdi_151552.bin to 
dzextracted\sdi_151552.bin
[+] Extracting aboot_152576.bin to 
dzextracted\aboot_152576.bin
[+] Extracting rpmb_156672.bin to 
dzextracted\rpmb_156672.bin
[+] Extracting tzb_157696.bin to 
dzextracted\tzb_157696.bin
[+] Extracting abootb_158720.bin to dzextracted\abootb_158720.bin
[+] Extracting persist_212992.bin to 
dzextracted\persist_212992.bin
[+] Extracting laf_278528.bin to 
dzextracted\laf_278528.bin
[+] Extracting boot_327680.bin to 
dzextracted\boot_327680.bin
[+] Extracting recovery_372736.bin to 
dzextracted\recovery_372736.bin
[+] Extracting rct_459776.bin to 
dzextracted\rct_459776.bin
[+] Extracting factory_507904.bin to 
dzextracted\factory_507904.bin
[+] Extracting sbl1b_622592.bin to 
dzextracted\sbl1b_622592.bin
[+] Extracting cust_704512.bin to 
dzextracted\cust_704512.bin
[+] Extracting system_933888.bin to 
dzextracted\system_933888.bin
[+] Extracting system_1197064.bin to 
dzextracted\system_1197064.bin
[+] Extracting system_1201176.bin to 
dzextracted\system_1201176.bin
[+] Extracting system_1462288.bin to 
dzextracted\system_1462288.bin
[+] Extracting system_1725464.bin to 
dzextracted\system_1725464.bin
[+] Extracting system_1986576.bin to 
dzextracted\system_1986576.bin
[+] Extracting system_2249752.bin to 
dzextracted\system_2249752.bin
[+] Extracting system_2510864.bin to 
dzextracted\system_2510864.bin
[+] Extracting system_2774040.bin to 
dzextracted\system_2774040.bin
[+] Extracting system_3035152.bin to 
dzextracted\system_3035152.bin
[+] Extracting system_3298328.bin to 
dzextracted\system_3298328.bin
[+] Extracting system_3559440.bin to 
dzextracted\system_3559440.bin
[+] Extracting system_3821584.bin to 
dzextracted\system_3821584.bin
[+] Extracting system_4079616.bin to 
dzextracted\system_4079616.bin
[+] Extracting system_4341760.bin to 
dzextracted\system_4341760.bin
[+] Extracting system_4603904.bin to 
dzextracted\system_4603904.bin
[+] Extracting system_4866048.bin to 
dzextracted\system_4866048.bin
[+] Extracting BackupGPT_15268864.bin to 
dzextracted\BackupGPT_15268864.bin

 
C:\Python27>
now extract
KDZ and TOT Extractor to dzextracted folder and go to dzextracted folder.
Open WindowsLGFirmwareExtract.exe

click on
Code:
merge system-bin
it will start merging and output will be C:\Python27\dzextracted\merge_output

you have now got your system.img

3. Makinhg a flashable zip

now in dzextracted folder
Code:
 rename boot_327680.bin to boot.img
and
Code:
rename cust_704512.bin  to cust.bin
Now extract the attached zip to this post where ever you want.
you will get META-INF folder.
copy system.img,boot.img,cust.bin to that folder

now you have
Code:
META-INF,  system.img,boot.img,cust.bin
make a zip containing all 4 with 7zip.

there you go..... now have your own flashable zip.

CREDITS
bullghost for kdz&tot extract tool
thecubed for python kdz extraction tool
Quarx for CWM/TWRP/ and CM
LG for KDZ
Attached Files
File Type: zip k2wl flashable zip template.zip - [Click for QR Code] (171.1 KB, 11 views)
MY WORK
 
For Samsung Galaxy Grand I9082
ProBAM KK | Evolution Kernel | Kernel building guide |
OmniROM 4.4.2 | Android Kitchen ROM guide


For Samsung Galaxy S4 mini Duos I9192

CM-11.0
Hit thanks if i help you. And donate if you can.
The Following 7 Users Say Thank You to k2wl For This Useful Post: [ Click to Expand ]
 
k2wl
Old
#2  
Senior Member - OP
Thanks Meter 4,543
Posts: 2,003
Join Date: Apr 2008

 
DONATE TO ME
reserved
MY WORK
 
For Samsung Galaxy Grand I9082
ProBAM KK | Evolution Kernel | Kernel building guide |
OmniROM 4.4.2 | Android Kitchen ROM guide


For Samsung Galaxy S4 mini Duos I9192

CM-11.0
Hit thanks if i help you. And donate if you can.
 
androidguy1991
Old
#3  
Member
Thanks Meter 27
Posts: 30
Join Date: Jul 2010
Great guide!
BTW, there was one error I found.

Instead of:

Code:
C:\Python27>python DZFileTools.py -f kdzextracted/D41010d_0.dz -x
It should have been:

Code:
C:\Python27>python DZFileTools.py -f kdzextracted/D41010c_0.dz -x

PS:
If your running on D415 just replace D410 with whatever version you have.


Just one question?
What is the cust.bin for? Is that the data partition?
 
SubliemeSiem
Old
#4  
SubliemeSiem's Avatar
Member
Thanks Meter 29
Posts: 89
Join Date: Dec 2008
Location: Tilburg, NL
What is the advantage of this method compared to simply flashing back a bakup made in TWRP? You also go back to stock and get to keep the bootloader unlocked + recovery. It also backups all your apps.. BTW, I don't mean to be a critic, I'm just curious.
Current phone
Model: LG L90 D405n
Recovery: TWRP
Rom: Quarx' CM11

Old phone: Sony Xperia E C1505 (Sold)
Recovery: TWRP and CWM combo
Rom: CM11 (Unstable nightly)

Old tablet: Asus Nexus 7 2013 (Broken)
Recovery: TWRP
Rom: CM11 (Official)

Samsung Galaxy Tab 3 7.0 (Sold)
Recovery: TWRP
Rom: RocketTab
 
InfinitusDesigner
Old
#5  
InfinitusDesigner's Avatar
Junior Member
Thanks Meter 4
Posts: 21
Join Date: Aug 2014
Location: Santa Cruz do Sul
Thumbs up Awsome!

Quote:
Originally Posted by k2wl View Post
hi friends
As you know there is CM-11.0 development going on for our L90
And flashing back to stock is a painful process.
you loose bootloader unlock status/root/recovery.

So i am putting here a guide to make your own flashable zips which can be flashed through CWM/TWRP.

All from your stock KDZ firmware.
I did the process, now i will just flash and see what happens. Thank you.
 
k2wl
Old
#6  
Senior Member - OP
Thanks Meter 4,543
Posts: 2,003
Join Date: Apr 2008

 
DONATE TO ME
Quote:
Originally Posted by androidguy1991 View Post
Great guide!
BTW, there was one error I found.

Instead of:

Code:
C:\Python27>python DZFileTools.py -f kdzextracted/D41010d_0.dz -x
It should have been:

Code:
C:\Python27>python DZFileTools.py -f kdzextracted/D41010c_0.dz -x

PS:
If your running on D415 just replace D410 with whatever version you have.


Just one question?
What is the cust.bin for? Is that the data partition?
no my friend my dz has "d" in it intead of "c "
i dont know why but it is that way only.

cust.bin is needed for boot process i think. i have read on forums for other lge phones.

ya just replacing name of kdz should work fine. for other varients.

@SubliemeSiem
it is simple flashable zip.
and advantage is that you can change your stock version instead of flashing kdz with this method.

i am currently working on making android kitchen along with this.

i will keep you people updated on this front...
MY WORK
 
For Samsung Galaxy Grand I9082
ProBAM KK | Evolution Kernel | Kernel building guide |
OmniROM 4.4.2 | Android Kitchen ROM guide


For Samsung Galaxy S4 mini Duos I9192

CM-11.0
Hit thanks if i help you. And donate if you can.
 
SubliemeSiem
Old
#7  
SubliemeSiem's Avatar
Member
Thanks Meter 29
Posts: 89
Join Date: Dec 2008
Location: Tilburg, NL
Quote:
Originally Posted by k2wl View Post
no my friend my dz has "d" in it intead of "c "
i dont know why but it is that way only.

cust.bin is needed for boot process i think. i have read on forums for other lge phones.

ya just replacing name of kdz should work fine. for other varients.

@SubliemeSiem
it is simple flashable zip.
and advantage is that you can change your stock version instead of flashing kdz with this method.

i am currently working on making android kitchen along with this.

i will keep you people updated on this front...
Still not entirely sure what you mean. With changing the stock version, you mean when a new update comes out? I still think I'll just stick with my backups though, works fine for me. Am still curious and eager to learn though.
Current phone
Model: LG L90 D405n
Recovery: TWRP
Rom: Quarx' CM11

Old phone: Sony Xperia E C1505 (Sold)
Recovery: TWRP and CWM combo
Rom: CM11 (Unstable nightly)

Old tablet: Asus Nexus 7 2013 (Broken)
Recovery: TWRP
Rom: CM11 (Official)

Samsung Galaxy Tab 3 7.0 (Sold)
Recovery: TWRP
Rom: RocketTab
 
k2wl
Old
#8  
Senior Member - OP
Thanks Meter 4,543
Posts: 2,003
Join Date: Apr 2008

 
DONATE TO ME
if lg releases new update
then you can download the kdz and make a zip which can be flashed through cwm without loosing the recovery or unlocked bootloader status.

your back up will give you only the original version you have backed up not the new released version.
MY WORK
 
For Samsung Galaxy Grand I9082
ProBAM KK | Evolution Kernel | Kernel building guide |
OmniROM 4.4.2 | Android Kitchen ROM guide


For Samsung Galaxy S4 mini Duos I9192

CM-11.0
Hit thanks if i help you. And donate if you can.
The Following User Says Thank You to k2wl For This Useful Post: [ Click to Expand ]
 
InfinitusDesigner
Old
#9  
InfinitusDesigner's Avatar
Junior Member
Thanks Meter 4
Posts: 21
Join Date: Aug 2014
Location: Santa Cruz do Sul
Thumbs up 100%

I did my flashable .zip for brazilian 410 and some friends installed and it worked fine. Thanks for the guide.
 
k2wl
Old
#10  
Senior Member - OP
Thanks Meter 4,543
Posts: 2,003
Join Date: Apr 2008

 
DONATE TO ME
Quote:
Originally Posted by InfinitusDesigner View Post
I did my flashable .zip for brazilian 410 and some friends installed and it worked fine. Thanks for the guide.
i am glad that it work for u.
MY WORK
 
For Samsung Galaxy Grand I9082
ProBAM KK | Evolution Kernel | Kernel building guide |
OmniROM 4.4.2 | Android Kitchen ROM guide


For Samsung Galaxy S4 mini Duos I9192

CM-11.0
Hit thanks if i help you. And donate if you can.

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Speed Up Jenkins Configuration Process with TSJ

When you are theleader of a largedevelopment project, Gerrit isn’t the only tool that … more

AutoData Regulates Your Connectivity to Save Battery Life

It’s absolutely no secret that battery life is somewhat of anundoingformany … more

Tale of the Great Recoveries

About a week ago, our fantastic writer and my esteemed colleague Tom embarked on a mission to learnthe vast and … more

How to Make Your GPS Lock Faster – XDA Developer TV

Nothing is more frustrating than opening up Google Maps and it taking way to long … more