yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] tobitege:
[MENTION=1488698]rayman95[/MENTION]: do you use the "if" statement around the mount statement or only mount? It sounds like without.
[Android Software/Hacking General [Developers Only]] rayman95:
i try both solutions and copy exactely the text in updater script....
[Android Software/Hacking General [Developers Only]] Simomaster1:
Cygwin

Hello! I am using a pc running windows 8.1....i am developing a lollipop rom....after i had done all my modifications i try to compress all system file into a EXT4 image...i am using Cygwin 64 bit....i follow all the guide but when i try to compress i see these error

Can someone help me please?:crying:
[Android Software/Hacking General [Developers Only]] moetoby:
i unpack the system.ext4 so that i can delete some apps,then repack it and put it into .zip,but it seems wrong.my phone con not even start,just boot and bootloop! i used to use this method on KK and it always work! so do you have some good ideas? THX first!;)

it's a sony lollipop stock
[Android Software/Hacking General [Developers Only]] hardythaker:
After doing that you singed the zip ??
[Android Software/Hacking General [Developers Only]] moetoby:
no,i didn't sign the zip,should i do that?
[Android Software/Hacking General [Developers Only]] rayman95:
You have to modify updater script......
[Android Software/Hacking General [Developers Only]] moetoby:
i use the PRFCreator by zxz0O0 to creat a lollipop zip,the app will auto creat a updater script. when after i repack the system.ext4 from KK zip,i just put it into zip and it works,but why it didn't work on lollipop?i just remove one app from /system/app......i have already trouble for two days:crying:
[Android Software/Hacking General [Developers Only]] rayman95:
same problem for me...google modify from KK to L.....
[Android Software/Hacking General [Developers Only]] JeepFreak:
OK, all I wanna do is mount the /system partition of the latest CM nightly so I can grab a single file from it and place that file on my phone. Maybe it's because I've been working on this fracking menial task for HOURS, but I can't seem to find this sdat2img thing to save my life!! Can somebody PLEASE point me to it? Ubuntu 32 bit...
[Android Software/Hacking General [Developers Only]] androcraze:
Post #2. It's a Python script:

http://xdaforums.com/showpost.php?p=58509411&postcount=2

Doesn't seem to work on AOSP 5.1, just 5.0. Good luck.
[Android Software/Hacking General [Developers Only]] JeepFreak:
Wow! Not sure how in the world I missed that. Thanks!
[Android Software/Hacking General [Developers Only]] shmshd12:
[MENTION=5132229]xpirt[/MENTION]

I tried this in Windows 7 x86 by giving the command : sdat2img system.transfer.list system.new.dat system.img

and the result was Error command 0

Why is it not working ??
[Android Software/Hacking General [Developers Only]] androcraze:
http://xdaforums.com/showpost.php?p=59430981&postcount=180
[Android Software/Hacking General [Developers Only]] xdagee:
Error, _on windows 7 Pro x86

Hi cant seems to get it to work on my win 7 x86.
[Android Software/Hacking General [Developers Only]] prashant13b:
can any one explain how to covwert .dat to ext4 or img

i cannot get what op is saying to do
[Android Software/Hacking General [Developers Only]] core720:
waiting...
[Android Software/Hacking General [Developers Only]] xpirt:
guys, managed to decompress android 5.1 dat files successfully.

will update source and binaries as soon as possible.
[Android Software/Hacking General [Developers Only]] ejaz.msgs:
actully i tried this method also..

but i open sdat2img there is a message that press any key to continue and it closes automatically...

please help me..

thanks in advance..

-Ejaz...
[Android Software/Hacking General [Developers Only]] xpirt:
how can I help you if you don't give me enough information? error?
[Android Software/Hacking General [Developers Only]] ejaz.msgs:
i just open sdat2img binary

and i press any key and it closes immediately...

please help me..
[Android Software/Hacking General [Developers Only]] xpirt:
then read carefully the guide, it is not wrote to open it but to run it with 3 arguments.
[Android Software/Hacking General [Developers Only]] xpirt:
changelog

sdat2img.py: added lollipop 5.1 support - commit

update

sdat2img windows binary

too, link available on OP.

linux binaries coming soon..
[Android Software/Hacking General [Developers Only]] webdroidmt:
Back in business! :D The windows exe working great with 5.1. Thanks for updating this so quickly.

Mike T
[Android Software/Hacking General [Developers Only]] androcraze:
Under Linux:

./sdat2img.py system.transfer.list system.new.dat system.img

File "./sdat2img.py", line 77

print ("Writing to %d... " % begin, end=""),

^

SyntaxError: invalid syntax

I should be able to run it as a python script, no?
[Android Software/Hacking General [Developers Only]] xpirt:
do you have python 3.4?
[Android Software/Hacking General [Developers Only]] androcraze:
3.3.2. The earlier script worked OK.

EDIT:

I just changed line 77 to:

print ("Writing to %d... " % begin),

and it seemed to work. There's something with the end="" syntax.
[Android Software/Hacking General [Developers Only]] xpirt:
[MENTION=5061138]androcraze[/MENTION] ok, then I'll let it out.

sdat2img.py: fixed and improved code
[Android Software/Hacking General [Developers Only]] sandiprickyroy:
Make a video and share on Youtube
[Android Software/Hacking General [Developers Only]] wvcadle:
I double-clicked on the paths and nothing happened. Running Windows 8.1. Does it take a long time once double-clicked? Any ideas?
[Android Software/Hacking General [Developers Only]] Dilshad969:
Used to decompress ext4 but the image created is not editable. It has read-only permissions so cannot modify anything in that nor can it be copied into another path
[Android Software/Hacking General [Developers Only]] Rapier:
Maybe I've missed something but after extracting the zip there's no executable in there... The link goes to a page where there are 2 files for download: an .exe (ext2explore.exe) and a zip (ext2read2.0beta.zip). In first step you said " once downloaded (the link above) extract the contents from the zip (i just went ahead and extracted to my desktop)" then in second step "right click the linux penguin"...now I'm asking which linux penguin as there is none (at least I don't have it)?

EDIT: Nevermind, I've solved it. Instead of using that ext2explore I found another app called ext4unpacker (HERE). With it I could open the system.img
[Android Software/Hacking General [Developers Only]] moonryder:
[MENTION=5132229]xpirt[/MENTION]:

hi i am trying out cygwin the first time.

so i installed it and followed your Windows Guide

First i realized that i had to replace th sdat2img and rimg2sdat files with the ones from post #4.

Step 1 worked (decompressing)

Step 2 didn´t --> you write in your Windows Guide

i tried the command

But this command does not work with cygwin (of course cuz it is an ubuntu command...)

so what to do?

Thx in advance

m.
[Android Software/Hacking General [Developers Only]] xpirt:
didnt't understand this sentence: "of course cuz it is an ubuntu command...", cygwin is meant for running some (not all) of linux commands on windows.

a command which doesn't exist is sudo, that's why, try only "mount -t ext4 -o loop system.img output/", if still doesn't work I suggest going to ubuntu anyway.
[Android Software/Hacking General [Developers Only]] moonryder:
the command does not work without sudo, so it doesn´t work at all.

Atm i install Fedora on an usb stick to make it ...;)
[Android Software/Hacking General [Developers Only]] androcraze:
Either via sudo or as root from a terminal:

"mkdir /mnt/temp"

"mount -t auto -o loop system.img /mnt/temp/"

you could have any folder instead of "/mnt/temp", but it has to be a real folder.
[Android Software/Hacking General [Developers Only]] moonryder:
thx for the reply BUT:

just for test i tested the command "mount -f auto -o loop system.img /image"

and this is the result:

So the question is: did i miss something at the installation of cygwin?

I installed ggc-core, make, openssl, ssh, vim, ftp and python.

Help will be great (cuz i am a newbee on linux :angel:)
[Android Software/Hacking General [Developers Only]] androcraze:
This is what I'm reading: http://stackoverflow.com/questions/629827/loop-mount-in-cygwin

According to the link, you have to use another tool to mount images.

In post #40 in this same thread: http://xdaforums.com/showpost.php?p=57742855&postcount=40

The script provided worked well enough to mount and extract the .img file. You may want to follow that, or use a Fedora Linux self-booting ISO image.

I don't use cygwin; I use Linux, and the mount command with "loop" works there.
[Android Software/Hacking General [Developers Only]] Sc4ryB3ar:
I am wanting to extract a couple of files of a custom Rom, on my phone. Is there a file management app that allows me to extract those files from the .dat?
[Android Software/Hacking General [Developers Only]] amf66:
Linux binaries still aren't up, correct? Getting a

Andoid sparse image file parser from howellzhu
Version must be 1.

error with sdat2img on Ubuntu with a 5.1 ROM.
[Android Software/Hacking General [Developers Only]] xpirt:
still not updated, but you can use python sdat2img.py and run it using python.
[Android Software/Hacking General [Developers Only]] koala990:
[MENTION=5132229]xpirt[/MENTION] Sir, can you please mirror the latest sdat2img somewhere else. I just cant download it from Mega. Please, or anyone else here can do it?
[Android Software/Hacking General [Developers Only]] flonec:
error !
[Android Software/Hacking General [Developers Only]] androcraze:
http://fixpcnyc.com/the-program-can...fix-the-error-and-download-msvcr100-dll-file/
[Android Software/Hacking General [Developers Only]] flonec:
was unexpected at this time
[Android Software/Hacking General [Developers Only]] androcraze:
"sdat2img <transfer_list> <system_new_file> <system_img>"

is an example.

It should be:

"sdat2img system.transfer.list system.new.dat system.fixed.img"

This is of course after copying the above files AND the sdat2img.exe file to "Desktop" or whatever folder you're working with CMD.EXE in.
[Android Software/Hacking General [Developers Only]] dedelamalice:
i found thanks
[Android Software/Hacking General [Developers Only]] Bass_Face:
u saved the day :D
[Android Software/Hacking General [Developers Only]] m0han:
+1. mega out of bounds here. please help, [MENTION=5132229]xpirt[/MENTION]. thanks.
[Android Software/Hacking General [Developers Only]] Tech N You:
[MENTION=5132229]xpirt[/MENTION] first of all thanks for this awesome guide.

I request you to check my

F2I Converter

for windows which can convert system folder back to ext4 image and then it compresses it back to dat as per your guide.

If you find it okay and easy to use kindly add this in your thread so that users can easily get it.

It works without any cygwin setup. Just download extract and run.

Regards
[Android Software/Hacking General [Developers Only]] josfr4ncisco:
Not sure if someone already mentioned that, but when decompressing EXT4 files on Windows (2nd step), you could use this tutorial, instead of using Cygwin/Ubuntu.
[Android Software/Hacking General [Developers Only]] xpirt:
already mentioned, but there's no way to pack it back with that app.
[Android Software/Hacking General [Developers Only]] josfr4ncisco:
Ah, I see. But for unpacking-only purposes, it's handful :)
[Android Software/Hacking General [Developers Only]] Skies/SANKE:
Type:./sdat2img system.transfer.list system.new.dat system.img

Prompt bash: ./sdat2img:Insufficient permissions

Why???????
[Android Software/Hacking General [Developers Only]] Anmol9808:
Type chmod u+x sdat2img ,I hope that will work :)
[Android Software/Hacking General [Developers Only]] Skies/SANKE:
Failure =.=
[Android Software/Hacking General [Developers Only]] androcraze:
Under Linux:

chmod 0755 sdat2img.py

or whatever the file is called.
[Android Software/Hacking General [Developers Only]] komprado:
Did not try from under Windows?
[Android Software/Hacking General [Developers Only]] Q9Nap:
[MENTION=5132229]xpirt[/MENTION], thanks for these very useful tools and tutorials :)

*edit*

nm, got it working...
[Android Software/Hacking General [Developers Only]] Primokorn:
I'm on Linux Mint 17.1 Rebecca since this morning. I already have Python (Version : 2.7.5-5ubuntu3) but I don't know how to use it for the step 1.

I downloaded and renamed sdat2img through chmod 0755 sdat2img.py.

Here is the message I have from the terminal.

~/Bureau/CM/cm-12.1-20150531-NIGHTLY-hammerhead $ ./sdat2img.py system.transfer.list system.new.dat system.img
Android sparse image file parser from howellzhu
Version must be 1.

OR

~/Bureau/CM/cm-12.1-20150531-NIGHTLY-hammerhead $ python
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> ./sdat2img.py system.transfer.list system.new.dat system.img
File "<stdin>", line 1
./sdat2img.py system.transfer.list system.new.dat system.img
^
SyntaxError: invalid syntax
>>>

OR

~/Bureau/CM/cm-12.1-20150531-NIGHTLY-hammerhead $ python sdat2img.py
File "sdat2img.py", line 1
SyntaxError: Non-ASCII character '\x83' in file sdat2img.py on line 2, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
[Android Software/Hacking General [Developers Only]] brandonabandon:
same error^

seems to work for 5.02 roms and not for 5.1.
[Android Software/Hacking General [Developers Only]] Primokorn:
Solved!

Here are the steps I used for Linux Mint (STEP 1 only):

1. Download zip from Github: https://github.com/xpirt/sdat2img

2. Extract it and copy sdat2img.py to your ROM folder

3. Open Terminal and type chmod 0755 sdat2img.py

4. Then type python sdat2img.py

5. And ./sdat2img.py system.transfer.list system.new.dat system.img

I'm not sure if all these steps are correct (as I'm a Linux newbie) but it works

~/Bureau/CM/cm-12.1-20150531-NIGHTLY-hammerhead $ ./sdat2img.py system.transfer.list system.new.dat system.img
Copying 32770 blocks into position 0...
Copying 2 blocks into position 32833...
Copying 32188 blocks into position 33347...
Copying 2 blocks into position 65536...
Copying 2 blocks into position 98304...
Copying 2 blocks into position 98369...
Copying 32188 blocks into position 98883...
Copying 2 blocks into position 131072...
Copying 2 blocks into position 163840...
Copying 2 blocks into position 163905...
Copying 20233 blocks into position 164419...
Copying 2 blocks into position 196608...
Copying 2 blocks into position 229376...
Copying 2 blocks into position 229441...

Done! Output image: /home/arnaud/Bureau/CM/cm-12.1-20150531-NIGHTLY-hammerhead/system.img
[Android Software/Hacking General [Developers Only]] brandonabandon:
^confirmed. i tried substituting the exe. (./) with python. which clearly failed.
[Android Software/Hacking General [Developers Only]] Primokorn:
Here is the step 2 if needed:

1. Create a new folder called output

2. Terminal : sudo mount -t ext4 -o loop system.img output/

3.

I had to use this command

4. Download and copy make_ext4fs (from OP) into your ROM folder

5. Type chmod 0755 make_ext4fs

6. Then : ./make_ext4fs -T 0 -S file_contexts -l 1073741824 -a system system_new.img output/

system_new.img created :)

I'll check step 3 later.The easiest step lol

STEP 3:

1. Copy rimg2sdat (to be downloaded from post 2) into your ROM folder

2. chmod 0755 rimg2sdat

3. ./rimg2sdat system_new.img (if you used the 'quick examples' provided by OP)
[Android Software/Hacking General [Developers Only]] brandonabandon:
works like a charm
[Android Software/Hacking General [Developers Only]] giltros1:
Great job
[Android Software/Hacking General [Developers Only]] Bidyadhar:
Somebody pls tell me how to fix this error!!

thanx in advance..

bidyadhar@bidyadhar-VirtualBox:~$ sudo su

[sudo] password for bidyadhar:

root@bidyadhar-VirtualBox:/home/bidyadhar# apt-get install lib32stdc++6

Reading package lists... Done

Building dependency tree

Reading state information... Done

E: Unable to locate package

E: Couldn't find any package by regex 'lib32stdc++6'

root@bidyadhar-VirtualBox:/home/bidyadhar#

I am unable to install lib32stdc++6
[Android Software/Hacking General [Developers Only]] nelvinchi:
The apt-get command works for me...

nelv@Linux-Acer:~/carbonrom$ sudo apt-get install lib32stdc++6

[sudo] password for nelv:

Reading package lists... Done

Building dependency tree

Reading state information... Done

lib32stdc++6 is already the newest version.

lib32stdc++6 set to manually installed.

The following packages were automatically installed and are no longer required:

libkprintutils4 libkutils4 ttf-dejavu-extra

Use 'apt-get autoremove' to remove them.

0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.

nelv@Linux-Acer:~/carbonrom$

Try checking that there are no broken dependencies:

sudo apt-get check

Then retrieve new lists of packages:

sudo apt-get update

Try again:

sudo apt-get install lib32stdc++6
[Android Software/Hacking General [Developers Only]] hunny5120:
after repacking to img its showing 1.1gb system_new.img file and after repacking it to dat its showing 352kb system_new.dat file

am i doing wrong or do i need to use that new dat file . help me
[Android Software/Hacking General [Developers Only]] Primokorn:
make_ext4fs is for Linux. Use this tool once you have your system.img (step 1 from OP).
[Android Software/Hacking General [Developers Only]] xpirt:
that was not an error because of my binaries. you could have fixed it by yourself instead of waiting for a reply 3 weeks.

also.. really: bash: ./make_ext4fs: No such file or directory, isn't clear enough?
[Android Software/Hacking General [Developers Only]] androcraze:
Did you change the permissions to 755 (rwx, r x, r x)?
[Android Software/Hacking General [Developers Only]] Bidyadhar:
Guys ..... can anybody give me the replacement set for for porting lollipop roms for 64 bit processor..
[Android Software/Hacking General [Developers Only]] sfoot13:
:good: All that I can say is: "Thank You very much Alex" :o

I was looking for a script like this :)
[Android Software/Hacking General [Developers Only]] jad88:
The same for me
[Android Software/Hacking General [Developers Only]] greeshan:
After repacking, need edit system.transfer.list or not? But after repacking i cannot install my zip from recovery with new system.new.dat. Error in binary script file bla bla bla.....
[Android Software/Hacking General [Developers Only]] popo72:
Same for me....everithing seems ok but whe installing rom via TWRP I get error
[Android Software/Hacking General [Developers Only]] greeshan:
Yes, why nobody ask for this.... I make new .dat file without errors and cant flash it from recovery.... everything errors when i try to flash it. I think system.transfer.list not true after repacking system folder to system.dat.new.

If use stock system.transfer.list, install without error, but it no complete, installing.... wait very long
[Android Software/Hacking General [Developers Only]] birdie:
./sdat2img.py system.transfer.list system.new.dat system.img
Traceback (most recent call last):
File "./sdat2img.py", line 102, in <module>
main(sys.argv)
File "./sdat2img.py", line 83, in main
print('Copying {} blocks into position {}...'.format(block_count, begin))
ValueError: zero length field name in format

Doesn't work with CM-12.1 nightlies.

Luckily SystemExtractor_v1.5.zip works.
[Android Software/Hacking General [Developers Only]] greeshan:
who happened to run firmware after recompression DAT file?

After comression to DAT i get error in Recovery(TWRP 2.8.7.0). If i copy system folder to my ROM.zip and flash, i get bootloop(i try to make updater-script for lollipop, but fails). Maybe anybody can help me or help me with make true updater-script for my system folder?
[Android Software/Hacking General [Developers Only]] Octanium91:
I can, I use the method of installation with EXT3 file system?

If not, will there such a possibility in the future?

p.s. Converting on Windows 8.1 64bit - ok, BUT not install, give me error of versions (errorcode: 1).

and i try install Android 4.4.4

Thanks in advance for your reply.
[Android Software/Hacking General [Developers Only]] xpirt:
should be fixed with latest commits (on github). please test and report.
[Android Software/Hacking General [Developers Only]] xpirt:
already available on OP.. https://github.com/xpirt/sdat2img
[Android Software/Hacking General [Developers Only]] Octanium91:
I do not understand how to compile. I tried through QT.

if someone compiled ask to share =)

Thanks!
[Android Software/Hacking General [Developers Only]] xpirt:
you don't necessarily need to compile it. if you have python installed just run it as a normal binary.
[Android Software/Hacking General [Developers Only]] kenzukie:
Any idea i get this NOT RECOGNIZED AS AN internal or external command
[Android Software/Hacking General [Developers Only]] xpirt:
did you try at least to decompress it and compress it back with latest binary?
[Android Software/Hacking General [Developers Only]] greeshan:
Who can compile it in exe file for Windows, I don't have python and I need install it for check new version...
[Android Software/Hacking General [Developers Only]] greeshan:
I use new sdat2img.py from github, extract system.img, then unpack it to system folder, then repack it to system.img and system.new.dat. Replace system.new.dat and system.transfer.list i my rom.zip, flash it from recovery(TWRP 2.8.7.0) and i dont have error in binary, but system install was very fast, 1 second and system not installed. I think error need search in system.transfer.list, its very big compare with stock system.transfer.list.

Updated 11.07.2015:

I just repack (On Windows 8.1_x64) system.new.dat to system.img and then without changes repack system.img to system.new.dat (with new .list file) and system installed without errors, but not start, bootloop and then reboot to recovery.
[Android Software/Hacking General [Developers Only]] devilmaycry2020:
Hi all

For everyone use window to extract Lolipop system.dat, After first step use can use DiskInternals Linux Reader to extract system.img for easier
[Android Software/Hacking General [Developers Only]] sdeft:
[MENTION=5132229]xpirt[/MENTION]. How did you figure the -l 1073741824 in below command ? Is it phone related or we should always use this value ?

/make_ext4fs -T 0 -S file_contexts -l 1073741824 -a system system_new.img output/

one more question

when I run rimg2sdat system_new.img I get a system.transfer.list which is different from the original one. Why is this ?
[Android Software/Hacking General [Developers Only]] xpirt:
can you post it?
[Android Software/Hacking General [Developers Only]] sdeft:
attached in my previous post...
[Android Software/Hacking General [Developers Only]] xpirt:
alright, the rimg2sdat uses old method from version 1. needs to be updated to work with versions 2 of transfer list (android 5.1).

will look into it asap..
[Android Software/Hacking General [Developers Only]] sdeft:
ok thanks...what about my other question for -l 1073741824 ?
[Android Software/Hacking General [Developers Only]] xpirt:
it's the length (size) of the image file. in this case 1gb.
[Android Software/Hacking General [Developers Only]] sdeft:
yes but how do you calculate this ? are all .imgs of the same size ?
[Android Software/Hacking General [Developers Only]] greeshan:
This is size of your unpacked system.img from system.new.dat.
[Android Software/Hacking General [Developers Only]] bdorr1105:
Any chance that you could update this? No luck with some cm 12.1 ROMs on Windows.
[Android Software/Hacking General [Developers Only]] Alexey71:
Give an example ROM
[Android Software/Hacking General [Developers Only]] bdorr1105:
Nevermind, I saw the system.new.dat.zy file and I didnt know all you had to do was extract that to get the dat file. All is good thanks
[Android Software/Hacking General [Developers Only]] sdeft:
so you always set it to the size of the unpacked system.img even if you make changes to the system.img (delete or add apks) ?