android 正在升级包,Android 制作 升级包

There are several ways to install applications or  library files to an Android Phone. You can use Market application to find and install or adb command line tool to install or push the files to Android file system. These are all easy to implement for  single  file but if you have several applications or library files to install at once, it might be better to use update zip file. The update zip file is Android advanced system to install applications or lib files to Android file system using recovery tool. This method is commonly used by rom or theme developers to distribute their package.

Creating an update zip file is quite easy, all you have to do is put the files in corresponding directory in Android file system and an update-script file to copy the files. For example, to install Calculator.apkintosystem/app and copy libsec-ril.so file intosystem/lib : Create an empty folder (eg. C:\myupdate)

Create C:\myupdate\system\app folder for Calculator.apk and C:\myupdate\system\lib folder for libsec-ril.so

Create C:\myupdate\META-INF\com\google\android folder for update-script file.

Create theupdate-script file with the following syntax:show_progress 0.1 0

copy_dir PACKAGE:system SYSTEM:

show_progress 0.1 10

Line 1&5 : show progress bar

Line 3: copy system folder from update package to Android’s/system

Note: you should add one extra  line at the end of the file (Line 6)

Compress the entire contents of C:\myupdate folder to zip (not the myupdatefolder itself)

Sign the myupdate.zip file

java -jar signapk.jar certificate.pem key.pk8 myupdate.zip update.zip

Note: you can find tutorial on how to sign the update.zip file here

Copy the update.zip file to sdcard and apply it from recovery console

update-script syntax reference (definitions from recovery.c android source code): copy_dir

Syntax:copy_dir []

Copy the contents of to  . The original contents of are preserved unless something in overwrote them.

Ex: copy_dir PACKAGE:system SYSTEM:

format

Syntax: format

Format a partiti0n

Ex:format SYSTEM:, will format entire/system . Note: formatting erases data irreversibly.

delete

Syntax: delete [... ]

Delete  file.

EX: delete SYSTEM:app/Calculator.apk, will delete Calculator.apk from system/app directory.

delete_recursive

Syntax: delete_recursive [... ]

Delete a file or directory with all of it’s contents recursively

Ex: delete_recursive DATA:dalvik-cache, will delete/data/dalvik-cache directory with all of it’s contents

run_program

Syntax:run_program [ ...]

Run an external program included in the update package.

Ex: run_program PACKAGE:install_busybox.sh, will runinstall_busybox.sh script (shell command) included in the update package.

set_perm

Syntax: set_perm [... ]

Set ownership and permission of single file or entire directory trees, like ‘chmod’, ‘chown’, and ‘chgrp’ all in one

Ex:set_perm 0 2000 0550 SYSTEM:etc/init.goldfish.sh

set_perm_recursive

Syntax: set_perm_recursive [... ]

Set ownership and permission of a directory with all of it’s contents recursively

Ex: set_perm_recursive 0 0 0755 0644 SYSTEM:app

show_progress

Syntax: show_progress

Use of the on-screen progress meter for the next operation, automatically advancing the meter over seconds (or more rapidly if the actual rate of progress can be determined).

Ex: show_progress 0.1 0

symlink

Syntax: symlink

Create a symlink (like ‘ln-s’). The is in root:path format, but is

for the target filesystem (and may be relative)

----------

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值