Request help creating a file system.img - Android General

Hello all, I want to make a custom ROOM STOCK for Samsung devices so that it can burn in odin but all the tools (Tool Unpack Repack DAT + IMG) that create the file system.img require the file_contexts that I do not know how to get it (this is Android 4.1.2. File inside the boot)
I realized that I use the make_ext4fs file only because I do not know how it can be used by anyone who can help. I will thank him very much.::

Related

[Q] system.img file extraction

Hello guys,
I am trying to extract the system.img file from the Note 10.1 2014 edition stock ROM. It seems that Samsung had also manipulated the file system again. I used to generate an ext4 img file, so that I can mount it in Linux Reader on Windows. However, this method is not working any more.
The tool I used was sgs2img.jar, but as I said, it gets stuck on 32 bytes.
Any idea??
tweetatoo said:
Hello guys,
I am trying to extract the system.img file from the Note 10.1 2014 edition stock ROM. It seems that Samsung had also manipulated the file system again. I used to generate an ext4 img file, so that I can mount it in Linux Reader on Windows. However, this method is not working any more.
The tool I used was sgs2img.jar, but as I said, it gets stuck on 32 bytes.
Any idea??
Click to expand...
Click to collapse
I managed to extract a previous version of firmware of P600, MID, using first Chainfire's sgs4ext4fs utility - https://github.com/Chainfire/sgs4ext4fs - (compiled for Windows). First I trimmed the img with "sgs4ext4fs --trim system.img systemt.img" then I used sgs2ext4.jar to make the systemt.ext4.img file that could be mounted with Linux Reader.
However, the new MJ6 version doesn't work like that.
Maybe someone else could find out what's changed with the new versions.
I attached the Windows version of sgs4ext4fs utility because the source code must be slightly modified for Windows.
and.. did you extract the system.img ? I cant do it also from MK1 base for P600, and i wanted to make rom for that type

[Q] Repacking kernel.elf help

Hey guys,
I am trying to repack the stock kernel as I have made a change to the ramdisk (ro.secure=0) I wasn't able to split the boot.img using split_bootimg.pl as it could not find android magic in the header so used flashtool to extract the kernel.elf file which gave me 3 files.
These were "kernel.elf.Image" "kernel.elf.ramdisk.gz" and "kernel.elf.3"
I have managed to extract and make the changes to the ramdisk and recompile it but im stuck at merging these 3 files back into the flashable kernel.elf file any help would be much appreciated
Sonic5317 said:
Hey guys,
I am trying to repack the stock kernel as I have made a change to the ramdisk (ro.secure=0) I wasn't able to split the boot.img using split_bootimg.pl as it could not find android magic in the header so used flashtool to extract the kernel.elf file which gave me 3 files.
These were "kernel.elf.Image" "kernel.elf.ramdisk.gz" and "kernel.elf.3"
I have managed to extract and make the changes to the ramdisk and recompile it but im stuck at merging these 3 files back into the flashable kernel.elf file any help would be much appreciated
Click to expand...
Click to collapse
Maybe you should PM @DooMLoRD
I'm sure he will help you. He will surely reply to your message when he'll have some time.

[Tool] [Windows] Auto Tool Unpack Repack Rom Android .DAT

[Tool] [Windows] Auto Tool Unpack Repack Rom Android .DAT [No Cygwin] [No Linux]
***(Marshmallow Supported)***
Develop by MTK THAI ROM MODDER (Thiland) Group
Create Tool by: Kritsada Chaitan
SS:
Youtube : https://www.youtube.com/watch?v=nKYozWOETIU
-NOTE 1.-
***First Install Needed For Use This Tool.***
1. Java SDK
2. Python v3.xx
-NOTE 2.-
***First Copy system.new.dat , system.transfer.list To "Paste-DAT-Here" Folder.***
Download:
MEGA
Thank you Original Thread by: "xpirt" https://forum.xda-developers.com/member.php?u=5132229
Thanks for the tool
Bebooo43 said:
Thanks for the tool
Click to expand...
Click to collapse
Good.... ^^
It is a wonderful tool, brother.
is this tool works fine?
Getting error about incompatible operating system when recompressing dat so I tried on windows and got the same do I have to install the java or the phyton to a certain directory or the auto tool to a certain directory it extracted fine thanks in advance for the feedback
Can someone lend a hand.... Program works great. After removing a couple apps, one from 'app' another from 'priv-app', I made a zip file with 7zip and tried flashing but it fails. Is 7zip okay to make a zip file? was I not supposed to remove a 'priv-app' ? I can't find any solid guides on editing a MM rom. thanks in advance.
i succesfully unpack .dat files and repack .dat files (without edit anything) using this tool .
then i replace the repack .dat file to the rom and zip it and flash it .
but the problem is, when i flash i get error 7 system partition has unexpected contents after ota update . any solution ?
can't unpack system.new.dat cm14 (7.1)
Thank you very much, really useful
update - https://forum.xda-developers.com/an...tool-tool-unpack-repack-dat-img-v2-0-t3284806
Is it work for N based ROMs
tooolll
worked for me also...
t.y.
please update it to new version waiting for it.

Insert ROM in PDA file

I have a problem. I am new in the domain of android customization and that is why I am testing.
I have a PDA file for my old GT-S6102 Galaxy Y, which contains the following files:
boot.img
param.lfs
Sbl.bin
system.img
userdata.img
I also downloaded a custom ROM from the internet called evo_x2.1 (evo_x2.1.zip) which contains the following files:
META-INF (folder)
system (folder)
installbusybox (file)
Normaly this file is supposed to be put on /sdcard and update the system partition only from recovery mode.
But I have a question: Can I edit my PDA file mentioned above by inserting this ROM in it? (so that when I flash this firmware with odin into my phone I will no longer have to update it with this ROM separately afterwards, manually)
I tried to create a system.img which contained the files included in the ROM file and replaced the system.img in the PDA file with the system.img I just created from the ROM file.But when I try to flash the PDA with Odin, it crashes while analyzing the file.
NOTE: there is no md5 hashsum at the end of the PDA so there is no problem concerning the integrity of the file.
Thank you, and any observations are welcomed.
ReznicencuBogdan said:
I have a problem. I am new in the domain of android customization and that is why I am testing. I have a PDA file for my old GT-S6102 Galaxy Y,........
Click to expand...
Click to collapse
I don't have this device but, the following area of the forum is also specific to your device as well.
https://forum.xda-developers.com/galaxy-y
With that guidance...
Your best bet is to post this question within the following Q&A thread that's specific to your device and variants.
https://forum.xda-developers.com/showthread.php?t=2063534
Good Luck!
~~~~~~~~~~~~~~~
I DO NOT provide support via PM unless asked/requested by myself. PLEASE keep it in the threads where everyone can share.
ReznicencuBogdan said:
I have a problem. I am new in the domain of android customization and that is why I am testing.
I have a PDA file for my old GT-S6102 Galaxy Y, which contains the following files:
boot.img
param.lfs
Sbl.bin
system.img
userdata.img
I also downloaded a custom ROM from the internet called evo_x2.1 (evo_x2.1.zip) which contains the following files:
META-INF (folder)
system (folder)
installbusybox (file)
Normaly this file is supposed to be put on /sdcard and update the system partition only from recovery mode.
But I have a question: Can I edit my PDA file mentioned above by inserting this ROM in it? (so that when I flash this firmware with odin into my phone I will no longer have to update it with this ROM separately afterwards, manually)
I tried to create a system.img which contained the files included in the ROM file and replaced the system.img in the PDA file with the system.img I just created from the ROM file.But when I try to flash the PDA with Odin, it crashes while analyzing the file.
NOTE: there is no md5 hashsum at the end of the PDA so there is no problem concerning the integrity of the file.
Thank you, and any observations are welcomed.
Click to expand...
Click to collapse
It doesn't quite work like that, you can create your own Odin flashable file(.tar.md5) containing the custom ROM, but it isn't as simple as just pasting the system.img into the .tar.md5.
Here are some threads for extracting Odin files and for creating your own .tar.md5 using the custom ROM file.
This thread is for correctly extracting the existing .tar.md5:
https://www.rwilco12.com/forum/showthread.php?tid=74
This thread is for creating your own Odin flashable .tar or .tar.md5:
https://www.rwilco12.com/forum/showthread.php?tid=92
Sent from my LGL84VL using Tapatalk

Repack AP_---.tar.md5 file with all whatever original signatures

The device is a Sam Gal A11W.
I want to change one text file in the /system partition.
In order to do that, I want to start from the stock firmware I already downloaded, make the change then flash the whole modified firmware.
There are 5 .tar.md5 files (4 if we consider only one of CSC_ and HOME_CSC_) in this firmware, which can be flashed just fine in their original form.
What I want to do is to:
1 - unpack the AP_***.tar file (contains meta-data/fota.zip, boot.img.lz4, carrier.img.lz4, dtbo.img.lz4, metadata.img.lz4, recovery.img.lz4, super.img.lz4, userdata.img.lz4, vbmeta.img.lz4)
2 - unlz4 the super.img.lz4,
3 - unsparse the super.img to super.ext4.img (using simg2img)
4 - lpunpack the super.ext4.img into individual dynamic partitions (there are only 4: odm.img, product.img, system.img, vendor.img - this is NOT an A/B device !!)
5 - modify the text file on system.img
6 - lpmake the super.ext4.img back from odm.img, product.img, system.img, vendor.img
7 - re-sparse the super.ext4.img back into super.img (using img2simg)
8 - lz4 the super.img back into super.img.lz4
9 - Re-TAR the super.img.lz4 file plus all the rest of the original .img.lz4 files back into the AP_***.tar file
10 - Flash the AP_***.tar file to this mother****ing piece of Samsung crap without errors, and that is WITHOUT UNLOCKED BOOTLOADER, because the scumbags eliminated the OEM Unlock option from the Dev Options.
What I already know is:
- How to do the whole process without preserving any signatures.
This is already explained in this thread:
Editing system.img inside super.img and flashing our modifications
I'm trying to modify my system.img (/system/build.prop) to include support for multi users. After struggling a lot, I've succeeded following your guide (that's an awesome work btw) to unpack, mount, modify, umount and repack super.img. Then...
forum.xda-developers.com
but the author assumes the bootloader can be unlocked and therefore doesn't deal with any signatures / security-crypto-baloney checks.
What I (still) need to know is:
1 - How many crypto-security-baloney-whatever-signatures are there on all these files ?
2 - How can I restore them during repackaging so the flashing process does not get screwed up by the locked phone ?
If anyone here knows the answer to these 2 things ... well I guess they must be the Android Godfather Almighty !!
have you figured this out?
FugkGoocle said:
The device is a Sam Gal A11W.
I want to change one text file in the /system partition.
In order to do that, I want to start from the stock firmware I already downloaded, make the change then flash the whole modified firmware.
There are 5 .tar.md5 files (4 if we consider only one of CSC_ and HOME_CSC_) in this firmware, which can be flashed just fine in their original form.
What I want to do is to:
1 - unpack the AP_***.tar file (contains meta-data/fota.zip, boot.img.lz4, carrier.img.lz4, dtbo.img.lz4, metadata.img.lz4, recovery.img.lz4, super.img.lz4, userdata.img.lz4, vbmeta.img.lz4)
2 - unlz4 the super.img.lz4,
3 - unsparse the super.img to super.ext4.img (using simg2img)
4 - lpunpack the super.ext4.img into individual dynamic partitions (there are only 4: odm.img, product.img, system.img, vendor.img - this is NOT an A/B device !!)
5 - modify the text file on system.img
6 - lpmake the super.ext4.img back from odm.img, product.img, system.img, vendor.img
7 - re-sparse the super.ext4.img back into super.img (using img2simg)
8 - lz4 the super.img back into super.img.lz4
9 - Re-TAR the super.img.lz4 file plus all the rest of the original .img.lz4 files back into the AP_***.tar file
10 - Flash the AP_***.tar file to this mother****ing piece of Samsung crap without errors, and that is WITHOUT UNLOCKED BOOTLOADER, because the scumbags eliminated the OEM Unlock option from the Dev Options.
What I already know is:
- How to do the whole process without preserving any signatures.
This is already explained in this thread:
Editing system.img inside super.img and flashing our modifications
I'm trying to modify my system.img (/system/build.prop) to include support for multi users. After struggling a lot, I've succeeded following your guide (that's an awesome work btw) to unpack, mount, modify, umount and repack super.img. Then...
forum.xda-developers.com
but the author assumes the bootloader can be unlocked and therefore doesn't deal with any signatures / security-crypto-baloney checks.
What I (still) need to know is:
1 - How many crypto-security-baloney-whatever-signatures are there on all these files ?
2 - How can I restore them during repackaging so the flashing process does not get screwed up by the locked phone ?
If anyone here knows the answer to these 2 things ... well I guess they must be the Android Godfather Almighty !!
Click to expand...
Click to collapse
Try using modified/patched Odin. As for trying to bypass unlocking the bootloader to flash the modified firmware or trying to "mimic" or "fake" the original signature, that isn't going to work. Samsung's proprietary signature is an enigma that can't be cracked. Though you might be able to match the MD5 by adding a dummy file to the file you are modifying and filing it bit/byte by bit/byte, one step at a time, the goal is to add characters to the file until it is large enough to make your modified file match the original file's MD5. That is if your modified file is smaller than the original file, if your modified file is larger than the original file, you can delete unimportant files from the modified MD5 file until it is smaller than the original MD5 and then create the dummy file filled with dummy characters until it exactly matches the original MD5 bit for bit. Then try flashing your MD5 file once you gets it's MD5 code matching bit for bit. Try the patched version of Odin to flash your modified file. No guarantees that it will work but part of the security checks during flashing checks the MD5 for a match/mismatch.
Rab_DaJew said:
have you figured this out?
Click to expand...
Click to collapse

Categories

Resources