Android: Make Update.zip Upgrade package "Go"

Source: Internet
Author: User

This article was reproduced from: http://zwkufo.blog.163.com/blog/static/2588251201382293049118/

Many times the manufacturer or the three-party ROM does not meet the requirements, such as the system comes with outdated software, the lack of GMS software package (Google Mobile Service, including Gmail, GooglePlay and other Google home-use software, many users are accustomed to using Gmail , with Contactssync, so there is usually a strong demand for this service pack), and so on.

In this case, one way is for the user to install/replace the existing application in the ROM by cracking the device, adding root privileges, while the other is making an upgrade package (Update.zip) and upgrading the machine in recovery mode- This method is used by many manufacturers such as Sony, because it can not crack the device or add root privileges in the case of a smooth upgrade of software or other data in the system. Of course, this approach requires signing the upgrade package with a signature file (Key) that is consistent with the upgrade ROM. The following is an example of making a GMS upgrade package (which I think many people are aiming for), which introduces the process of making a simple update.zip: 1) Create a directory (for example, a folder named "Update")It contains content that needs to be packaged into Update.zip to upgrade or replace the original Rom:

Update/ Update/system Update/system/app Update/system/app/xxxx. APK Update/META-INF Update/META-INF/com Update/META-INF/com/Google Update/META-INF/com/Google/android Update/META-INF/com/Google/android/update- Binary Update/META-INF/com/Google/android/Updater -script In the GMS package, I have included many apk and maps related libs from source Google: among them, Updater-script is the script file that Update.zip needs to release the installation, Updatebinary is a library of functions that the script file needs to call, which can be extracted from ROM, or from >>>> here << << download use. 2) Write Updater-scriptEdify scripts (Updater-script and update-binary) are now widely used; Amend scripts (update-script) were long ago, It is no longer supported: So if you see a script example named Update-script, it is generally useless to ignore it. Still take the GMS as an example, copy the files in the upgrade package recursively to the appropriate directory in the device:

ui_print("***********************************************"); ui_print("GMS for Beta User"); ui_print("***********************************************"); show_progress(1, 3); Mount("Ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/ System ", "/system "); package_extract_dir("System", "/system"); set_perm_recursive(0, 0, 0755, 0644, "/ System/app "); set_perm_recursive(0, 0, 0755, 0644, "/system/etc /permissions "); set_perm_recursive(0, 0, 0755, 0644, "/ System/framework "); set_perm_recursive(0, 0, 0755, 0644, "/system/lib ");set_perm_recursive(0, 0, 0755, 0644, "/ System/media "); set_perm_recursive(0, 0, 0755, 0644, "/system/usr ");unmount("/system"); ui_print("GMS update complated." );The mount point for "/system" above varies by device. About the Edify script syntax and functions of the introduction, there is a lot of information on the Internet, there is interest can be searched to see if it can meet your customized needs. 3) hit the ZIP packageThe compressed package can be used with the compression tool, or it can be done with the following command line. But make sure there is meta-inf in the root directory of the package: If you are using the "zip" command in a Linux environment like Ubuntu, you need to use the command in the root directory of Step (1):

$ zip -qry . /update_unsigned. Zip ./

4) Signing the compression packageUse the following command to sign the update_unsigned.zip generated in the previous step:

$ java -xmx512m -jar signapk. Jar -w releasekey. X509. PEM Releasekey. PK8 update. unsigned. Zip update. Zip

Where:-xmx512m: Specifies the Java maximum memory stack, my package is larger than 512 is not enough, set to 4096 success; Signapk.jar: The signature tool can be found in the source code (/prebuilts/sdk/tools/lib/ Signapk.jar), or from >>>> here <<<< download. The files in the download link are based on Android4.3 extraction and are not necessarily generic. Releasekey.x509.pem RELEASEKEY.PK8: These two are the signature keys for the existing ROM release, which varies with the device/rom. 5) Apply Update.zip upgrade PackageAt this point, the upgrade package has been created. Put the signed Update.zip package into the SD card or other directory that can be accessed (some devices may require an SD card root), reboot the device and enter recovery mode, find Update.zip and upgrade (some devices may have "apply Update.zip" directly option) to restart the phone after successful.

Android: Make Update.zip Upgrade package "Go"

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.