[Android Software Development] A.S._id:
[tool] ANDROID_IMG_REPACK_TOOLS

&

Android_ROM_IMG_Repacker​

​

android_img_repack_tools is a kit utilites for unpack/repack android ext4 and boot images in LINUX & WINDOWS

includes binaries:

mkbootfs

simg2simg

make_ext4fs

make_ext4fs_def

mkbootimg

ext2simg

simg2img

img2simg

sgs4ext4fs - Chainfire's tool

unpackbootimg - CyanogenMod tool

mkbootimg_tools - xiaolu

Android_ROM_IMG_Repacker

sources used:

https://android.googlesource.com

https://github.com/CyanogenMod/android_system_core.git

https://github.com/Chainfire/sgs4ext4fs

how to make:

Preparation OS:

sudo apt-get install git-core gnupg flex bison gperf libsdl-dev libesd0-dev build-essential zip curl libncurses5-dev zlib1g-dev valgrind libreadline6-dev gcc-multilib g++-multilib libc6-dev x11proto-core-dev libx11-dev libz-dev gawk texinfo automake libtool cvs libsdl-dev

Dowload repo:

git clone https://github.com/ASdev/android_img_repack_tools

Choose branch, for example:

cd android_img_repack_tools
git checkout android-4.4.4_r2.0.1

Building tools:

chmod +x configure
./configure

will download source from android git repositories

make

will compille binaries: mkbootfs simg2simg make_ext4fs mkbootimg sgs4ext4fs unpackbootimg ext2simg img2simg simg2img

make clean

will remove binaries

make clear

wiil remove sources

credits:

android.googlesource

Chainfire

CyanogenMod

go to the repository

Already have a branch:

android-2.3.7

android-4.0.4

android-4.1.1

android-4.1.2

android-4.2.2

android-4.3

android-4.4.2

android-4.4.3

android-4.4.4

android-5.0.0

android-5.0.2

android-5.1.0

android-5.1.1

android-6.0.0

android-6.0.1

Usage:

## Converting sparse flashing system.img from flashing android sparse img to ext4 img

$ simg2img system.img system.raw.img
## or all parts of sparse img
$ simg2img system.img* system.raw.img

## Mounting ext4 img for edit

$ mkdir system_mnt
$ mount -t ext4 -o loop system.raw.img system_mnt

## Creating new android sparse img for flashing (android 2.3.6-4.2)

$ mkuserimg.sh -s system_mnt system_new.img ext4 ./system [size partition MB for example 1024M]
## or
$ make_ext4fs -s -l 1024M system_new.img system_mnt

more

$ mkuserimg.sh -s system system.img ext4 /system [size partition MB for example 1024M] file_contexts

## Converting ext4 img to sparse img for flashing (android 4.3-etc)

$ ext2simg -v system.raw.img system_new.img

## Changing sparse img header size from 28bit to 32bit (for Samsung Exynos Octa)

$ sgs4ext4fs --bloat system_new.img system_32bit.img

## Remove Moto extra header... (for Motorola G-series, making after unsparse img)

$ mv system.raw.img system.moto.img
$ dd if=system.moto.img of=system.raw.img ibs=131072 skip=1

ANDROID_IMG_REPACK_TOOLS_CYGWIN WINDOWS​

ANDROID_IMG_REPACK_TOOLS_CYGWIN is a kit utilites for unpack/repack android ext4 and boot images in WINDOWS

mkbootfs.exe

simg2simg.exe

make_ext4fs.exe

mkbootimg.exe

ext2simg.exe

img2simg.exe

simg2img.exe

sgs4ext4fs.exe - Chainfire's tool

unpackbootimg.exe - CyanogenMod tool

Already have a branch:

android-4.1.2

android-5.1.0

android-5.1.1

android-6.0.0

android-6.0.1

Already have a .exe:

WINDOWS REPO

XDA:DevDB Information

android_img_repack_tools, Tool/Utility for the Android General

Contributors

A.S._id

Version Information

Status: Testing

Created 2014-01-06

Last Updated 2016-04-17