FORUMS
Remove All Ads from XDA

[tool] ANDROID-ROM-REPACK-TOOLS

35 posts
Thanks Meter: 33
 
By rkhat, Member on 16th March 2018, 07:54 AM
Post Reply Email Thread
Note:I am sorry I can't post this in the Android development thread because my number of posts is low. Hopefully some mod can move it there.

Introduction
Since this project (Android_IMG_REPACK_TOOLS) is dead for 2 years now (last supported version is Marshmallow). I decided to do a new rom repacker that supports up to Android Oreo.

Supported OS
Linux

Supported Android Versions
android-6 (Marshmallow)
android-7 (Nougat)
android-8 (Oreo)

Binaries included
append2simg
img2simg
simg2img
simg2simg
make_ext4fs
mkbootfs
mkbootimg
unpackbootimg
sefcontext_compile
sefcontext_decompile

Usage
Check this post out for some use case. You'll need img2simg and make_ext4fs from my post.

sefcontext_compile and sefcontext_decompile:
ROMS since Android 7 (Nougat) come with a binary file_contexts but you need a text based file_contexts when you need to repackage the ROM. You'll need it for make_ext4fs. sefcontext_decompile converts the binary file_contexts into text version.


Code:
# file_contexts (human readable text file) -> file_contexts.bin (PCRE formatted binary file)
sefcontext_compile [-o <output_file>]  <text_file>

# file_contexts.bin (PCRE formatted binary file) -> file_contexts (human readable text file)
sefcontext_decompile [-o <output_file>] <binary_file>


Source code
Repository
android-6
android-7
android-8

Download links for Linux
Download page
android-6
android-7
android-8

Change Log:
v2:
  • Added sefcontext_compile and sefcontext_decompile: converts between file_contexts.bin and file_contexts
  • Static linking to libc++: No need to install 3rd party libraries to use the binaries.
v1:
  • Added append2simg img2simg simg2img simg2simg make_ext4fs mkbootfs mkbootimg unpackbootimg

credits:
@A.S._id
android.googlesource
LineageOS

Created: 2018-03-16
Updated: 2018-03-28
The Following 11 Users Say Thank You to rkhat For This Useful Post: [ View ] Gift rkhat Ad-Free
 
 
16th March 2018, 07:54 AM |#2  
rkhat's Avatar
OP Member
Thanks Meter: 33
 
More
[Placeholder]
The Following 3 Users Say Thank You to rkhat For This Useful Post: [ View ] Gift rkhat Ad-Free
16th March 2018, 07:55 AM |#3  
rkhat's Avatar
OP Member
Thanks Meter: 33
 
More
[Placeholder2]
The Following 2 Users Say Thank You to rkhat For This Useful Post: [ View ] Gift rkhat Ad-Free
16th March 2018, 10:16 AM |#4  
Can i extract a rom if i have only ssyetm. New. Dat??, i have file context. Bin in boot. Img can it be used?
I know usual extraction needs both these+system. Transfer. List but a rom which i m using have just this configuration.
16th March 2018, 10:35 AM |#5  
Junior Member
Thanks Meter: 1
 
More
what is simg2simg?
and how to make system.new.dat.br?
thanks for your work
16th March 2018, 10:51 AM |#6  
Quote:
Originally Posted by zheshifandian

what is simg2simg?
and how to make system.new.dat.br?
thanks for your work

Use brtoli. Exe to make. Br from. Dat format
16th March 2018, 10:25 PM |#7  
rkhat's Avatar
OP Member
Thanks Meter: 33
 
More
Quote:
Originally Posted by narshi shukla

Can i extract a rom if i have only ssyetm. New. Dat??, i have file context. Bin in boot. Img can it be used?
I know usual extraction needs both these+system. Transfer. List but a rom which i m using have just this configuration.

I believe this question is better suited in this thread. You'll need system.transfer.list in sdat2img.py which is provided over there. I haven't worked on a ROM that doesn't have system.transfer.list. Isn't system.transfer.list required for flashing the ROM?

Btw you need to convert file_context.bin to text format. There are a couple of closed source solutions here on xda. I am working on an open source version in my free time.

Quote:
Originally Posted by zheshifandian

what is simg2simg?

You can find answers to a lot of the questions you might have in the old project.

Quote:
Originally Posted by A.S._id

Yes, simg2simg can reduce file size by splitting into several parts, but it is usually not necessary, fastboot can flash and in this state

17th March 2018, 09:14 PM |#8  
svandasek's Avatar
Senior Member
Flag Czech Republic
Thanks Meter: 769
 
Donate to Me
More
Awesomeness, easy and simple
24th March 2018, 07:19 AM |#9  
Senior Member
Thanks Meter: 10
 
More
hi bro i want extract oreo system.new.dat.br and also repack dat to .br in windows
please help me bro
and im unable to convert oreo file_context.bin to readable in windows

please help thanks in advance
28th March 2018, 07:58 AM |#10  
rkhat's Avatar
OP Member
Thanks Meter: 33
 
More
New version available in Original Post.

Change log
v2:
  • Added sefcontext_compile and sefcontext_decompile: converts between file_contexts.bin and file_contexts
  • Static linking to libc++: No need to install 3rd party libraries to use the binaries.
The Following User Says Thank You to rkhat For This Useful Post: [ View ] Gift rkhat Ad-Free
28th March 2018, 08:27 AM |#11  
rkhat's Avatar
OP Member
Thanks Meter: 33
 
More
Quote:
Originally Posted by marshharsha

hi bro i want extract oreo system.new.dat.br and also repack dat to .br in windows
please help me bro
and im unable to convert oreo file_context.bin to readable in windows

please help thanks in advance

Oreo ROMs come compressed by brotili. You can compile from source to get the executable or you can get the binaries directly from the release page (version 1.0). Use it to extract and repack .br.

I added a converter from file_context.bin to a readable format in the new version I just uploaded.

This project only supports Linux as of now. As for using it in Windows, you have 3 options,
  • Use a linux distro in VirtualBox (I currently use this option)
  • Install a linux bash shell in Windows 10
  • Build the project in Cygwin (hopefully someone can make a pull request and share it with the rest)
The Following User Says Thank You to rkhat For This Useful Post: [ View ] Gift rkhat Ad-Free
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes