Python script for working with Novatek firmware update files from manufacturers (like FWA***.bin). Show full FW info, allow extract, add, delete, replace, uncompress and compress partitions back, fix CRC for modded partitions and whole firmware file. Useful tool for building custom firmwares. Use Linux environment or WSL2 (Windows Subsystem for Linux) for properly work with UBI and SPARSE partitions.
Novatek FW info is available under the terms of the GNU Public License version 3.
If this project helps you, you can send me any amount of BTC to address 12q5kucN1nvWq4gn5V3WJ8LFS6mtxbymdj or use QR code below:
First of all install:
sudo apt-get install python3
sudo apt-get install python3-pip
sudo apt-get install mtd-utils
sudo apt-get install liblzo2-dev
sudo apt-get install pypy3
Additionaly install this python modules:
sudo pip3 install python-lzo
sudo pip3 install ubi_reader
For SPARSE partitions support install:
sudo apt-get install android-sdk-libsparse-utils
For FDT(DTB) partitions support install:
sudo apt-get install device-tree-compiler
python3 ./NTKFWinfo.py -i FWA229A.bin
python3 ./NTKFWinfo.py -i FWA229A.bin -u 6
Compress partition back to firmware binary file from uncompressed file(for BCL1) or folder(for UBI or SPARSE) and fix all CRC:
python3 ./NTKFWinfo.py -i FWA229A.bin -c 6
(as example extract data from CKSM partition and skip first 64 CKSM-header bytes)
python3 ./NTKFWinfo.py -i FWA229A.bin -x 6 64
Add a new partition with new ID=6 using file FWA229A.bin-partitionID6 (filename is optionally, if not defined will be used input filename appended with '-partitionID6'):
python3 ./NTKFWinfo.py -i FWA229A.bin -add 6 ./FWA229A.bin-partitionID6
Take a note that partition name, memory offset and size for a new partition ID will be used from fdt partition (if it is exist in FW). If it is not presented in fdt - new partition can't be flash to memory. You need to modify fdt partition manually in that case.
python3 ./NTKFWinfo.py -i FWA229A.bin -delete 6
python3 ./NTKFWinfo.py -i FWA229A.bin -r 6 64 ./img-726660551.ubi
python3 ./NTKFWinfo.py -i FWA229A.bin -fixCRC
python3 ./NTKFWinfo.py -i FWA229A.bin -u 6 -o tempdir
python3 ./NTKFWinfo.py -i FWA229A.bin -c 6 -o tempdir
I suggest use pypy3 VS python3 to decrease compression time for BCL1 LZ partitions:
pypy3 ./NTKFWinfo.py -i GIT3FWv2.3.bin -c 0



