neo-technologies / rockchip-mkbootimg

Tools to create firmware / boot images for Rockchip devices
72 stars 64 forks source link

afptool: can't unpack RK3188 update.img #10

Open sphakka opened 6 years ago

sphakka commented 6 years ago

I don't know if this is expected with this kind of quite old RK3188 images, but I get:

$ afptool -unpack update.img tmp/
Invalid header magic
UnPack failed 

The same img is correctly unpacked by @naobsd's rkunpack (https://github.com/naobsd/rkutils), which gives:

$ rkunpack input-update.img
VERSION:4.0.2

unpacking
0x00000000 input-update.img-HEAD 102 bytes
0x00000066 input-update.img-BOOT 201038 bytes
0x000311b4 input-update.img-update.img 719009796 bytes

unpacking input-update.img-update.img
================================================================================
FIRMWARE_VER:4.4.2
MACHINE_MODEL:rk3188
MACHINE_ID:007
MANUFACTURER:RK30SDK

unpacking 12 files
-------------------------------------------------------------------------------
0x00000800 package-file:package-file 600 bytes
0x00001000 bootloader:RK3188Loader(L)_V2.19.bin 201038 bytes
0x00032800 parameter:parameter:0x2000@0x0 617 bytes
0x00033000 misc:Image/misc.img:0x2000@0x2000 49152 bytes
0x0003f000 kernel:Image/kernel.img:0x6000@0x4000 8233008 bytes
0x00819800 boot:Image/boot.img:0x6000@0xa000 4693456 bytes
0x00c93800 recovery:Image/recovery.img:0x10000@0x10000 16187392 bytes
0x01c03800 system:Image/system.img:0x180000@0x282000 584753152 bytes
0x249ad800 oem:Image/oem.img:0x40000@0x402000 75497472 bytes
0x291ad800 backup:backupimage/backup.img:0x20000@0x20000 29378564 bytes
0x2adb2800 update-script:update-script 933 bytes
0x2adb3000 recover-script:recover-script 266 bytes
-------------------------------------------------------------------------------
================================================================================

0x2ade49b8 input-update.img-MD5 32 bytes
unpacked
sphakka commented 6 years ago

Please note that your rkunpack from https://github.com/neo-technologies/rkflashtool does something different (only the BOOT section is extracted):

$ /home/utilz/android/tools/rkflashtool/rkunpack input-update.img 
rkunpack: info: RKFW signature detected
rkunpack: info: version: 4.4.2
rkunpack: info: date: 2016-03-29 20:03:07
rkunpack: info: family: rk31xx
rkunpack: info: 00000066-000311b3 BOOT                       (size: 201038)
rkunpack: info: 000311b4-2ade49b7 embedded-update.img        (size: 719009796)
unpacked

I'm confused ^-^

julienchauveau commented 6 years ago

If I remember correctly, you have to run rkunpack again on the newly created embedded-update.img

$ /home/utilz/android/tools/rkflashtool/rkunpack embedded-update.img