I'm trying to implement the incremental OTA update process for my custom Android ROM based on Android 7.0 Nougat. I've managed to build the first and second(modified) version of the firmware, so I have the first and second target_files.zip.
I've created the incremental OTA zip following the official guide (https://source.android.com/devices/tech/ota/tools), more exactly using this command: ./build/tools/releasetools/ota_from_target_files -i PREVIOUS-tardis-target_files.zip dist_output/tardis-target_files.zip incremental_ota_update.zip # make incremental from the older version
I installed the first firmware version on a device and tried to update it with the incremental_ota_update.zip with these steps:
created the "command" file inside /cache/recovery folder with the following text inside it: --update_package=/cache/Update.zip
manually copied the incremental_ota_update.zip inside the /cache folder
ran the following command from my system app, which is a launcher app: RecoverySystem.installPackage(context, new File("/cache/incremental_ota_update.zip"));
The device restarts itself, arrives in the recovery menu with two options: restart device and restart with bootloader, I hit the "restart device" option. It restarts but no changes are made, the incremental update is not installed.
I checked the log file and it says:
Opening update package...
I:read key e=3 hash=20
I:1 key(s) loaded from /res/keys
Verifying update package...
I:comment is 1738 bytes; signature 1720 bytes from end
I:signature (offset: 0x3cfdfe, length: 1714): 308206ae06092a864886f70d010702a082069f3082069b020101310b300906052...[ 2.849059] I:whole-file signature verified against RSA key 0
Update package verification took 0.1 s (result 0).
Error: Invalid OTA package, missing scatter
E:install package error, result = 1
Update.zip is not correct
Installation aborted.
nand type is emmc
After this I copied the ota_scatter.txt from the second target_files.zip and put it inside the incremental_ota_update.zip and retried the update process and now I get the following error:
Opening update package...
I:read key e=3 hash=20
I:1 key(s) loaded from /res/keys
Verifying update package...
E:footer is wrong
Update package verification took 0.0 s (result 1).
E:signature verification failed
E:install package error, result = 7
Signature verification failed
Installation aborted.
nand type is emmc
I don't know what I'm doing wrong, if anyone can help me out I will greatly appreciate it!