Android OTA update package preparation and androidota update package

Source: Internet
Author: User

Android OTA update package preparation and androidota update package

0. Signature

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]

│ ─-META-INF

│ 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

1) update-script

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

12 [Practical tutorial] _ detailed description of the ROM updater-scripthttp://wenku.baidu.com/link?url=PBCuu50VRxDzx_1wb5JfyZH-oURgYhMTyDVq5SGKsPZqfP3wW6DbegiFqszYJVzP3037osTX-aEFmsAx5nnMH6CYcJOuDAXo1jm0BfROmi3

 

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:

Out/target/product/[produce name]/obj/PACKAGING/target_files_intermediates/

 

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)

Out/target/product/[produce name]/obj/PACKAGING/target_files_intermediates/

Out/target/product/[produce name]/

 

Use the New and Old obj directories to generate a differential package


mkdir OTA/cp xxxx_obj.zip  OTA/old_obj.zipcp yyyy_obj.zip OTA/new_obj.zip // We recommend that you run the generation tool in the source code root directory. It is said that the relative path of the root directory is used../build/tools/releasetools/ota_from_target_files -v -n -i OTA/old_obj.zip OTA/new_obj.zip OTA/diff.zip

In this way, a differential package is generated and can be upgraded in the version corresponding to the old product.

 


Error during differential package Creation http://blog.csdn.net/kangear/article/details/23831431



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.