<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    posts - 189,comments - 115,trackbacks - 0
    Android  制作 升級(jí)包

    http://hi.baidu.com/j_fo/blog/item/81ae650953ea5ec13ac76312.html
    http://hi.baidu.com/j_fo/blog/item/53a45b82206837af0df4d21a.html

    如何制作自己的android升級(jí)包(update.zip)
    2010-09-04 19:34
    手動(dòng)制作update.zip包的過(guò)程:

    1.創(chuàng)建一個(gè)update目錄,該目錄包含自己想要升級(jí)或替換的內(nèi)容
    例如:
    update/
    update/system
    update/system/app
    update/system/app/doodle_jump.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-script
    該目錄包含doodle_jump游戲,升級(jí)后該apk將出現(xiàn)在手機(jī)的/system/app/目錄下。
    META-INF目錄下包含升級(jí)腳本,update-script腳本的內(nèi)容如下:
    show_progress 0.500000 0
    copy_dir PACKAGE:system SYSTEM:
    show_progress 0.100000 0
    大家可以根據(jù)自己的升級(jí)內(nèi)容添加相應(yīng)的命令。
    2.創(chuàng)建壓縮包
    在update/目錄下運(yùn)行:
    $ zip -qry ../update.unsigned.zip ./
    將在update/的父目錄下產(chǎn)生update.unsigned.zip 壓縮包
    3.簽名
    $ java -Xmx512m -jar signapk.jar -w key.x509.pem key.pk8 update.unsigned.zip update.zip
    生成簽過(guò)名的update.zip包,其中
    signapk.jar,key.x509.pem,key.pk8與具體手機(jī)系統(tǒng)相關(guān)
    4.將簽過(guò)名的update.zip包放入手機(jī)sdcard根目錄,
    重啟系統(tǒng)進(jìn)入recovery模式,選擇
    apply update.zip,成功后重啟手機(jī)
    ok,現(xiàn)在手機(jī)上已經(jīng)有doodle_jump游戲了,并且它無(wú)法被刪除~


    refer:
    http://hi.baidu.com/j_fo/blog/item/53a45b82206837af0df4d21a.html

    How to Create Android Update Zip Package

    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.apk into system/app and copy libsec-ril.so file into system/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 the update-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 myupdate folder 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 <src-dir> <dst-dir> [<timestamp>]
      Copy the contents of <src-dir> to  <dst-dir>. The original contents of <dst-dir> are preserved unless something in <src-dir> overwrote them.
      Ex: copy_dir PACKAGE:system SYSTEM:

    • format
    • Syntax: format <root>
      Format a partiti0n
      Ex: format SYSTEM:, will format entire /system . Note: formatting erases data irreversibly.

    • delete
    • Syntax: delete <file1> [... <fileN>]
      Delete  file.
      EX: delete SYSTEM:app/Calculator.apk, will delete Calculator.apk from system/app directory.

    • delete_recursive
    • Syntax: delete_recursive <file-or-dir1> [... <file-or-dirN>]
      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 <program-file> [<args> ...]
      Run an external program included in the update package.
      Ex: run_program PACKAGE:install_busybox.sh, will run install_busybox.sh script (shell command) included in the update package.

    • set_perm
    • Syntax: set_perm <uid> <gid> <mode> <path> [... <pathN>]
      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 <uid> <gid> <dir-mode> <file-moe> <path> [... <pathN>]
      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 <fraction> <duration>
      Use of the on-screen progress meter for the next operation, automatically advancing the meter over <duration> seconds (or more rapidly if the actual rate of progress can be determined).
      Ex: show_progress 0.1 0

    • symlink
    • Syntax: symlink <link-target> <link-path>

      Create a symlink (like ‘ln-s’). The <link-path> is in root:path format, but <link-target> is
      for the target filesystem (and may be relative)

    ----------


    用Android自帶的signapk.jar + .x509.pem + .pk8簽名應(yīng)用程序 


    http://lmdy2001.blog.163.com/blog/static/8423891020114262323816/


    文件位置:可以在platform/build/target/product/security/中找到platform.pk8 platform.x509.pem等簽名文件,對(duì)應(yīng)不同的權(quán)限。
    signapk.jar:由/platform/build/tools/signapk/編譯產(chǎn)出,可以在/out/host/linux-x86/framework/中找到。

    簽名:
    java -jar signapk.jar platform.x509.pem platform.pk8 MyDemo.apk MyDemo_signed.apk 得到具有對(duì)應(yīng)權(quán)限的APK

    優(yōu)化APK:
    zipalign -v 4 MyDemo_signed.apk MyDemo_new.apk

    查循APK是否優(yōu)化過(guò):
    zipalign -c -v 4 MyDemo.apk


    posted on 2011-08-23 14:22 MEYE 閱讀(4981) 評(píng)論(0)  編輯  收藏 所屬分類(lèi): Android3D
    主站蜘蛛池模板: 亚洲国产婷婷综合在线精品| 天天操夜夜操免费视频| 成人免费无码视频在线网站| 免费a级毛片大学生免费观看 | 一本色道久久88亚洲精品综合 | 豆国产96在线|亚洲| 在线观看黄片免费入口不卡| 永久免费AV无码国产网站| 亚洲中文字幕成人在线| 亚洲Av高清一区二区三区| 久久国产美女免费观看精品 | 成人免费无码视频在线网站| 亚洲中文字幕无码久久2017| 亚洲欧洲国产综合| www永久免费视频| 中字幕视频在线永久在线观看免费| 狠狠色婷婷狠狠狠亚洲综合| 亚洲午夜久久久久久尤物| 国产免费福利体检区久久| 在线观看免费为成年视频| 亚洲av无码一区二区乱子伦as| 亚洲AV日韩综合一区| 一区二区免费视频| 亚洲国产精品人人做人人爱| 亚洲乱码中文论理电影| 中文永久免费观看网站| 特级淫片国产免费高清视频| 亚洲综合成人网在线观看| 人体大胆做受免费视频| 最近中文字幕免费mv视频8| 亚洲av午夜成人片精品网站 | 国产一卡二卡四卡免费| 亚洲日韩精品一区二区三区无码| 亚洲日韩精品国产一区二区三区| 久艹视频在线免费观看| 亚洲国产人成中文幕一级二级| 中文字幕亚洲精品无码| 无码囯产精品一区二区免费| 久久国产成人精品国产成人亚洲| 亚洲久热无码av中文字幕| 57pao一国产成永久免费|