[HOW-TO] Create an update.zip - Dhaka Mobile  
Dhaka Mobile

Go Back   Dhaka Mobile > Mobile Phone Brands -=Hardware & Software Area=- > Android based mobile phones / Tablets
Android based mobile phones / Tablets All android based mobile phones / tablets suggestions & solutions here.
Forums by Category
Closed Thread
Thread Tools Search this Thread Display Modes
Old 06-27-2013, 22:42   #1
Top Contributor
M.Irfan's Avatar
Join Date: Sep 2010
Posts: 6,749
Status: Offline
Thanks: 5
Thanked 184 Times in 152 Posts
Rep Power: 13
M.Irfan is on a distinguished road
Send a message via MSN to M.Irfan Send a message via Yahoo to M.Irfan

[HOW-TO] Create an update.zip

if you want to create a .zip with something to add to your phone, there are a few tools to automate their creation, but restricted to Windows. Here I will explain the mechanics of their creation (applicable in all OSs).

Things you need:
  1. Item to be added (example, Calculator.apk)
  2. Testsign.jar: [Only registered and activated users can see links. ]

1) Decide where the item to be added goes (/system/app)

2) Create the folders appropriate to the location from step 1
For me, this would mean I create a folder, 'app', inside a folder 'system'
For Windows Command Line:

mkdir systemapp
For Unix Command Line:

mkdir -p system/app
3) Move the item into the correct location
For me, Calculator.apk is located at system/app/Calculator.apk

4) Create the following file tree: META-INF/com/google/android
Use the appropriate code from above.

5) create a file called update-script in META-INF/com/google/android
Note the lack of an extension, to achieve this effect, Windows users should include quotation marks around the name in the Save As dialog box.( Save As: "update-script")

6) update-script:

show_progress 0.1 0 copy_dir PACKAGE:system SYSTEM: show_progress 0.1 10
Please add an empty line at the end!!

The code above is pretty easy to understand The thing to note is the line with 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.

<src-dir> and <dst-dir> options:
ROOT: Root FileSystem ('/')
BOOT: Boot ('/dev/block/mtdblock0')
DATA: Data ('/data' or '/dev/block/mtdblock2')
CACHE: Cache ('/cache' or '/dev/block/mtdblock5')
MISC: ('/dev/block/mtdblock3')
PACKAGE: update.zip
RECOVERY: Recovery ('/dev/block/mtdblock4')
SDCARD: SDCard ('/sdcard')
SYSTEM: System ('/system' or '/dev/block/mtdblock1')
TMP: (RAM, cleared on reboot)

Example: If you wanted to copy 'somefolder' from your update.zip to your SDCard's 'Music' folder...

copy_dir PACKAGE:somefolder SDCARD:Music
7) Zip up the folders you created (For me, I zipped up META-INF and system into Calculator.zip).

8) Sign the update:

java -classpath <path to testsign.jar> testsign Calculator.zip Calculator-signed.zip
The classpath is the path to the folder containing testsign.jar. If it is in the same folder, the classpath is just './testsign.jar'

You are all set!

Note for Mac users:
OSX creates hidden files in all directories called '.DS_Store'. Please remember to remove them!

Note for Windows users:
I tend to use the Unix file separator ('/'), so please remember to switch it to '\' when using commands on your computer. On the other hand, Android is a Unix system, so android commands use '/'

Dhaka Mobile Team
Collapse Related threads at Dhaka Mobile
Thread Thread Starter Forum Replies Last Post
[ HOW TO ] Create iPhone Debugging Cable M.Irfan iPhone, iPod & iPad Hardware Repair 2 02-02-2017 15:48
How to create a bootable CD/DVD?? pandit Off Topic Zone 1 12-15-2013 07:21
[HOW-TO] Create an update.zip .:::RoMoN:::. Android based mobile phones / Tablets 0 06-25-2013 07:36
HOW TO - Create iPhone Debugging Cable M.Irfan Iphone, iPad - FAQ, Guide, & Tutorials 1 06-22-2013 09:01
How To Create And Use iPhone Ringtones For Free M.Irfan iPhone Applications, games & multimedia 0 10-24-2010 20:36

Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Clear Default Style - Mobile Style Clear
All times are GMT +1. The time now is 11:34.

Follow us below -

Copyright ©2010-2017. Dhaka Mobile
Registered trademark of vBulletin Solutions