Made an archive, can someone come in handy:
Unpacking, converting, assembling system (vendor) .new.dat.br, system (vendor) .new.dat and system (vendor) .img, and also extracting file_contexts.bin and converting it on your phone
The system make_ext4fs is used, so on the phone with android 6+ (or better 7), you can collect system.img images from android 5+.
Version 4.0:
----------------------------------------unpack-android_4.0.zip(15.35 MB)
Added menu.
You need root, busybox and enough space for the images themselves and their unpacking in ./data.
Extract the file "sdat2img-android_4.0.zip" from the archive and flash it via TV.
After the archive is flashed and loaded into the system, install a terminal emulator and run the install_sef.sh file in it:
if, for example, we put it on / sdcard, then enter:
su
sh /sdcard/install_sef.sh
In the terminal settings, tick the UTF-8.
To start, in the terminal enter:
And then enter the numbers corresponding to the desired action.
To extract the file_contexts, put boot.img in the folder: / data / local / UnpackerContexts.
To unpack .img images, you need to put system.img or vendor.img in the folder: / data / local / UnpackerSystem.
If files or folders were added to the disassembled image, then before assembling it is necessary, all added should be entered in fs_config, and only then be collected.
If something is simply deleted or replaced with the same name, then fs_config does not need to be edited.
Also in the folder must be present symlinks.
Well, in contexts, selinux will also need to be watched, depending on what was added.
To unpack or convert .dat, .br and in other cases, you will be prompted to enter the path to the folder where the image is located.
When converting and building in .dat, look behind the phone screen, because in some cases you need to enter a number corresponding to the version of the android of the image being assembled.
Version 4.1:
---------------------------------------unpack-android_4.1.zip(42.35 MB)
Flash unpack-android_4.1.zip archive via twrp.
Running the install_sef.sh file is listed in the menu, under the item: Extract file_contexts; subparagraph: Configuration setting.
You need to run only once.
Added selection of .img files (no more than 5) for unpacking in the / data / local / UnpackerSystem folder
When unpacking, the folders will be deleted: "system", or "vendor"; Files: * _fs_config and * _pack.sh from the previous decompression.
Added selection of compression level for converting * .new.dat to br.
To reduce the conversion time, compression can be chosen 3-5 (maximum 7).
Added AIK-mobile.
To unpack, put the file in the folder: / data / local / AIK-mobile, in the menu: "unpack boot" select the file.
For packaging, use the item: "pack boot".
The collected file will be located in the folder: / data / local / AIK-mobile named boot-output.img.
To clear the working folder, also use the corresponding item. Source and output files will not be deleted.
AIK-mobile can be completely removed from the phone directly from the menu.
If, for some reason, you do not want to flash AIK-mobile, then delete the file "AIK.Mobile.Installer.v3.2.zip" from the archive, and flash "unpack-android_4.1.zip" without this file.
Version 4.2:
---------------------------------------unpack-android_4.2.zip(42.35 MB)
Added mounting of raw images * .img in folder: / data / local / name of raw image without extension .img.
To mount, use the corresponding menu item, and the raw image must be located in the folder: / data / local / UnpackerSystem.
Do not forget to unmount the image.
Added complete removal of unpack-android from the menu.
After confirming the deletion, the phone will be overloaded in twrp, and deletion will take place.
Post has been editedkory-vadim - 02.05.18, 13:01Reason for editing: New version 4.2