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


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



First Clone the repo.

Make sure that Android_System_Extractrion_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 repact, which the complete new "system.new.dat", "system.patch.dat" & "system.transfer.list" will be located at "Finish-new.dat" folder
  • Done !


Again , Make sure that Android_System_Extractrion_and_Repack_Tool is located at Desktop

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

cd ~/Desktop/Android_System_Extractrion_and_Repack_Tool/
Double-click the Xtrakt file and choose "Run in Terminal" if your OS supports it.
sudo is requested in the script.

How To Get It {Tool]
Clone from here :
git clone https://github.com/iykequame/Android_System_Extractrion_and_Repack_Tool.git

Sources :

Credit to :
-all xda threads which helped
-Android Matrix Development - here
-Nana Yaa for her time.


Popular posts from this blog

[GUIDE][PORTING][MEDIATEK][mt6580]Android 6.0.x Marshmallow ROM Porting Guide-figured

Lollipop n Marshmallow System Extractor and Repacker Version 1.60

[CM] [ROM] [6.0.1] CyanogenMod 13 Unofficial - TECNO W4