Installing applications to an Android phone is simple, either use the Market application to find and install, put the apk file for the program on to your phone/SD card and install using Astro or finally you can use the adb push command to push the files to the phone. These are all fine methods of installing single programs to the phone but when you want to install a few programs/libraries/configs all at once you may be better using an Update.zip file with everything packaged up. The case for such a file is obvious when you want to add all of the Google applications to the AOSP builds of Android which would take a while rather than installing one update.
Information on how to create the Update.zip was taken from htcpedia.com thanks to Lox for sharing.
Creating an update.zip package is quite easy in fact. For example, to add a (valid) test.apk package to your rom:
- create an empty folder <workdir>
- create folder structure for test.apk (<workdir>/system/app) and copy the test.apk
- create folder structure for update-script (<workdir>/META-INF/com/google/android)
- edit <workdir>/META-INF/com/google/android/update-script
- put in it:
show_progress 0.1 0 copy_dir PACKAGE:system SYSTEM: set_perm_recursive 0 0 0755 0644 SYSTEM:app show_progress 0.1 10
- compress the <workdir> content to zip (not the <workdir> folder itself)
Now you are going to sign the zip file. Download testsign.zip and copy it in your <SDK>/tools folder. Extract it here. It should create a sign subfolder with a testsign.jar file in it.
Then in the command prompt/terminal, from <workdir> folder, do:
java -classpath <SDK>/tools/sign/testsign.jar" testsign file.zip file-signed.zip
Ok, now your zip file is ready to be deployed using the “Flash zip from sdcard” option in a recovery image.



The syntax in update-script yields a syntax error.
Can you explain how the show_progress works?
Where do I look up documentation on the copy_dir set_perm_recursive, and show_progress commands?
I never like entering commands from tutorials without knowing what I’m doing.
Thanks
Hi,
Thanks for the tutorial! I am able to run the script in terminal on Ubuntu. It returns a so called signed file.zip. I know it does something. My file grew almost three MB. However, neither my Droid x nor my Fascinate will accept the signature. They reject the update.zip it produces every time. If there is something else you would like me to try please let me know. I will do it.
Here is my terminal:
mike@mike-laptop:~$ java -classpath ~/testsign.jar testsign maderstcok340.zip update.zip
mike@mike-laptop:~$ java -classpath ~/android-sdk-linux/tools/sign/testsign.jar testsign maderstcok340.zip update.zip
mike@mike-laptop:~$
I’ve tried several way including “update-signed.zip” . I’m beginning to think that this method is only for signing .apk files like the test.apk example given. If so sorry for wasting your time.
Thanks in advance,
Mike
I agree with Matt Brehove.
This is a sucky suck suck sucko explanation.
Mr. Rob.
Do You have the correct testsign for motorola XT531, because when I try to apply the pack update.zip I got the follow message “E:signature verification failed”.
All help I’ll appreciate, now my cell do not display the home because a moved a wrong file and I need to rollback it.
thanks
Edson
When entering the command will happen and just show this symbol >
thanks.