How to unzip the OTA files¶
See the Project Victor Firmware folder for a description how to download the .ota files and how to verify them. It also includes a tool that can aid with the extraction.
There are three parts
- First, the OTA's have to be decrypted
- Next, the system files are extracted from the sysfs archive
- Finally boot initramfs files can be extracted. (Their archive is a bit different)
Decrypting the OTA archives¶
The OTA files are tar.gz files, so they can be opened with tar (or similar tool). Among the files inside are two files:
apq8009-robot-boot.img.gz
(encrypted)
apq8009-robot-sysfs.img.gz
(encrypted)
Decrypting these files is done by:
openssl enc -d -aes-256-ctr -pass file:ota.pas -in apq8009-robot-boot.img.gz -out apq8009-robot-boot.img.dec.gz
openssl enc -d -aes-256-ctr -pass file:ota.pas -in apq8009-robot-sysfs.img.gz -out apq8009-robot-sysfs.img.dec.gz
With OpenSSL 1.1.0 or later, add “-md md5” to the command:
openssl enc -d -aes-256-ctr -pass file:ota.pas -md md5 -in apq8009-robot-boot.img.gz -out apq8009-robot-boot.img.dec.gz
openssl enc -d -aes-256-ctr -pass file:ota.pas -md md5 -in apq8009-robot-sysfs.img.gz -out apq8009-robot-sysfs.img.dec.gz
The keys can be found in the detail/keys folder in the Project Victor repository.
Unziping the system filesystem (sysfs) archive¶
On windows, the decoded .img
files can extracted with 7zip
On linux, you can mount the file
- gunzip the decrypted
apq8009-robot-sys.img.dec.gz
sudo mkdir /media/iso
sudo mount -o loop apq8009-robot-sys.img.dec /media/iso
Unziping the boot initramfs filesystem (boot) archive¶
There are a couple of alterantives for tool sets:
- With Linux and Windows 10, there is a convenient tool
- For other systems, imgtool/imjtool from the New Android Book works
Linux and Windows 10 WSL methd¶
-
Go to How to unpack and repack boot and ramdisk files easily and follow the directions for the tool down load and installation
-
Added them to my path,
- Opened wsl
- gunzip the decrypted
apq8009-robot-boot.img.dec.gz
- Finally "unpack apq8009-robot-boot.img"
imgtool / imjtool¶
For other systems there is a help tool already exists
- Download, build and install imjtool
- gunzip the decrypted
apq8009-robot-boot.img.dec.gz
- Extracted the files using the image tool
imjtool boot.dec.img extract
That creates an extract folder with the ramdisk. The ramdisk is in "cpio" format.
Finally Extracted the files with
cd extract gzcat ramdisk| cpio -idmv
References and Resources¶
The decryption was originally posted to the Anki Vector Rooting google group
How to unpack and repack boot and ramdisk files easily on Linux and windows 10
- imgtool — now called imjtool