[Android General] Ziona:
Android system, vendor image converter tool

############## IMAGE 2 IMAGE ##############

Module Image Converter tools & setup v1.1

##

MMT-EX

.v 20.4 -Zackptg5

##

Python

.v 2.7.9 -Python.org

##

Python

.v 3.4.2 -Python.org

##

Bash

.v 4.3.4.2 -Bash GNU

##

BusyBox

.v 1.31.1 -topjohnwu

##

Brotli

.v 1.0.7-2 -brotli.org

Info:

For unpacking, repacking an creating system.new.dat.br, system.new.dat, system.img an vendor.new.dat.br vendor.new.dat vendor.img on android devices.

# STEPS:

Use a good android terminal emulator app , like Nethunter terminal app. (highly Recommended)

Download :

https://store.nethunter.com/repo/com.offsec.nhterm_2020030100.apk

-Grant your terminal app root: in Nethunter you would choose, android su

** You can also type " sudo " then press enter for root access **

Type without quotes " bash " then press enter

Type without quotes " ziona " then press enter

First time setup !

# INTERNAL STORAGE USAGE:

.You will be asked about which storage your using were the files to convert are located

if using internal storage then leave terminal an locate the folder named internal in that storage

place system.new.dat or dat.br an system.transfer.list here !!

use this location for your dat, dat.br an system|vendor image files

# EXTERNAL STORAGE USAGE:

.You will be asked about which storage your using were the files to convert are located

if using external storage then leave terminal an locate the folder named external in that storage

place system.new.dat or dat.br an system.transfer.list here !!

use this location for your dat, dat.br an system|vendor image files

Once your files are in one of the storage locations ,

Now go back to terminal app menu an press Enter .

# FIRST MENU:

Choose which storage you placed the files to convert

# SECOND MENU AND THIRD MENU:

Choose which convert action to do unpacking or repacking of the image file

Options:

1. unpack system.new.dat.br -------(to) system.new.dat

2. repack system.new.dat.br ------ (from) system.new.dat

3. unpack vendor.new.dat.br -------(to) vendor.new.dat

4. repack vendor.new.dat.br -------(from) vendor.new.dat

5. unpack system.new.dat ----------(to) {raw} system.img

6. repack system.new.dat ----------(from) {sparse} system.img

7. unpack vendor.new.dat ---------(to) {raw} vendor.img

8. repack vendor.new.dat ---------(from) {sparse} vendor.img

9. unpack sparse system.img -----(to) {raw} system.img

10. repack sparse system.img -----(from) {raw} system.img

11. unpack sparse vendor.img -----(to) {raw} system.img

12. repack sparse vendor.img -----(from) {raw} vendor.img

13. mount system.img

14. mount vendor.img

15. umount system.img

16. umount vendor.img

17. makefs raw system.img --------(from) {raw} system.img mounted

18. makefs raw vendor.img --------(from) {raw} vendor.img mounted

Mounting of raw system.img images made after unpacking are done automatically

Mounting of raw vendor.img images made after unpacking are done automatically

.You can also Manually mount system.img an umount system.img in internal|external

.You can also Manually mount vendor.img an umount vendor.img in internal|external

.You can type in terminal m1 to mount a system|vendor image in internal|external

.You can type in terminal u1 to unmount a system|vendor image in internal|external

Usage for storage internal|external folder convertions:

-Copy an Place your images files here for everything -- Unpacking & Repacking Also Mounting Images

system.transfer.list & system.new.dat -- needed for converting

system.transfer.list & system.new.dat.br -- needed for converting

vendor.transfer.list & vendor.new.dat -- optional for converting

file_contexts.bin & system.img -- optional to create a modified new image

.When image is converted from .dat to system.img (raw) it will be mounted

within the same external/internal storage folder look inside /system1 or 2 & /vendor1 or 2

.You can do whatever modifications there before making new image or just repacking after umount.

# NOTE CONVERTIONS:

Examples for image processing:

From; {raw} system.img > {sparse} system.img > system.new.dat & optional finally > system.new.dat.br

From; system.new.dat.br > system.new.dat > {raw} system.img

From; {sparse} system.img > {raw} system.img

~ You can repack raw system.img to sparse system.img

used this to flash images in twrp recovery to system or vendor partitions.

Remember on sparse images:

~ To unpack a sparse image to raw system.img or vendor.img you can sparse unpack,

you can also covert it to system|vendor.new.dat then to raw system|vendor.img.

(You can call help in menu by typing 4 an then enter . At main screen first menu only)

All info will display if successful or errors occur .

General logs are found in folders internal|external/logs .

Android 6 to 11 images:

.Both system an vendor images tested. Works on custom roms Lineage, CM, RR, Mokee rom images an more .

Terminal support for:

busybox, dash, bash, python2 & python3 - Shell Commands that are standalone in terminal.

For best results:

•Have 4GB or more of free internal or external storage available on device

•Operating convertions in internal storage is 3xxx faster than using external storage (sdcards)

•ALWAYS have a backup of your original images before converting an using delete old image option when preserving device storage space.

•Remember normally yellow text in the terminal when converting anything is successful and red is a error happened.

•If a image won't automatically or manually mount its more than likely because it's a bad system|vendor image.

TroubleShooting:

--Error logs are made within system*.logs in external or internal logs folder to report.

--Scroll up to view full menu options they are over 18 to choose from in terminal menu1-2 options, internal|external storage.

--If using Nethunter Terminal app if display freezes or weird behavior occurs restart app or start a new window.

--Always have just system.transfer.list with system image files in folder for convertions.

--Always have just vendor.transfer.list with vendor image files in folder for convertions.

--Always remove system.transfer.list an system image files from folder before convertions if using vendor files.

--Always have file_context.bin when creating new images from a mounted system|vendor image

--Have a image that wont convert even with the necessary files present it can mean a bad image or just incompatible with this module.

--If Nethunter Terminal app enter key stops working press the three dots in upper right corner,

and tap Preferences, now tap Function keys, then untick the (tab) option and go back to first terminal window,

now on top of keyboard theirs special functions a new (enter) tab should be on the end right corner.

--Full support for use on arm devices only

# Credits: For Tools & ideas

Kali NetHunter

[MENTION=6532371]andii_nr[/MENTION]

[MENTION=6037748]Zackptg5[/MENTION]

[MENTION=4470081]topjohnwu[/MENTION]

Python.org

Brotli.org

Bash GNU

Creator:

[MENTION=9906981]Ziona[/MENTION]

Created:

13/10/2020

For arm devices only !

Download backup link:

image2image_v1.1 -

https://www.androidfilehost.com/?fid=10763459528675564171

.