yashsingh1/xdaforums huggingface dataset:
[Galaxy S 4 Active Q&A, Help & Troubleshooting] Miami_Son:
Please use more descriptive titles in your posts so that others with similar problems who actually use the search can find it. "help plz" is useless for the search function.
[LG Optimus 4X HD] NoDiaper:
I am trying to boot my LG P880 into CW Recovery Mode but when I turn off my phone and then press Volume Up + Power + Home it will boot into LG's recovery mode instead of CW recovery mode.

I have used adb to push cm-10.1.3-p880.zip into my phone's internal SD-card. I got no error when I pushed the .zip file to my phone but if I go to Computer -> LG P880 I will see a lot of folders (media, photos, videos etc.) but none of them is named sdcard.
[LG Optimus 4X HD] nikolas60:
did you unlock the bootloader or not are you root it install cmw from rom manager is easyer
[LG Optimus 4X HD] NoDiaper:
I haven't unlocked the bootloader and I am not root. I will try to get root, in this ****ing jungle.
[LG Optimus 4X HD] nikolas60:
show you cant install cm10.1 find in xda the instructions
[LG Optimus 4X HD] Omario-242:
If you mean to get into Cwm recovery there's no way without previous bootloader unlock and custom recovery install.

There are many tutorials for BL unlock. For me the fastboot way didi the trick.
[LG Optimus 4X HD] NoDiaper:
I have unlocked the bootloader and installed ROM Manager. ROM Manager says I need root which I don't have.

In order to get root I need to get in to CM recovery mode, but in order to get in CM recovery mode I need to have root. WHAT THE ****?!
[LG Optimus 4X HD] Dexxon:
You do not need CWM to root your phone. Here is a link to a tutorial. http://xdaforums.com/showthread.php?t=2180688

Btw to boot into recovery you have to press VOL Down + Power Button until the LG logo appears and then release the Power Button.
[LG Optimus 4X HD] muellersmattes:
Please do yourself a favour and forget about ROM Manager. Read a bit instead. It makes everything easier.
[LG Optimus 4X HD] NoDiaper:
I am so confused. I have adb set up and it finds my device.

I have pushed the ROM (cm-10.1.3) to the /sdcard/ directory on my device.

After that I unlocked the bootloader and I think it removed the ROM from /sdcard/?

I now managed to get root.
[LG Optimus 4X HD] Omario-242:
you have to do it this way:

unlock BL

install custom recovery

flash custom rom

root (most ROMs are pre-rooted)
[LG Optimus 4X HD] NoDiaper:
I have unlocked bootloader.

Installed a custom recovery app.

I ran the app and chose "recovery mode". It asked for superuser permissions which I accepted. The phone just restarted.

I tried to do it again and the phone restarted but got stuck on the LG logo.
[LG Optimus 4X HD] Omario-242:
What do you mean with a custom recovery app? You need to flash a custom recovery!
[LG Optimus 4X HD] NoDiaper:
I installed the ClockworkMod recovery app.

Now I'm following this guide in order to unbrick the ****ing **** phone: http://xdaforums.com/showthread.php?t=2069723
[LG Optimus 4X HD] Omario-242:
Don't know what you did but you probably messed something regarding your bootloader/root access.
[LG Optimus 4X HD] NoDiaper:
I am at step 10 in this guide: http://xdaforums.com/showthread.php?t=2069723&highlight=gray

Where do I find the KDZ for CyanogenMod?
[LG Optimus 4X HD] Omario-242:
There's no kdz for cm, cause it's the file extension for original lg ROMs. You have to install a stock Rom then unlock your bootloader and then proceed.

C'mon you should read and search.
[LG Optimus 4X HD] NoDiaper:
I have been reading extremely much about this **** today and there is no a single guide that guides you through every step on how to install a custom ROM. There are millions of guides everywhere that just confuses you extremely much.

Can you please link a guide that works and has all the steps in it? I'm so ****ing frustrated right now.
[LG Optimus 4X HD] Omario-242:
search for a guide to unlock bootloader, then for custom recovery and then for root/custom rom? So many user on here did it before you, so you'll get it as well.
[LG Optimus 4X HD] NoDiaper:
Before I could unlock the bootloader without any problem.

I just installed Jelly Bean on the **** phone again in order to get it out from brick mode.

Current version is 4.1.2, the adb finds the device but when I type "adb reboot oem-unlock" the phone restarts and gets stuck on the battery logo.

What in the actual **** is this ****? Why is it always like this?!
[LG Optimus 4X HD] Omario-242:
I didn't eve read of something like this but there are a few other guides. XDA is not a helpdesk but we'll try to help you if your patient enough to try at least every guide on here and search properly.
[LG Optimus 4X HD] NoDiaper:
I have been sitting with this ****ing phone for 6 hours now. I have read everything but it doesn't work. I'm in the "Help & Troubleshooting" section so I guess this is a helpdesk. Im sorry but I'm so ****ing mad at this **** right now!
[LG Optimus 4X HD] Omario-242:
Calm down mate :) Anger won't get you anywhere. Try to reinstall everything on your PC (adb, fastboot drivers, LG drivers + flashtool) and try the fastboot way again.

If you're not patient enough then you shouldn't mess with something like this at least if you don't know what you're doing.

And just one hint.

The first XDA rule is "Search before posting".
[LG Optimus 4X HD] Dexxon:
So why unlock again?
[LG Optimus 4X HD] kessaras:
6 hours ? O_o took me 3 days to figure this out my first time and now look at me xD im testing every single rom and having fun modifying my phone every week so i dont get bored

---------- Post added at 08:12 AM ---------- Previous post was at 08:05 AM ----------

driver problem there :D i dont know if it was easier to unlock in a previews firmware since mine is new , but this problem u say there happened to me too on windows 8x64 ! and u dont really need a guide to unlock it since u had done it before. this little babe , from afro ,can do it easy if u have the right drivers ! if u get driver problem there install the whole android sdk and after u unlock, uninstall it if u dont like it. the sdk automatically updates and installs the best drivers. :D

( by the way im too happy now that im on linux :D i dont need to do anything. everything is just working out on its own )
[JASJAR, XDA Exec, MDA Pro General] peteypye:
Well, I managed to delete all the shortcuts to applications somehow last night, so I performed a hard resest (clear storage).

Anyways all went well.. installed all the apps I had originaly.. and then the phone decides to say it has a text message, but i click on the Today notification, and nothing, nowhere!!! No email, no txt, no multimedia no nothing!!! Im confused.. so i went and sent myself a txt from the net to see if it would clear the problem up.... ohh 2 messages, nothing there though!! Completely blank in the inbox outbox drafts everything.. so ive just done another hard reset.... ill see what happens...
[JASJAR, XDA Exec, MDA Pro General] vijay555:
Check your answering machine as well, just in case.

V
[Miscellaneous Android Development] AndroidUser00110001:
Ha! Just what I was looking for but now to get it to work in Windows...

Thanks!

Edit

So I installed Python for Windows and this was the output...

C:\Python33>KDZFileTools.py -l -f F320K11D_00.kdz

File "C:\Python33\KDZFileTools.py", line 159

print "[!] Error: Unsupported KDZ file format."

^

SyntaxError: invalid syntax

C:\Python33>python.exe DZFileTools.py -l -f D80210C_00.kdz

File "DZFileTools.py", line 96

print "[!] Bad DZ sub header!"

^

SyntaxError: invalid syntax

C:\Python33>python.exe KDZFileTools.py -l -f D80210C_00.kdz

File "KDZFileTools.py", line 159

print "[!] Error: Unsupported KDZ file format."

^

SyntaxError: invalid syntax
[Miscellaneous Android Development] thecubed:
Not sure what's happening here, but I wrote this in Windows, so it works for me...

Try using Python 2.7 ? I haven't tested it with Py3k...

If it still gives you invalid headers after you get rid of the SyntaxError messages, let me know and I'll take a look. I've only verified that this works on a handful of KDZ files.
[Miscellaneous Android Development] honentan:
Thanks for such a awesome tool. After extracting D80210E_00.kdz, I found that system_xxxxxxx.bin files is not contiguous. Merge into one file, you can not mount it.

would you like to develop a tool more for system partitions merge?
[Miscellaneous Android Development] thecubed:
Excellent timing :) I'm actually working on that right now.

It would appear that the KDZ file contains only the 'sparse' data from large partitions.

Basically, it's the same as if you fed the utility "hexdump" a large file with multiple sections will have the empty sections 'collapsed' and shown as a "*".

My utility needs to take the beginning position of the first system_xxxx.bin file into account, and the end system_xxxx.bin 's position and size.

From there, it knows how big the image file needs to be, then it can simply seek to the position in the new file as defined by each .bin file and write it's contents there.

Ultimately, I'd like to have in-place extraction from the KDZ files, without the need to extract the DZ file itself (since it really is just copying the bytes from the right position to a new file on the hdd), and a utility to merge split partitions, like system.

Until then, if you need to create this image yourself, you can do so with a hex editor or dd

1. Take the first system_xxxxx.bin file and write down the value of xxxxx somewhere. We're going to use this as an offset.

2. Take the last system_xxxxx.bin file and write down it's xxxxx as well. Subtract the two. You should now get the size of the system.img file

3. Use "dd" to create a file of proper length: dd if=/dev/zero of=system.img bs=1 count=SIZE_FROM_EARLIER

4. Now, let's put our files into the right places. The first file can just be merged into it with dd if=system_xxxxx.bin of=system.img conv=notrunc

5. For every file after the first one, you'll have to take the xxxxx value from the file, and subtract the offset you found from step 1. use dd if=system_xxxxx.bin of=system.img seek=VALUE_YOU_JUST_FOUND

6. The end file is no different. Subtract it's xxxxx value again and run the above DD command.

If I'm right, this should leave you with a working partition image.

I haven't verified yet, but it seems logical and should work :)
[Miscellaneous Android Development] honentan:
thanks for your reply. I am going to try the method as you mentioned just now to merge the system.img using winhex, but I have not verified yet too. I will try it tomorrow.

as a advice, new tool should be able to extract and repack new kdz file.
[Miscellaneous Android Development] honentan:
I merged system.img using script as you mentioned, but it couldn't be mounted also.

Progress was obtained, I got all files in system.img using ext2explore(version2.1).

dd if=/dev/zero of=system.img bs=1 count=5505024
dd if=system_819200.bin of=system.img conv=notrunc seek=0
dd if=system_1081344.bin of=system.img conv=notrunc seek=262144
dd if=system_1082760.bin of=system.img conv=notrunc seek=263560
dd if=system_1086808.bin of=system.img conv=notrunc seek=267608
dd if=system_1347536.bin of=system.img conv=notrunc seek=528336
dd if=system_1607048.bin of=system.img conv=notrunc seek=787848
dd if=system_1611096.bin of=system.img conv=notrunc seek=791896
dd if=system_1871824.bin of=system.img conv=notrunc seek=1052624
dd if=system_2131336.bin of=system.img conv=notrunc seek=1312136
dd if=system_2135384.bin of=system.img conv=notrunc seek=1316184
dd if=system_2396112.bin of=system.img conv=notrunc seek=1576912
dd if=system_2655624.bin of=system.img conv=notrunc seek=1836424
dd if=system_2659672.bin of=system.img conv=notrunc seek=1840472
dd if=system_2920400.bin of=system.img conv=notrunc seek=2101200
dd if=system_3179912.bin of=system.img conv=notrunc seek=2360712
dd if=system_3183960.bin of=system.img conv=notrunc seek=2364760
dd if=system_3444688.bin of=system.img conv=notrunc seek=2625488
dd if=system_3706832.bin of=system.img conv=notrunc seek=2887632
dd if=system_3968976.bin of=system.img conv=notrunc seek=3149776
dd if=system_4231120.bin of=system.img conv=notrunc seek=3411920
dd if=system_4493264.bin of=system.img conv=notrunc seek=3674064
dd if=system_4755408.bin of=system.img conv=notrunc seek=3936208
dd if=system_5017552.bin of=system.img conv=notrunc seek=4198352
dd if=system_5275648.bin of=system.img conv=notrunc seek=4456448
dd if=system_5537792.bin of=system.img conv=notrunc seek=4718592
dd if=system_5799936.bin of=system.img conv=notrunc seek=4980736
dd if=system_6062080.bin of=system.img conv=notrunc seek=5242880
dd if=system_6324224.bin of=system.img conv=notrunc seek=5505024

ext2explore log:

Partition Table Error on D:/Android-ROM/980VS/system.img

Invalid End of sector markerBlock size 4096, inp 8064, inodesize 256

Linux Partition found on disk 1 partition 0

Inode 727 with file size 0
[Miscellaneous Android Development] AndroidUser00110001:
Thanks, I got it working using 2.7 I have everything extracted and now I need to learn how to merge all the system files.

Thanks!
[Miscellaneous Android Development] thecubed:
I'm working on a modified version of the DZFileUtils.py script, since the DZ file actually contains the proper information to regenerate the full system.img easier than using DD or a hex editor.

Work has been a little crazy for the past few days, so I may not get a chance to work on the script until next week, but it won't be that hard to have this script put the system.img files back together.

I could modify the whole toolsets to do in-place extraction from a KDZ file (skipping the intermediate DZ file) but for now this is the easiest and accomplishes my goal the fastest (which is to allow extraction of bootloader stacks from KDZ files found on the interwebs)

I have no plans on creating a utility to generate KDZ files, since myself and [MENTION=2413393]Shelnutt2[/MENTION] are in the process of writing a utility to flash images without needing any LG software on your PC.
[Miscellaneous Android Development] AndroidUser00110001:
I used dd for windows and was able to merge all the files with the script that someone posted. Sorry on XDA App and can't see full thread but thanks for the script.

If you guys need help with testing let me know.
[Miscellaneous Android Development] mansoor3131:
Hi, i make my phone soft bricked. no other method works. i need bin file to flash my phone.i have the orignal kdz file.how can i make a single bin file to flash it using LGNPST? If you want to read my whole phone bricking story, please follow this

http://xdaforums.com/showthread.php?t=2492105
[Miscellaneous Android Development] arshcaria:
AAAAwesome!!!

Thank you very much!

Able to customize LG's ROM easier than ever!
[Miscellaneous Android Development] rquiett:
Any word on the DZfileUtils.py script? I am trying to convert the dz to the system img and all I get is errors when trying to use dd. If there is a better way than dd for windows could someone let me know.

Well I think I have found where my error was at with what I was trying to do.

Thank you for all your hard work on this
[Miscellaneous Android Development] rquiett:
I can confirm I could not mount or use normal methods I have used in the past for getting the system image extracted but I also used ext2explore on windows and it worked like a charm. Thank you
[Miscellaneous Android Development] mrmamon:
Thanks for tools:good:

but I got this error when I tried with KDZ file.

and when I got DZ file from other KDZ extracter and tried DZ file I got this

I never run python script but I think I did it right.

I'm installed python 2.7. and KDZ file is for Optimus G
[Miscellaneous Android Development] cybojenix:
in linux

mkdir -p /mnt/dsk
mount -o loop system.img /mnt/dsk

this will return an error

run dmesg

dmesg | tail

there will be a line like this:

now truncate the file with the value of the first number

truncate -o -s 851968

remount, and hey presto.

thank you [MENTION=4350964]Flinny[/MENTION] for this

edit: not needed anymore, just ignore it. keeping it here for reference though
[Miscellaneous Android Development] cybojenix:
merging the bins on linux

ok, so there have been a few issues with getting this done on any platform. I was asked to try to get into a kdz for someone, so I did it

included below is a python script that takes advantage of dd. I've set it up for the system partition (as that's the only one that is split)

I have left all my comments and tweaks in so you can see how it was formed

to run:

python SystemMerger.py

It should run with python3 (untested). can someone please report any errors and I'll see if I can fix them up.

after running the script, just mount the image, and you're away

Happy Hacking :)

ps, don't forget to change the extension to .py
[Miscellaneous Android Development] cybojenix:
ok final version here, should support windows now

https://github.com/cybojenix/random-scripts/blob/master/SystemMerger.py

it should also support python3 still, but someone please check, same with windows (though I'm sceptical about the way I write zeros. might not work on winblows...)

anyway, happy hacking again
[Miscellaneous Android Development] honentan:
good job! awesome! thanks.
[Miscellaneous Android Development] bullghost:
just put bracket on each print params, then it should work

like this print ("[!] Error: Unsupported KDZ file format.")

also the KDZFileTools not work on LG G2, the header doesnt match with required

here

i debug to find what is the actual value on verify_header

D80210b.kdz header found

>>> verify_header

b'(\x05\x00\x0041%\x80'

kdz_header = '0x28 0x5 0x0 0x0 0x34 0x31 0x25 0x80'

KDZFileTools error log
[Miscellaneous Android Development] juniecho:
thank you, but does not work with SOME kdzs

it seems like LG is constantly changing their KDZ format.

well it works the latest G2 kdzs, but does not work G Pro kdzs.

this is what i get:

can you take a look into this please?

these are kdzs i tried extracting:

G: http://csmgdl.lgmobile.com/dn/downloader.dev?fileKey=FW362785432109876543213/F180K20O_00.kdz

GPRO: http://pkg02.xcdn.gdms.lge.com/dn/downloader.dev?fileKey=FW739986573210987654321/F240S10X_00.kdz

GK: https://docs.google.com/uc?export=download&id=0BxguIyFQTnvdaU1mUWxaVGs3Q2c

they all give me the same thing(0x18 0x5 0x0 0x0 0x32 0x79 0x44 0x50), so i think they share the same format.

thanks!
[Miscellaneous Android Development] spiderio:
can i use it with cygwin for windows?
[Miscellaneous Android Development] AndroidUser00110001:
Python for windows is what I used and worked.
[Miscellaneous Android Development] Daved+:
Same here with a g pro kdz
[Miscellaneous Android Development] citytrader:
Thanks for your help, I have arrived to the file system.img, but if I open it with Linux Reader or similar problem, the partition is empty even if it have 3 GB of data!?... what am I doing wrong?..
[Miscellaneous Android Development] cybojenix:
Thought there might be an issue with winblows...

Can you try this please in python console

def ddrep_write_zero(length, dd_of="system.img"):
with open(dd_of, "w") as f:
f.seek(length * 512)
f.write("\0")

ddrep_write_zero(500)

How big is the resultant file?
[Miscellaneous Android Development] citytrader:
Here are the files in bytes:

3,238,002,689 system.img

524,288 system_1081344.bin

524,288 system_1082760.bin

131,596,288 system_1086808.bin

132,644,864 system_1347536.bin

524,288 system_1607048.bin

131,596,288 system_1611096.bin

132,644,864 system_1871824.bin

524,288 system_2131336.bin

131,596,288 system_2135384.bin

132,644,864 system_2396112.bin

524,288 system_2655624.bin

131,596,288 system_2659672.bin

132,644,864 system_2920400.bin

524,288 system_3179912.bin

131,596,288 system_3183960.bin

132,644,864 system_3444688.bin

132,644,864 system_3706832.bin

132,644,864 system_3968976.bin

132,644,864 system_4231120.bin

132,644,864 system_4493264.bin

132,644,864 system_4755408.bin

132,644,864 system_5017552.bin

132,644,864 system_5279696.bin

132,644,864 system_5541840.bin

38,273,024 system_5803984.bin

524,288 system_6062080.bin

524,288 system_6324224.bin

134,217,728 system_819200.bin
[Miscellaneous Android Development] citytrader:
I have created a file patch.py with that info in there, executed python patch.py and the image.img became unreadable... I hope it could be possible to decrypt this kdz and extract the system files!!!! .... with my Galaxy S2 was very easy, with this LG G2 is a pain.
[Miscellaneous Android Development] k25c2yf:
Extract error on G2 F320L V20B DZ

http://inclu.net:82/OPTIMUS/LG G2/LG U+/

$ python DZFileTools.py -f F320L20B_00.dz -x

[+] Extracting all partitions!

[+] Extracting PrimaryGPT_0.bin to dzextracted/PrimaryGPT_0.bin

[+] Extracting modem_32768.bin to dzextracted/modem_32768.bin

[+] Extracting sbl1_163840.bin to dzextracted/sbl1_163840.bin

[+] Extracting dbi_165888.bin to dzextracted/dbi_165888.bin

[+] Extracting aboot_229376.bin to dzextracted/aboot_229376.bin

[+] Extracting rpm_231424.bin to dzextracted/rpm_231424.bin

[+] Extracting boot_262144.bin to dzextracted/boot_262144.bin

[+] Extracting tz_294912.bin to dzextracted/tz_294912.bin

[+] Extracting persist_393216.bin to dzextracted/persist_393216.bin

[+] Extracting recovery_458752.bin to dzextracted/recovery_458752.bin

[+] Extracting laf_622592.bin to dzextracted/laf_622592.bin

[+] Extracting system_917504.bin to dzextracted/system_917504.bin

[+] Extracting system_1181320.bin to dzextracted/system_1181320.bin

[+] Extracting system_1185432.bin to dzextracted/system_1185432.bin

[+] Extracting system_1445904.bin to dzextracted/system_1445904.bin

[+] Extracting system_1705608.bin to dzextracted/system_1705608.bin

[+] Extracting system_1709720.bin to dzextracted/system_1709720.bin

Traceback (most recent call last):

File "DZFileTools.py", line 212, in <module>

dztools.main()

File "DZFileTools.py", line 206, in main

self.cmdExtractAll()

File "DZFileTools.py", line 192, in cmdExtractAll

self.extractPartition(part[0])

File "DZFileTools.py", line 142, in extractPartition

outfile.write(zlib.decompress(zdata))

zlib.error: Error -3 while decompressing data: incorrect data check
[Miscellaneous Android Development] bullghost:
hi guys i create a KDZ Extractor in windows version

feature

- Extract KDZ

- Extract DZ

- Merge system*.bin files

tested on :

- LG G2

thanks to :

- thecubed

- cybojenix

for their great work!

WindowsKDZextract
[Miscellaneous Android Development] citytrader:
It works flawlessly with LG G2!!! EXCELENT WORK!!!
[Miscellaneous Android Development] SmiLey497:
You are the man!!!! Works great.
[Miscellaneous Android Development] hypnz:
Keep up the good work man!
[Miscellaneous Android Development] AndroidUser00110001:
This worked great!!! Thanks!

Is it possible to get the boot.img too?
[Miscellaneous Android Development] bullghost:
yes boot.img are locate in DZ file. you can extract it also,
[Miscellaneous Android Development] hshen:
Hi thecubed, thanks for your python scripts. Based on them, I am working on extracting LG G Pro's kdz. I am able to extract two files: dz and dll, from the kdz. I also am able to get all the lists of the image from dz.

However, I am stucked on extracting all the images. Specifically, when the DZFileTools.py executes on "outfile.write(zlib.decompress(zdata))", I have received the following error: zlib.error:

Error -3 while decompressing data: incorrect header check.

I suspect G Pro compress method is different from G2. Do you have any suggestion for me? Thanks in advance.

---------- Post added at 02:13 PM ---------- Previous post was at 02:06 PM ----------

hi bullghost, thanks for this wonderful tool you have provided. It does the job. I am able to apply both ext2explore and linux mount to get the contents of system.img. Thanks again.
[Miscellaneous Android Development] AndroidUser00110001:
Can you ad option to your tool?

:)
[Miscellaneous Android Development] bullghost:
sorry, you can extract the boot img for phone ,it shown in DZ file list ,
[Miscellaneous Android Development] khan_frd2002:
Any tool for LG Pro Lite.....
[Miscellaneous Android Development] juniecho:
hshen, how did you manage to get the dz and dll from kdz? did you modify the original script?