Android OTA update package preparation and androidota update package
Java-Xmx2048m-jar out/host/linux-x86/framework/signapk. jar-w build/target/product/security/testkey. x509.pem build/target/product/security/testkey. pk8
This key is automatically generated in debug mode.
You can also create your own private key through openssl
The generated key is automatically used to sign the OTA update package. The signature location in the OTA update package is as follows:
│ [Ota package]
│ CERT. RSA
│ CERT. SF
│ MANIFEST. MF
│ └ ── Com
│ --- └ ── Android
│ ------ Otacert
1. Use the Android packaging command to create an oTA update package
After the entire project is compiled, execute make otapackage.
The generated full upgrade package will be stored under out \ debug \ target \ product \ [project name] \
The specific name is determined based on install of make otapackage.
The Generated Process file is in the out/target/product/ardbeg/obj/PACKAGING/target_files_intermediates/directory. This file can be used to create a differential update package.
2. OTA package modification
OTA package decompress META-INF \ com \ google \ android directory has two files
Update-binary is a binary file, which is equivalent to a script interpreter and can recognize the operations described in updater-script. After compiling the Android source code, this file is generated by out/target/product/tcc8800/system bin/updater. You can rename updater to update-binary.
The name of the file in the update package is determined by the value of the macro ASSUMED_UPDATE_BINARY_NAME in bootable/recovery/install. c In the source code.
Updater-script: this file is a script file that describes the update process. We can write this script according to the actual situation to meet our specific needs. The file name is determined by the macro SCRIPT_NAME value in the bootable/recovery/updater. c file in the source code.
The progress bar during the upgrade. The files to be upgraded are specified in this script. If you need to modify the package file, this script is generally modified or the package resource file is replaced by the main
There are a lot of online descriptions and I will not describe them any more. For more information, see
2) recovery code
[Src path] \ bootable \ recovery
Bootable \ recovery \ updater \ install. c
The subfunctions registered in this function can be called directly in the update-script.
In some embedded products, bootloader, boot screen, and other partition burning and reading are defined by yourself. To update this partition, you need to add a private function in the registration function.
3) modify the generated update package
Decompress update.zip and modify the update-script and resource file according to the above rules.
Repackaging. Remember to use the storage mode for packaging. Do not select any compression method. Otherwise, the signature will fail.
Refer to the 0th manual signatures for a new package file and click "Flash ".
3. OTA differential update package
Make otapackage to create the new and old packages respectively.
The package file used to create the differential package is in the following directory:
To use a differential package, you must first update the package to the old version. Therefore, you must save the intermediate file and the complete package for version management, in the following paths (the matching versions must be generated at the same time)
Use the New and Old obj directories to generate a differential package
In this way, a differential package is generated and can be upgraded in the version corresponding to the old product.