FORUMS

[DEV][TOOL][Linux]Android System Extraction and Repack Tool

366 posts
Thanks Meter: 290
 
Post Reply Email Thread
Introduction
You probably know already that starting from Android 5.x (Lollipop) compiled roms (aosp,cm,stock) are not compressed anymore the way they used to be on previous android versions. On previous versions all content inside /system folder that has to be extracted within our device was either uncompressed (simple /system folder inside our flashable zip) or compressed in a system.img file, which it is a ext4 compressed file; both of these, anyway, were readable and we could see all system files (app,framework, etc).
The problem comes in >=5.0 versions, this method is not used anymore. Why? Because roms started to be always larger, so it is necessary to compress them even more.

Note : Introduction was taken from here : https://forum.xda-developers.com/and...es-to-t2978952 by @xpirt so thanks to him

So in order to save myself and others who most port Custom & Stock Roms, i decided to use some part of my time to write this script for easy work done.


What this script does :
It basically Unpack and Repack system.new.dat alongside with file_context.bin convertion which is seen in android 7.0/7.1

ITS USAGE:

NOTE

First Clone the repo.

Make sure that Android_System_Extraction_and_Repack_Tool is located at Desktop

Run "Xtrakt" from it's location in terminal
Copy "file_contexts.bin" from your Rom to "file_context_zone" folder
Use "f" from menu to convert "file_contexts.bin" to text readable "file_contexts"
Copy : system.new.dat, system.transfer.list & file_contexts to "convert-dat" folder.
Use "i" from menu to unpack, which the output will be name as "rom_system" for modifications of apks & files.
Use "y" from menu to repack, which the complete new "system.new.dat", "system.patch.dat" & "system.transfer.list" will be located at "Finish-new.dat" folder
Done !

EXAMPLE:

Again , Make sure that Android_System_Extraction_and_Repack_Tool is located at Desktop

In your terminal, type the following to start the script:

Code:
git clone https://github.com/iykequame/Android_System_Extraction_and_Repack_Tool.git

mv android_system_extraction_and_repack_tool ~/Desktop/ 

cd ~/Desktop/android_system_extraction_and_repack_tool/

./Xtrakt
OR

Code:
Double-click the Xtrakt file and choose "Run in Terminal" if your OS supports it.
##ALERT!!!##
sudo is requested in the script.

How To Get It {Tool]
Clone from one of the below ;

From GITHUB :
Code:
 
git clone https://github.com/iykequame/Android_System_Extractrion_and_Repack_Tool.git
From BITBUCKET :
Code:
git clone https://[email protected]/zac6ix/android_system_extraction_and_repack_tool.git
Or

Download zip
AFH
GIT-RELEASE

Sources :
Android_System_Extraction_and_Repack_Tool

GITHUB
BITBUCKET

Threads :
sdat2img 1.0 - img2sdat 1.2
For file_context.bin conversion by: Pom Kritsada @ MTK THAI Developers.

Credit to :
@xpirt
@SuperR.
-all xda threads which helped
-Android Matrix Development - here
-Nana Yaa for her time.
The Following User Says Thank You to iykeDROID™ For This Useful Post: [ View ] Gift iykeDROID™ Ad-Free
15th May 2017, 02:27 PM |#2  
Blackball's Avatar
Senior Member
Thanks Meter: 1,682
 
Donate to Me
More
hi, your tool sounds good but it seems it doesnt work.
i press f and nothing happen ..

Use "f" from menu to convert **"file_contexts.bin"** to text readable **"file_contexts"**
4th August 2017, 11:37 AM |#3  
iykeDROID™'s Avatar
OP Senior Member
Flag Accra
Thanks Meter: 290
 
Donate to Me
More
Quote:
Originally Posted by Blackball

hi, your tool sounds good but it seems it doesnt work.
i press f and nothing happen ..

Use "f" from menu to convert **"file_contexts.bin"** to text readable **"file_contexts"**

Sorry for the Late reply !
Directories linking has been fix .
You can go ahead and try again
22nd August 2017, 03:22 PM |#4  
Junior Member
Thanks Meter: 3
 
More
Thanks for sharing!
22nd August 2017, 07:40 PM |#5  
ArEvoun's Avatar
Member
Flag Jessore
Thanks Meter: 6
 
More
Don't work
When i press i ..Don't work.say file missing.but i already put all file..Please help meClick image for larger version

Name:	Screenshot from 2017-08-23 00-37-24.jpg
Views:	508
Size:	162.8 KB
ID:	4249470
26th August 2017, 10:58 PM |#6  
olokos's Avatar
Recognized Developer
Flag Warsaw
Thanks Meter: 2,493
 
Donate to Me
More
Doesn't do anything with file_context.bin, doesn't even check if file is there.
22nd March 2018, 01:09 PM |#7  
Black_J's Avatar
Senior Member
Flag Noida
Thanks Meter: 235
 
More
oreo supported???
23rd March 2018, 02:36 PM |#8  
Black_J's Avatar
Senior Member
Flag Noida
Thanks Meter: 235
 
More
I am getting this error on repacking:-
Code:
WARNING!  WARNING!! WARNING!!!
Please Check & Trace Where Errors.
 There Is NO rom_system found

file_contexts -->> Missing !

Android SDK -->> not detected !
Please help.
7th September 2018, 05:07 PM |#9  
Senior Member
Flag Mumbai
Thanks Meter: 51
 
More
Quote:
Originally Posted by Black_J

I am getting this error on repacking:-

Code:
WARNING!  WARNING!! WARNING!!!
Please Check & Trace Where Errors.
 There Is NO rom_system found

file_contexts -->> Missing !

Android SDK -->> not detected !
Please help.

I see that this thread is not supported.
Anyways, I observed that the tool works for file_contexts.bin but not for other options.
So , I followed the other link in the thread for individual commands and was successful.
The Following User Says Thank You to Yogesh1969 For This Useful Post: [ View ] Gift Yogesh1969 Ad-Free
27th August 2019, 07:03 AM |#10  
Member
Thanks Meter: 53
 
More
Works perfectly on Android Pie! Have to do some tweaks, PM me if anyone wants to make this work for Android Pie.
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