[DEV][WIN/LINUX] Amlogic Kitchen

Search This thread

althafvly

Recognized Developer / Recognized Contributor
May 28, 2014
1,671
3,426
Malappuram
Moto G 2015
Google Pixel XL

logo.png

Disclaimer:​

  • The user takes sole responsibility for any damage that might arise due to use of this tool.
  • This includes physical damage (to device), injury, data loss, and also legal matters.
  • This project was made as a learning initiative and the developer or organization cannot be held liable in any way for the use of it.

Kitchen for working with Amlogic firmware​

Used for unpacking/packing amlogic images

Supported features
  • Unpack/repack Amlogic images
  • Unpack/repack partitions (system,product,system_ext,oem and odm)
  • Create flashable zip from amlogic image
  • Unpack/repack recovery,boot,logo and dtb
  • Create aml image from supported flashable zips
  • Support for super image unpack/repack
  • Dump os from device through /mask mode

Note:
  • Ignore some errors with dtb (some conditions are missing), decompiling/compiling dtb should work fine.
  • This tool is tested only in some firmwares and devices.
  • Theres no guarantee that packed flashable zips or amlogic images will flash successfully.
TODO:
  • ....
Download : https://github.com/althafvly/AmlogicKitchen

Report issues: https://github.com/althafvly/AmlogicKitchen/issues

Flash-tool : https://github.com/althafvly/aml-flash-tool (Use Amlogic USB Burning Tool on windows)

Credits:​

  • Base kitchen (vtx_kitchen) - Vortex
  • gnuwin32 and cygwin for linux binary ports
  • aml update tool - osmc
  • 7-Zip - Igor Pavlov
  • ImgExtractor - unix3dgforce, blackeange and xiaoxindada
  • AIK - osm0sis
  • SuperImage tools - LonelyFool
  • Aml dtb, unpack tools - LineageOS
  • simg2img - anestisb
  • img2sdat, sdat2img - xpirt
  • simg2img - A.S._id
let me know if i missed anyone 😉

Contribution:
If you want to contribute or fix something i broke, just fork and give a pull request with your changes

Support:
XDA is preferred for main discussion. But if you need any other support, check support group.
 
Last edited:

kalehrl

Senior Member
Nov 22, 2017
779
330
I just tried it. I unpacked level1 fine. When I tried level2, the terminal window didn't open. I realised I needed python for Windows so I installed it and level2 unpacked fine. Maybe add a notification to install Python. Level3 unpacked boot, logo and recovery but no dtb:
1 file(s) copied.
Android Image Kitchen - UnpackImg Script
by osm0sis @ xda-developers

Supplied image: recovery.img

Setting up work folders . . .

Image type: AOSP

Splitting image to "split_img/" . . .

ANDROID! magic found at: 0
BOARD_KERNEL_CMDLINE androidboot.dtbo_idx=0 --cmdline root=/dev/mmcblk0p18 buildvariant=userdebug
BOARD_KERNEL_BASE 0x01078000
BOARD_NAME
BOARD_PAGE_SIZE 2048
BOARD_HASH_TYPE sha1
BOARD_KERNEL_OFFSET 0x00008000
BOARD_RAMDISK_OFFSET 0xfff88000
BOARD_SECOND_OFFSET 0xffe88000
BOARD_TAGS_OFFSET 0xfef88100
BOARD_OS_VERSION 9.0.0
BOARD_OS_PATCH_LEVEL 2018-08
BOARD_HEADER_VERSION 1
BOARD_RECOVERY_DTBO_SIZE 438
BOARD_RECOVERY_DTBO_OFFSET 15835136
BOARD_HEADER_SIZE 1648

Unpacking ramdisk to "ramdisk/" . . .

Compression used: gzip
20266 blocks

Done!

Failed
1 dir(s) moved.
1 dir(s) moved.
1 file(s) copied.
Android Image Kitchen - UnpackImg Script
by osm0sis @ xda-developers

Supplied image: boot.img

Setting up work folders . . .

Image type: AOSP

Splitting image to "split_img/" . . .

ANDROID! magic found at: 0
BOARD_KERNEL_CMDLINE androidboot.dtbo_idx=0 --cmdline root=/dev/mmcblk0p18 buildvariant=userdebug
BOARD_KERNEL_BASE 0x01078000
BOARD_NAME
BOARD_PAGE_SIZE 2048
BOARD_HASH_TYPE sha1
BOARD_KERNEL_OFFSET 0x00008000
BOARD_RAMDISK_OFFSET 0xfff88000
BOARD_SECOND_OFFSET 0xffe88000
BOARD_TAGS_OFFSET 0xfef88100
BOARD_OS_VERSION 9.0.0
BOARD_OS_PATCH_LEVEL 2018-08
BOARD_HEADER_VERSION 1
BOARD_HEADER_SIZE 1648

Warning: No ramdisk found to be unpacked!

Done!

Failed
1 dir(s) moved.
1 dir(s) moved.
dbg:res-img ver is 0x2
dbg:item level3\logo/bootup
dbg:item level3\logo/bootup_X3
dbg:item level3\logo/upgrade_bar
dbg:item level3\logo/upgrade_error
dbg:item level3\logo/upgrade_fail
dbg:item level3\logo/upgrade_logo
dbg:item level3\logo/upgrade_success
dbg:item level3\logo/upgrade_unfocus
dbg:item level3\logo/upgrade_upgrading
FATAL ERROR: Blob has incorrect magic number

Done.
Press any key to continue . . .
I tried _pack_zip_to_aml.bat but it says to install python from Microsoft store. I uninstalled the existing python, installed python 3.10 from MS store but it still doesn't work.
 
Last edited:

althafvly

Recognized Developer / Recognized Contributor
May 28, 2014
1,671
3,426
Malappuram
Moto G 2015
Google Pixel XL
I just tried it. I unpacked level1 fine. When I tried level2, the terminal window didn't open. I realised I needed python for Windows so I installed it and level2 unpacked fine. Maybe add a notification to install Python. Level3 unpacked boot, logo and recovery but no dtb:
1 file(s) copied.
Android Image Kitchen - UnpackImg Script
by osm0sis @ xda-developers

Supplied image: recovery.img

Setting up work folders . . .

Image type: AOSP

Splitting image to "split_img/" . . .

ANDROID! magic found at: 0
BOARD_KERNEL_CMDLINE androidboot.dtbo_idx=0 --cmdline root=/dev/mmcblk0p18 buildvariant=userdebug
BOARD_KERNEL_BASE 0x01078000
BOARD_NAME
BOARD_PAGE_SIZE 2048
BOARD_HASH_TYPE sha1
BOARD_KERNEL_OFFSET 0x00008000
BOARD_RAMDISK_OFFSET 0xfff88000
BOARD_SECOND_OFFSET 0xffe88000
BOARD_TAGS_OFFSET 0xfef88100
BOARD_OS_VERSION 9.0.0
BOARD_OS_PATCH_LEVEL 2018-08
BOARD_HEADER_VERSION 1
BOARD_RECOVERY_DTBO_SIZE 438
BOARD_RECOVERY_DTBO_OFFSET 15835136
BOARD_HEADER_SIZE 1648

Unpacking ramdisk to "ramdisk/" . . .

Compression used: gzip
20266 blocks

Done!

Failed
1 dir(s) moved.
1 dir(s) moved.
1 file(s) copied.
Android Image Kitchen - UnpackImg Script
by osm0sis @ xda-developers

Supplied image: boot.img

Setting up work folders . . .

Image type: AOSP

Splitting image to "split_img/" . . .

ANDROID! magic found at: 0
BOARD_KERNEL_CMDLINE androidboot.dtbo_idx=0 --cmdline root=/dev/mmcblk0p18 buildvariant=userdebug
BOARD_KERNEL_BASE 0x01078000
BOARD_NAME
BOARD_PAGE_SIZE 2048
BOARD_HASH_TYPE sha1
BOARD_KERNEL_OFFSET 0x00008000
BOARD_RAMDISK_OFFSET 0xfff88000
BOARD_SECOND_OFFSET 0xffe88000
BOARD_TAGS_OFFSET 0xfef88100
BOARD_OS_VERSION 9.0.0
BOARD_OS_PATCH_LEVEL 2018-08
BOARD_HEADER_VERSION 1
BOARD_HEADER_SIZE 1648

Warning: No ramdisk found to be unpacked!

Done!

Failed
1 dir(s) moved.
1 dir(s) moved.
dbg:res-img ver is 0x2
dbg:item level3\logo/bootup
dbg:item level3\logo/bootup_X3
dbg:item level3\logo/upgrade_bar
dbg:item level3\logo/upgrade_error
dbg:item level3\logo/upgrade_fail
dbg:item level3\logo/upgrade_logo
dbg:item level3\logo/upgrade_success
dbg:item level3\logo/upgrade_unfocus
dbg:item level3\logo/upgrade_upgrading
FATAL ERROR: Blob has incorrect magic number

Done.
Press any key to continue . . .
I tried _pack_zip_to_aml.bat but it says to install python from Microsoft store. I uninstalled the existing python, installed python 3.10 from MS store but it still doesn't work.
i have made some changes now. download or pull from git and check. fixed python missing error not showing in windows. if its still not extracting your dtb then, link me you firmware or _aml_dtb.PARTITION
 
  • Like
Reactions: kalehrl

kalehrl

Senior Member
Nov 22, 2017
779
330
I reinstalled Python but this time I selected 'add to path' option which is not selected by default. _pack_zip_to_aml.bat now works but I didn't try the resulting image. DTB still isn't extracted with the updated version of the tool. Vortex's kitchen extracts it fine.
I tried to test the image I made from ota.zip and when I try to unpack level2, I get this error while extracting odm partition while other partitions extract fine. Maybe because my ota.zip is encrypted so maybe you can add some type of detection.Vortex''s edition also errors out when unpacking odm with the same error.
.....................
Amlogic Kitchen
.....................
Select level 1,2 or 3: 2
Python 3.10.2
imgextractor: Vortex Edition
Traceback (most recent call last):
File "imgextractor.py", line 374, in <module>
File "imgextractor.py", line 360, in main
File "imgextractor.py", line 346, in __getTypeTarget
File "imgextractor.py", line 338, in checkSignOffset
OSError: [WinError 8] Not enough memory resources are available to process this command
[2700] Failed to execute script imgextractor
imgextractor: Vortex Edition
Convert product.PARTITION to product.raw.img
Extraction from product.PARTITION to product
imgextractor: Vortex Edition
Convert vendor.PARTITION to vendor.raw.img
Extraction from vendor.PARTITION to vendor
 

Attachments

  • _aml_dtb.zip
    55.3 KB · Views: 74
Last edited:

althafvly

Recognized Developer / Recognized Contributor
May 28, 2014
1,671
3,426
Malappuram
Moto G 2015
Google Pixel XL
I reinstalled Python but this time I selected 'add to path' option which is not selected by default. _pack_zip_to_aml.bat now works but I didn't try the resulting image. DTB still isn't extracted with the updated version of the tool. Vortex's kitchen extracts it fine.
I tried to test the image I made from ota.zip and when I try to unpack level2, I get this error while extracting odm partition while other partitions extract fine. Maybe because my ota.zip is encrypted so maybe you can add some type of detection.Vortex''s edition also errors out when unpacking odm with the same error.
.....................
Amlogic Kitchen
.....................
Select level 1,2 or 3: 2
Python 3.10.2
imgextractor: Vortex Edition
Traceback (most recent call last):
File "imgextractor.py", line 374, in <module>
File "imgextractor.py", line 360, in main
File "imgextractor.py", line 346, in __getTypeTarget
File "imgextractor.py", line 338, in checkSignOffset
OSError: [WinError 8] Not enough memory resources are available to process this command
[2700] Failed to execute script imgextractor
imgextractor: Vortex Edition
Convert product.PARTITION to product.raw.img
Extraction from product.PARTITION to product
imgextractor: Vortex Edition
Convert vendor.PARTITION to vendor.raw.img
Extraction from vendor.PARTITION to vendor
i have pushed a fix for dtb now. odm error is mostly because its an empty partition
 
  • Like
Reactions: kalehrl

kalehrl

Senior Member
Nov 22, 2017
779
330
2 other kitchens extract the odm partition just fine. The one from CRB: https://forum.xda-developers.com/t/tool-windows-kitchen-crb-v3-0-0-beta14.3947779/ and another one from a Russian developer from 4pda. The partition isn't empty. How does this kitchen handle encrypted partitions? I think in the ota.zip I mentioned, boot and dt.img are encrypted. Vortex's kitchen recognises encrypted partitions and they have .enc suffix at the end. I tested with encrypted factory img for X99 Max + box.
 

althafvly

Recognized Developer / Recognized Contributor
May 28, 2014
1,671
3,426
Malappuram
Moto G 2015
Google Pixel XL
2 other kitchens extract the odm partition just fine. The one from CRB: https://forum.xda-developers.com/t/tool-windows-kitchen-crb-v3-0-0-beta14.3947779/ and another one from a Russian developer from 4pda. The partition isn't empty. How does this kitchen handle encrypted partitions? I think in the ota.zip I mentioned, boot and dt.img are encrypted. Vortex's kitchen recognises encrypted partitions and they have .enc suffix at the end. I tested with encrypted factory img for X99 Max + box.
i havent tried any firmware with encrypted partitions yet. i will check soon
 
  • Like
Reactions: kalehrl

althafvly

Recognized Developer / Recognized Contributor
May 28, 2014
1,671
3,426
Malappuram
Moto G 2015
Google Pixel XL
  • Like
Reactions: kalehrl

kalehrl

Senior Member
Nov 22, 2017
779
330
The dtb I attached is not encrypted. It is from a SlimBox custom rom. I will send you the link to my ota.zip in which some files are encrypted, probably boot.img and dt.img. Other files should be fine.
EDIT: With the new version, dtb is decompiled successfully :D
 
Last edited:
  • Like
Reactions: althafvly

kalehrl

Senior Member
Nov 22, 2017
779
330
It seems that it doesn't extract Android 7.1 images correctly.
system/usr folder isn't extracted and the terminal window closes prematurely.
I tried this image which extracts fine with another tool:
 

althafvly

Recognized Developer / Recognized Contributor
May 28, 2014
1,671
3,426
Malappuram
Moto G 2015
Google Pixel XL
New changes

- Allow user to select vortex/python for extracing firmware in windows
- Added support to dump firmware from mask mode
- Added support for firmwares with super.img

Note: i have only test this in some firmware/device. report if theres any issues.
 

cali.s

Senior Member
Nov 3, 2009
150
29
Create flashable zip from amlogic image
i created a zip can I flash this with or without wiping anything in twrp ?
failed with error 6
 
Last edited:

kalehrl

Senior Member
Nov 22, 2017
779
330
I tried to dump_to_aml.sh Android 6 image but it failed:
[email protected]:/home/kalehrl/Templates/android/AmlogicKitchen# ./dump_to_aml.sh
Code:
.....................
Amlogic Dumper
.....................
Unpacking system
Repacking system
Repacking boot
Repacking recovery
Repacking logo
Enter a name for aml package:
ott
[ERR]f(AmlImagePack.cpp)L1312:Open pack image out/ott.img failed
Image pack FAILED
.....................
Done.
I can send you my TWRP backup of the original iamge to try if you have time.
 

althafvly

Recognized Developer / Recognized Contributor
May 28, 2014
1,671
3,426
Malappuram
Moto G 2015
Google Pixel XL
I tried to dump_to_aml.sh Android 6 image but it failed:
[email protected]:/home/kalehrl/Templates/android/AmlogicKitchen# ./dump_to_aml.sh
Code:
.....................
Amlogic Dumper
.....................
Unpacking system
Repacking system
Repacking boot
Repacking recovery
Repacking logo
Enter a name for aml package:
ott
[ERR]f(AmlImagePack.cpp)L1312:Open pack image out/ott.img failed
Image pack FAILED
.....................
Done.
I can send you my TWRP backup of the original iamge to try if you have time.
dump to aml script isn't ready yet. Im still testing it. I will check on free time. This error is because script isn't able to create ott.img. Try different name or close any apps which using that ott.img file.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 3

    logo.png

    Disclaimer:​

    • The user takes sole responsibility for any damage that might arise due to use of this tool.
    • This includes physical damage (to device), injury, data loss, and also legal matters.
    • This project was made as a learning initiative and the developer or organization cannot be held liable in any way for the use of it.

    Kitchen for working with Amlogic firmware​

    Used for unpacking/packing amlogic images

    Supported features
    • Unpack/repack Amlogic images
    • Unpack/repack partitions (system,product,system_ext,oem and odm)
    • Create flashable zip from amlogic image
    • Unpack/repack recovery,boot,logo and dtb
    • Create aml image from supported flashable zips
    • Support for super image unpack/repack
    • Dump os from device through /mask mode

    Note:
    • Ignore some errors with dtb (some conditions are missing), decompiling/compiling dtb should work fine.
    • This tool is tested only in some firmwares and devices.
    • Theres no guarantee that packed flashable zips or amlogic images will flash successfully.
    TODO:
    • ....
    Download : https://github.com/althafvly/AmlogicKitchen

    Report issues: https://github.com/althafvly/AmlogicKitchen/issues

    Flash-tool : https://github.com/althafvly/aml-flash-tool (Use Amlogic USB Burning Tool on windows)

    Credits:​

    • Base kitchen (vtx_kitchen) - Vortex
    • gnuwin32 and cygwin for linux binary ports
    • aml update tool - osmc
    • 7-Zip - Igor Pavlov
    • ImgExtractor - unix3dgforce, blackeange and xiaoxindada
    • AIK - osm0sis
    • SuperImage tools - LonelyFool
    • Aml dtb, unpack tools - LineageOS
    • simg2img - anestisb
    • img2sdat, sdat2img - xpirt
    • simg2img - A.S._id
    let me know if i missed anyone 😉

    Contribution:
    If you want to contribute or fix something i broke, just fork and give a pull request with your changes

    Support:
    XDA is preferred for main discussion. But if you need any other support, check support group.
    1
    How can I download it? It seems very similar to Vortex's kitchen.
    You can clone the repo or download as zip from github. Yes this was done on top of vtx_kitchen
    1
    I just tried it. I unpacked level1 fine. When I tried level2, the terminal window didn't open. I realised I needed python for Windows so I installed it and level2 unpacked fine. Maybe add a notification to install Python. Level3 unpacked boot, logo and recovery but no dtb:
    1 file(s) copied.
    Android Image Kitchen - UnpackImg Script
    by osm0sis @ xda-developers

    Supplied image: recovery.img

    Setting up work folders . . .

    Image type: AOSP

    Splitting image to "split_img/" . . .

    ANDROID! magic found at: 0
    BOARD_KERNEL_CMDLINE androidboot.dtbo_idx=0 --cmdline root=/dev/mmcblk0p18 buildvariant=userdebug
    BOARD_KERNEL_BASE 0x01078000
    BOARD_NAME
    BOARD_PAGE_SIZE 2048
    BOARD_HASH_TYPE sha1
    BOARD_KERNEL_OFFSET 0x00008000
    BOARD_RAMDISK_OFFSET 0xfff88000
    BOARD_SECOND_OFFSET 0xffe88000
    BOARD_TAGS_OFFSET 0xfef88100
    BOARD_OS_VERSION 9.0.0
    BOARD_OS_PATCH_LEVEL 2018-08
    BOARD_HEADER_VERSION 1
    BOARD_RECOVERY_DTBO_SIZE 438
    BOARD_RECOVERY_DTBO_OFFSET 15835136
    BOARD_HEADER_SIZE 1648

    Unpacking ramdisk to "ramdisk/" . . .

    Compression used: gzip
    20266 blocks

    Done!

    Failed
    1 dir(s) moved.
    1 dir(s) moved.
    1 file(s) copied.
    Android Image Kitchen - UnpackImg Script
    by osm0sis @ xda-developers

    Supplied image: boot.img

    Setting up work folders . . .

    Image type: AOSP

    Splitting image to "split_img/" . . .

    ANDROID! magic found at: 0
    BOARD_KERNEL_CMDLINE androidboot.dtbo_idx=0 --cmdline root=/dev/mmcblk0p18 buildvariant=userdebug
    BOARD_KERNEL_BASE 0x01078000
    BOARD_NAME
    BOARD_PAGE_SIZE 2048
    BOARD_HASH_TYPE sha1
    BOARD_KERNEL_OFFSET 0x00008000
    BOARD_RAMDISK_OFFSET 0xfff88000
    BOARD_SECOND_OFFSET 0xffe88000
    BOARD_TAGS_OFFSET 0xfef88100
    BOARD_OS_VERSION 9.0.0
    BOARD_OS_PATCH_LEVEL 2018-08
    BOARD_HEADER_VERSION 1
    BOARD_HEADER_SIZE 1648

    Warning: No ramdisk found to be unpacked!

    Done!

    Failed
    1 dir(s) moved.
    1 dir(s) moved.
    dbg:res-img ver is 0x2
    dbg:item level3\logo/bootup
    dbg:item level3\logo/bootup_X3
    dbg:item level3\logo/upgrade_bar
    dbg:item level3\logo/upgrade_error
    dbg:item level3\logo/upgrade_fail
    dbg:item level3\logo/upgrade_logo
    dbg:item level3\logo/upgrade_success
    dbg:item level3\logo/upgrade_unfocus
    dbg:item level3\logo/upgrade_upgrading
    FATAL ERROR: Blob has incorrect magic number

    Done.
    Press any key to continue . . .
    I tried _pack_zip_to_aml.bat but it says to install python from Microsoft store. I uninstalled the existing python, installed python 3.10 from MS store but it still doesn't work.
    i have made some changes now. download or pull from git and check. fixed python missing error not showing in windows. if its still not extracting your dtb then, link me you firmware or _aml_dtb.PARTITION
    1
    I reinstalled Python but this time I selected 'add to path' option which is not selected by default. _pack_zip_to_aml.bat now works but I didn't try the resulting image. DTB still isn't extracted with the updated version of the tool. Vortex's kitchen extracts it fine.
    I tried to test the image I made from ota.zip and when I try to unpack level2, I get this error while extracting odm partition while other partitions extract fine. Maybe because my ota.zip is encrypted so maybe you can add some type of detection.Vortex''s edition also errors out when unpacking odm with the same error.
    .....................
    Amlogic Kitchen
    .....................
    Select level 1,2 or 3: 2
    Python 3.10.2
    imgextractor: Vortex Edition
    Traceback (most recent call last):
    File "imgextractor.py", line 374, in <module>
    File "imgextractor.py", line 360, in main
    File "imgextractor.py", line 346, in __getTypeTarget
    File "imgextractor.py", line 338, in checkSignOffset
    OSError: [WinError 8] Not enough memory resources are available to process this command
    [2700] Failed to execute script imgextractor
    imgextractor: Vortex Edition
    Convert product.PARTITION to product.raw.img
    Extraction from product.PARTITION to product
    imgextractor: Vortex Edition
    Convert vendor.PARTITION to vendor.raw.img
    Extraction from vendor.PARTITION to vendor
    i have pushed a fix for dtb now. odm error is mostly because its an empty partition
    1
    2 other kitchens extract the odm partition just fine. The one from CRB: https://forum.xda-developers.com/t/tool-windows-kitchen-crb-v3-0-0-beta14.3947779/ and another one from a Russian developer from 4pda. The partition isn't empty. How does this kitchen handle encrypted partitions? I think in the ota.zip I mentioned, boot and dt.img are encrypted. Vortex's kitchen recognises encrypted partitions and they have .enc suffix at the end. I tested with encrypted factory img for X99 Max + box.
    i havent tried any firmware with encrypted partitions yet. i will check soon