to work with Amlogic Image file you need 2 different toolset. 1) to unpack image 2) to flash image on the device

we have 2 different type of amlogic. the old chipset such as s905x3 uses old protocol to flash image, and in newer version of amlogic such as S905Y4 introduce a new protocol called ADNL so we should use currect protocol to connect to device and flash image.

and in other hands to unpack system.img file we have 2 different aspect, for android 10 and above the super image introduced and the system.img had been deleted, so we should unpack super partition to access system.img and to unpack super parititon we have to use lpunpack program (from google) but in previous version of android (such as android 9 and older) the system.img is ready and we can mount it simply.

to Flash image on newer version of Amlogic such as S905Y4 (with ADNL protocol) and the older version you can use this repo (download the corresponding .zip file)

Amlogic-Flash-Tools-Backup

(note that because S905Y4 is newer so there is 2 script in aml-flash-tool-s905x4.zip adnl_flash_tool.sh and aml_flash_tool.sh so you don't need download S905X3 and you can use  aml_flash_tool.sh for S905X3 and use adnl_flash_tool.sh for S905Y4

after test I found that when we use aml_flash_tool.sh in the aml_flash_tool_s905y4.zip file it can not flash correctly on device and get us this error : Initializing ddr [KO], so you should corresponding file for each chipset) 

 

and for unpack amlogic image use this tools:

linux-amlogic-toolkit