yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] tirta.agung:
Huft, finally I got it working with my Trusty Tahr's kernel (linux-lts-utopic_3.16.0) by patching the source code the hard way, writing line per line, hahahahahaha:crying:. I've checked and compared all the patches listed on your uml-xcomp github page with the utopic's kernel source that I use, and I've found that patches on lz4 are older than the one I've found in the utopic. Those patches are:

https://github.com/CyanogenMod/andr...73d668898e5996ea7a985b4661e8648716e1fe8.patch

https://github.com/CyanogenMod/andr...54ef65eda0923f7567ee1effde28bc24e38e501.patch

https://github.com/CyanogenMod/andr...86d62e96d862a0999016e1213a7f4f3a611e9c9.patch

https://github.com/CyanogenMod/andr...b432932e3e1ffad2980ee53fe286cbf887fa81f.patch

https://github.com/CyanogenMod/andr...fb22f6262df1a39c2ef52646839502d61220ffb.patch

https://github.com/CyanogenMod/andr...d1310c997bda926a66afc2787227a95cd8909f3.patch

https://github.com/CyanogenMod/andr...0d3b57af683ce51642123509d9d0a9c7459ee03.patch

https://github.com/CyanogenMod/andr...8886e1e90dbe348c45989d5eead9f7b6c740f57.patch

There are only three patches that I have used to add CM's Transparent Compression v.2, and they are:

https://github.com/CyanogenMod/andr...59d826ab6703c48708b5146d45fcc9c666e04fd.patch

https://github.com/CyanogenMod/andr...21fc8332dccc80c9ecd01a0fb68c483c2dbac80.patch

https://github.com/CyanogenMod/andr...ec68c7e54e1b45d57c5a4b5fd02e4e25380e398.patch

I hope somebody could update ubuntu's kernel git with all of these patches, so they could be included on the next update.
[Android Software/Hacking General [Developers Only]] anis_mulla:
both must in same directory
[Android Software/Hacking General [Developers Only]] anis_mulla:
how to do 2nd step in cygwin ?

plz guide..
[Android Software/Hacking General [Developers Only]] ehsan_zamani_68:
for samsung i9500

how extracted system.transfer.list ?
[Android Software/Hacking General [Developers Only]] Wuby986:
does i9500 use .dat files!?!?!? i mean you download the stock and it comes in .dat?
[Android Software/Hacking General [Developers Only]] ehsan_zamani_68:
no

i extraced system.img&boot.img in rom.tar.md5

I am a novice help me

i need edit rom i9500 5.0.1

This method is the answer for me?

how to edit system.img?
[Android Software/Hacking General [Developers Only]] doromax:
Hi, I need some info.

I have a Note 4 lollipop 5.1.1 original samsung Rom. in tar.md5 format.

I open it with 7z and I extract system image. System image is in format ==> system.img.ext4

I try to open it with all I know but with no sucess !

I used :

1- SGS2ext4.jar ==> Gime me 32bytes error loop

2- EXT4unpacker ==> no a valide image-file

3- Linux reader ==> error loading image / cant' open at end

4- EXT2explorer ==> don't read the image

5- UFS explorer ==> found reiserFS partition but no file tree !

6- Explore2fs ==> Could not find valid Superblock

How can I do ? :((
[Android Software/Hacking General [Developers Only]] carl1961:
try this tool, unzip to your c:\drive

drop your system.img.ext4 in folder and double click the coridponding .bat file to try and unpack
[Android Software/Hacking General [Developers Only]] Wuby986:
both of you are in the wrong tread.. it says .dat files you talk about .img ..

you tried using a kitchen like DSI even if old should work? or simg2img binary in cigwin to convert from sparse img to regular one and then Linux-reader to open it? then you will need to repack.. but is different thing.. you can find many info online.. anyway i suggest you to edit and repack directly from the phone using the built-in make_ext4fs binary..
[Android Software/Hacking General [Developers Only]] doromax:
Thanks a lot !! this tool extract direcly all folders from "system.img.ext" to my directory !!!! :):cool::svetius::svetius::svetius:
[Android Software/Hacking General [Developers Only]] tetsuo55:
Hi i am getting this error:

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

No valid command: move.

I am trying to extract the Z3 marshemllow OTA available here: https://mega.nz/#F!9R83nArY!SPzLkUH8nWENPPt8FA8R_Q
[Android Software/Hacking General [Developers Only]] xpirt:
OTAs are not supported at the moment.
[Android Software/Hacking General [Developers Only]] tetsuo55:
Do you know of any other way to extract the contents out of the Ota?
[Android Software/Hacking General [Developers Only]] fisher6:
I'm trying to build CM for my device but keep getting this error:

Traceback (most recent call last):
File "./build/tools/releasetools/ota_from_target_files", line 1719, in <module>
main(sys.argv[1:])
File "./build/tools/releasetools/ota_from_target_files", line 1676, in main
WriteFullOTAPackage(input_zip, output_zip)
File "./build/tools/releasetools/ota_from_target_files", line 627, in WriteFullOTAPackage
system_tgt = GetImage("system", OPTIONS.input_tmp, OPTIONS.info_dict)
File "./build/tools/releasetools/ota_from_target_files", line 485, in GetImage
return sparse_img.SparseImage(path, mappath)
raise ValueError("Magic should be 0xED26FF3A but is 0x%08X" % (magic,))
ValueError: Magic should be 0xED26FF3A but is 0x00000003

I'm on Linux Mint. Thanks.
[Android Software/Hacking General [Developers Only]] lingowistico:
Thanks a lot, works with CyanogenMod 13! :) :good:
[Android Software/Hacking General [Developers Only]] -lukin-:
hey guys... massive thanks to the author/devs behind this thread!

i'm able to decompress a system.transfer.list and system.new.dat to extracted system.img folder, no problem

i can also compress back into system.img, no problem

my problem seems to be related to Rimg2sdat not compressing system.img -> new system.transfer.list and new system.new.dat properly ... in particular the new system.transfer.list is incomplete and incorrect

here's the system.transfer.list before/original and after/modified (below). i'm not making a big change to system image, just deleted the boot stock boot animation or small change to build.prop

original system.transfer.list

2
152417
0
0
erase 2,0,262144
new 32,0,32767,32768,32770,32833,32835,33347,65535,65536,65538,98304,98306,98369,98371,98883,131071,131072,131074,163840,163842,163905,163907,164419,196604,196608,196610,229376,229378,229441,229443,229955,253022

modified system.transfer.list

1
129548
erase 2,0,655320
new 160,0,160,161,281,675,676,10914,28441,28443,30134,30137,32247,32250,32258,32261,32262,32271,32277,32287,32364,32367,32404,32407,32508,32511,32568,32571,32608,32611,32665,32667,32692,32695,32697,32698,32756,32759,32767,32768,32770,32929,32930,33443,33474,33477,33563,33565,33619,33622,33723,33726,35565,35566,39981,39982,40560,40561,40600,40601,40621,40622,40656,40661,40672,40673,40801,40804,40835,40836,41121,41122,41123,41124,41168,41171,41741,41746,41750,41751,63516,63517,65535,65536,65537,98304,98306,98465,98466,98979,101342,101345,106016,106017,109872,109879,110042,110043,111636,111637,114612,114614,114621,114627,114648,114649,114650,114669,115769,115770,131071,131072,131073,163840,163842,164001,164002,164515,186463,186464,196607,196608,196609,229376,229378,229537,229538,230051,241237,241239,241271,241273,241290,241292,241301,262144,262145,294912,294914,295073,295074,327680,327681,360448,360449,393216,393217,425984,425985,458752,458753,491520,491521,524288,524289,557056,557057,589824,589825,622592,622593

notice: the version number changed from 2 to 1 ; lines 3 and 4 are missing ; erasing way too many blocks ; and writing way too many blocks as well

let me know what other information would be helpful

thanks very much :eek:
[Android Software/Hacking General [Developers Only]] Kritsada Chaitan:
Hello sir. xpirt help me please i make flashablezip for flash system.new.dat rom

when updater-binary error for flash in custom reovery

please howto fix it sir.

thank you.
[Android Software/Hacking General [Developers Only]] haqanguven:
recompile?
[Android Software/Hacking General [Developers Only]] Darsandev:
This guide didn't make any sense!

Where should i run this command?

What is the use of python here?

when i run this command in cmd, it says error at line:50. Too bad
[Android Software/Hacking General [Developers Only]] anagramgenius:
Install python. The script mentioned in OP is a python script and hence you need python framework.
[Android Software/Hacking General [Developers Only]] Kritsada Chaitan:
try this tool sir. http://xdaforums.com/android/software-hacking/tool-tool-unpack-repack-dat-img-v2-0-t3284806
[Android Software/Hacking General [Developers Only]] xpirt:
this tool is for developers only (as mentioned in thread title) or atleast for those who understand how to use it.
[Android Software/Hacking General [Developers Only]] haqanguven:
thank :)
[Android Software/Hacking General [Developers Only]] jung.ok:
Thank you for the post, its much to help me build new rom
[Android Software/Hacking General [Developers Only]] -lukin-:
Hey guys,

Any thoughts on post #525 ?

http://xdaforums.com/showpost.php?p=64549031&postcount=525

Thanks
[Android Software/Hacking General [Developers Only]] HeckNoTechnO:
I hope someone can help me here. My ubuntu skills are limited and rusty. I keep getting this error:

root@mbeam-Inspiron-5548:/home/mbeam/Documents# sudo su ./sdat2img.py system.transfer.list system.new.dat system.ext4

No passwd entry for user './sdat2img.py'

root@mbeam-Inspiron-5548:/home/mbeam/Documents#

Any help would be appreciated
[Android Software/Hacking General [Developers Only]] CBpbxEcmecmBeH:
obviously you're root already, judging by the beginning of the line you posted.

You DON'T need to write sudo su before executing the scripts. That's why it complains that there's no such user [emoji6]
[Android Software/Hacking General [Developers Only]] HeckNoTechnO:
Not sure why I am getting a permission denied error?

root@mbeam-Inspiron-5548:/home/mbeam/Documents# ./sdat2img.py system.transfer.list system.new.dat system.ext4

bash: ./sdat2img.py: Permission denied
[Android Software/Hacking General [Developers Only]] CBpbxEcmecmBeH:
i don't know about that.. can you not run it as a normal user (mbeam)?
[Android Software/Hacking General [Developers Only]] yuweng:
Mouse right-click at sdat2img.py => Properties => Permissions => Execute: => put a check mark at Allow executing file as program then only at terminal

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

OR

Open a terminal where sdat2img.py is located

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

OR

Right away execute it

python sdat2img.py system.transfer.list system.new.dat system.img
[Android Software/Hacking General [Developers Only]] HeckNoTechnO:
Thanks that took care of the permissions error but now this is what I am getting:

mbeam@mbeam-Inspiron-5548:~/Downloads/sdat2img-master$ ./sdat2img.py system.transfer.list system.new.dat system.img

No valid command: imgdiff.
[Android Software/Hacking General [Developers Only]] yuweng:
sudo apt-get install [COLOR="Blue"]imgdiff[/COLOR]

There might be a few more missing dependencies then just install those. i strongly recommend using BBQLinux once & for all... :good:
[Android Software/Hacking General [Developers Only]] HeckNoTechnO:
I really appreciate your helping out. I only have a limited amount of time during the day to work with this because I work 11 freaking hours a day! But here is where i'm at. Looks as if it can't find the imgdiff package.

I briefly looked at BBQ and I take it to be a stand alone OS? If so I may make a new partition and try it out.

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

No valid command: imgdiff.

sudo apt-get install imgdiff

[sudo] password for mbeam:

Reading package lists... Done

Building dependency tree

Reading state information... Done

E: Unable to locate package imgdiff
[Android Software/Hacking General [Developers Only]] androcraze:
I have no idea what "imgdiff" is. As a command, I'm not seeing it under Fedora, and my sdat2img.py works fine.

My sdat2img.py script is dated "2015-10-11". Are you sure you downloaded the actual script? It almost sounds like you grabbed a diff file instead. The link is here:

https://github.com/xpirt/sdat2img/blob/master/sdat2img.py
[Android Software/Hacking General [Developers Only]] HeckNoTechnO:
Installing bbq in a virtual machine. So far it looks sweet!

---------- Post added at 09:48 PM ---------- Previous post was at 09:10 PM ----------

OK getting same error with BBQ. Do I need to put these files in a certain directory? I hate it when crap doesn't work as expected. I am by no means a linux/unix guru but I have messed around with this stuff for years. I am not one to give up but I am very frustrated at this point.
[Android Software/Hacking General [Developers Only]] yuweng:
Whoops, my bad, i've never use Ubuntu for years now & a quick search shows that imgdiff itself is a python library... :o xpirt's script works on BBQ, as androcraze suggest, try the link, may be you're using the wrong script or the EOL problem or you're using the wrong Python, however having said that, i've tested both Python 2 & 3 works though OP suggest using Python 3, other than that, i really donno why it doesn't work on yours... :cowboy:

At BBQLinux => Menu => Administration => BBQLinux Python Switcher
[Android Software/Hacking General [Developers Only]] rajlko:
while creating image file everything works well

root@raj-VirtualBox:/media/sf_share/base# ./make_ext4fs -T 0 -S file_contexts -l 1073741824 -a system system_new.img output/

Creating filesystem with parameters:

Size: 1073741824

Block size: 4096

Blocks per group: 32768

Inodes per group: 8192

Inode size: 256

Journal blocks: 4096

Label:

Blocks: 262144

Block groups: 8

Reserved block group size: 63

Created filesystem with 11/65536 inodes and 8536/262144 blocks

But while converting .date file

root@raj-VirtualBox:/media/sf_share/base# ./rimg2sdat system_new.img

rimg2sdat tool, provided by Howellzhu@gmail.com

Data block: 86 (344 KBs)

Zero block: 262058 (1048232 KBs)

Total block: 262144 (1048576 KBs)

root@raj-VirtualBox:/media/sf_share/base#

.dat file is just 344 KBs but system_new.img is 1GB.

please help.

while flashing system_new.img from fastboot,

D:\ADB>fastboot flash system system_new.img

target reported max download size of 268435456 bytes

Invalid sparse file format at header magi

erasing 'system'...

OKAY [ 3.197s]

sending sparse 'system' (344 KB)...

OKAY [ 0.021s]

writing 'system'...

OKAY [146.181s]

finished. total time: 149.403s

D:\ADB>

it says system_new image file size is jut 344 KB, means there is issue in packing system_new.img, please help.
[Android Software/Hacking General [Developers Only]] GamerOnOne:
How do you extract system.img to a folder for lolipop 5.1.1 samsung roms
[Android Software/Hacking General [Developers Only]] supersonic835:
I followed the ubuntu guide, and everything went smooth.

When I flashed the new rom to my tv box, i lost root, and none of the apps in preinstall loaded to my box.

any ideas what went wrong or what changes i need to make?
[Android Software/Hacking General [Developers Only]] sahil314:
help me please

Actuallly I was porting a ROM to my phone and I have system folder in it with all folder in it like( priv_app,app,framwork,lib etc) and I want to convert it to system.new.dat but I dont have any. Img file... Please hlp
[Android Software/Hacking General [Developers Only]] GamerOnOne:
I get permission denied everytime I try to extract system.img
[Android Software/Hacking General [Developers Only]] GROGG88:
Perform as root.
[Android Software/Hacking General [Developers Only]] kantjer:
I'm trying to make flashable vendor.zip's for the P6

I extracted the vendor.img from the factory image and opened that using sudo mount -t ext4 -o loop.

Now I have a folder containing all vendor image files folders and those need to be converted back to a .dat file but the factory image doesn't contain a transfer_list so I'm stuck now.

Any idea/tips how to continue.
[Android Software/Hacking General [Developers Only]] brownstyle:
now how to do exactly step no. 2 on windows.please give the proper or complete step.thanks
[Android Software/Hacking General [Developers Only]] brownstyle:
what is the right command in cgywin?
[Android Software/Hacking General [Developers Only]] adithyan25:
if any one face any problem try this software created using this method

http://xdaforums.com/showthread.php?t=3309285

just follow the video tutorial
[Android Software/Hacking General [Developers Only]] ehsan_zamani_68:
hi dears

i unpack & repack system lenovo A7-GC android 5.x

but tablet after flash system

tablet reset and log in to recovery

i repack & unpack system by "make_ext4fs" , "simg2img" in ubonto

please help me

i need your help
[Android Software/Hacking General [Developers Only]] anandmore:
[MENTION=5132229]xpirt[/MENTION]

If i have to install cygwin on windows,

Which packages i have to install ??

Will the base package be enough or u have to install some add-ons ??

Like gcc, bash, less, etc.
[Android Software/Hacking General [Developers Only]] komprado:
[MENTION=315208]Zeus[/MENTION], Welcome to Linux
[Android Software/Hacking General [Developers Only]] brownstyle:
./sdat2img.py no such file or directory....help pls
[Android Software/Hacking General [Developers Only]] lost101:
[MENTION=5132229]xpirt[/MENTION] - Maybe some of this can be added to OP? Please correct any mistakes I have made here.

Here is some info for people working with Stock Firmware Images, and any Stock-based ROMs or any ROM without: file_contexts, system.new.dat, system.transfer.list

Extracting 'file_contexts' from Kernel (boot.img):

(1) Install SuperR's Kitchen

(2) Start a new project

(3) Place your boot.img in the project folder

(4) Choose 'unpack boot.img' using option 7 - "Boot / Recovery Tools"

(5) Check <project_name>/bootimg/ramdisk for 'file_contexts'​

Stock Firmware Images / Sparsechunks / Stock ROMs:

(1) Decompress sparsechunks and extract to 'system' folder (Tutorial)

(2) Rename 'system' folder to 'output'

(3) Add 'file_contexts' from boot.img (See above) to ROM folder (Working folder)

(4) ./make_ext4fs -T 0 -S file_contexts -l 900M -a system system_new.img output/

(5) ./rimg2sdat system_new.img​

Note:

The step 4 value above - "900M" - needs to be changed to match (or be less than) the size of your /system partition. Check size in TWRP > Wipe > Advanced Wipe > Select 'System' - Repair / change​
[Android Software/Hacking General [Developers Only]] joeBiever:
pliz update any rapacking system :victory: :fingers-crossed:

thanx sir,
[Android Software/Hacking General [Developers Only]] ehsan_zamani_68:
i use binery make_ext4fs of last SuperR's Kitchen

My problem was solved

and use this code

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

:D

---------- Post added at 09:25 PM ---------- Previous post was at 08:44 PM ----------

my problem now

i unpack(use kitchen) system i9500 lollipop(5.0.1)

& edit apk

Then repack this code

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

i see error in ubuntu

[IMG="http://uupload.ir/files/60ny_screenshot_from_2016-02-15.png"]http://uupload.ir/files/60ny_screenshot_from_2016-02-15.png[/IMG]

then create TAR file for flash system.img new for odin (use this code in ubuntu"tar -H ustar system.img >> tar9500.tar "

after flash "tar9500.tar" in windows

i see error

[IMG="http://uupload.ir/files/pka4_untitled.png"]http://uupload.ir/files/pka4_untitled.png[/IMG]

I need you to help me to solve this problem

thanks
[Android Software/Hacking General [Developers Only]] Typhus_:
[MENTION=5132229]xpirt[/MENTION]

Thank you for this explanation and guide(s).

Could you, perhaps, help me?

I have a stock zip with a Lollipop ROM in dat format.

While on sotck, I've made some changes. I've added root, xposed and removed a bunch of bloat apps.

Made a system backup, while on TWRP. Converted wim backup format to tar.gz and extracted the system folder.

Used this guide to convert "my custom stock ROM version" system folder to system.img and, afterwards, to system.new.dat.

The final result was a system.new.dat and system.transfer.list.

The original system.transfer.list was for Lollipop, therefore it had the 2;"blocksize";0;0;"changes". The system.transfer.list obtained with the conversion was 1;blockzie;changes.

Either way, I've tried to replace both system.new.dat and sytem.transfer.list on the original sotck ROM zip. Made it with two variants (sytem.transfer.list obtained with the conversion, and an edit one to match the original sytem.transfer.list "type").

The zip does not flash. I obtain an error that ends with "ended with signal: 11".

Tried to do the same using as base a custom CM12.1, also in dat format.

The zip does not flash neither. I obtain an error that ends with "ended with signal: 6".

Since I'm not familiar with TWRP signal codes... can you (or anyone) guide me into a solution?

Thanks!
[Android Software/Hacking General [Developers Only]] apoorv.mehrotra:
Help

Hello,

Please refer below error when i get trying to edit system.img (its ready only),

apoorv@apvm:~/boot/benzo-sixzeroone-20160129-1045-shamu/Python-3.4.3$ sudo chown -R apoorv:apoorv /boot/benzo-sixzeroone-20160129-1045-shamu/Python-3.4.3/new_system.img

chown: cannot access ‘/boot/benzo-sixzeroone-20160129-1045-shamu/Python-3.4.3/new_system.img’: No such file or directory

apoorv@apvm:~/boot/benzo-sixzeroone-20160129-1045-shamu/Python-3.4.3$ ls

boot.img install new_system.img python-config.py

apoorv@apvm:~/boot/benzo-sixzeroone-20160129-1045-shamu/Python-3.4.3$
[Android Software/Hacking General [Developers Only]] ml11ML:
Hey guys,

i got this issue when trying to put the files back into a .img and .dat the command says* ./make_ext4fs: command not found*

what could be wrong?
[Android Software/Hacking General [Developers Only]] matrixex:
Oh come on respect the contributed just use his method well his methods are not too much hard. For me thanks contributed it worked

---------- Post added at 05:35 PM ---------- Previous post was at 05:32 PM ----------

Oh come on respect the contributed just use his method well his methods are not too much hard. For me thanks contributor it worked and if possible make a thread with use of updater script(edify) and make sure explain the topic set_perm() more deep

Again thanks -matrixex
[Android Software/Hacking General [Developers Only]] :
Downloaded OTA ZIP file for the LG Watch Urbane containing the Marshmallow update.

Tried to convert to img from dat and it works fine, but can't mount the img file...

$ ~/sdat2img.py system.transfer.list system.new.dat system.img
Copying 54888 blocks into position 0...

Done! Output image: /home/robert/Escritorio/system.img

$ sudo mount -t ext4 -o loop system.img output/
mount: tipo fs incorrecto, opción incorrecta, superbloque incorrecto en /dev/loop1,
falta página de código o programa ayudante, u otro error
En algunos casos se encuentra información en syslog, pruebe
[Android Software/Hacking General [Developers Only]] GROGG88:
simg2img system.img system.raw.img... Then mount the raw image...
[Android Software/Hacking General [Developers Only]] :
$ ~/sdat2img.py system.transfer.list system.new.dat system.img
Copying 54888 blocks into position 0...

Done! Output image: /home/robert/Escritorio/system.img

$ simg2img system.img system.raw.img
Invalid sparse file format at header magi
Failed to read sparse file

Also no luck
[Android Software/Hacking General [Developers Only]] Corvo007:
At the moment of that post there wasn't any other Windows method in this thread. And I don't see how is disrespectful if you post more methods...
[Android Software/Hacking General [Developers Only]] matrixex:
Hi sorry for the comment I have no intention of doing this so because I didn't know that contributer's method don't works on windows actually I have tested it in linus-ubunto

Again sorry for the comment/ forgive me

Well I have a new method but limited that is it can be only used if you choose custom rom for your device only Follow me

first flash that zip to your Device

Flash chainfire supersu ofcourse for rooting

reboot and install ESfile explorer and copy whole system after getting root permission.

Working right but limited.