Thread: [HOW-TO] Create an update.zip
- 03-17-2011, 01:16 AM #1
[HOW-TO] Create an update.zip
So, 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:
- Item to be added (example, Calculator.apk)
- Testsign.jar: Get it here
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:
For Unix Command Line:Code:mkdir systemapp
3) Move the item into the correct locationCode:mkdir -p system/app
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:
Please add an empty line at the end!!Code:show_progress 0.1 0 copy_dir PACKAGE:system SYSTEM: show_progress 0.1 10
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...
7) Zip up the folders you created (For me, I zipped up META-INF and system into Calculator.zip).Code:copy_dir PACKAGE:somefolder SDCARD:Music
8) Sign the update:
The classpath is the path to the folder containing testsign.jar. If it is in the same folder, the classpath is just './testsign.jar'Code:java -classpath <path to testsign.jar> testsign Calculator.zip Calculator-signed.zip
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 '/'Last edited by phoenixsong6; 03-18-2011 at 10:27 AM.
-
16 Users Say Thank You to phoenixsong6 For This Useful Post
3rdstring (03-31-2011), blackwing182 (12-28-2011), CarL!ToX™ (03-17-2011), dholla1 (03-26-2012), DJGHOSTS3V3N (03-17-2011), dlamber7 (08-04-2011), epinter (03-17-2011), firesnatch (03-17-2011), jaims009 (10-11-2011), jethro650 (10-17-2011), Naser_Maldini (04-25-2011), neo.ank (08-21-2011), Pzyduck (03-17-2011), Saurus (09-17-2011), scouter389 (03-20-2011), ZduneX25 (03-19-2011)
- 03-17-2011, 04:27 AM #2
Awesome guide man. Once I get home ill thanks it.
Sent from my Nexus S using Tapatalk
"Remember that life loves you, but most of the time, you don't love life"



- 03-17-2011, 05:32 AM #3
- Join Date
- Apr 2009
- Location
- La Rioja - Argentina
- Posts
- 5,175
- Thanks
- 1,885
- Thanked 4,273 Times in 1,850 Posts
- Blog Entries
- 6
- Downloads
- 181
- Uploads
- 360
Thanks you so much, beautifull guide 
Moved to correct area and sticky
Last edited by Pzyduck; 03-17-2011 at 05:37 AM.

-
The Following User Says Thank You to Pzyduck For This Useful Post:
ZduneX25 (03-19-2011)
- 03-17-2011, 07:14 PM #4

"Remember that life loves you, but most of the time, you don't love life"



-
The Following User Says Thank You to DJGHOSTS3V3N For This Useful Post:
Semseddin (08-18-2011)
- 03-18-2011, 07:38 AM #5
- 03-18-2011, 03:51 PM #6
Ohh thanks man.
Sent from my Nexus S using Tapatalk
"Remember that life loves you, but most of the time, you don't love life"



- 08-21-2011, 05:58 PM #7
Thanks a lot man... Really a useful Guide..
"If x+y+z= Success, then
x= Hard Work,
y= Play, and
z= Keep Your Mouth Shut." - Einstein
- 08-23-2011, 12:49 PM #8
Of Mice and Modders
- Join Date
- Aug 2010
- Location
- Mexico
- Posts
- 55
- Thanks
- 4
- Thanked 4 Times in 4 Posts
- Downloads
- 14
- Uploads
- 0
Good guide. Just some questions:
If i wanto to copy su comand to /system/sbin and give it 4500 attributes how should it be?
- 11-17-2011, 04:51 PM #9
Complete and concise guide by @phoenixsong6 (as usual). One suggestion; if using a mtdblock as <dst_dir> do a 'mount' command to verify the assignment of the partition to /dev/block/mtdblockn before the copy_dir, since n can differ between various devices.
Hic sunt dracones...
- 11-17-2011, 07:44 PM #10
This is for the older recoveries and uses amend script. Most recoveries don't even support it anymore. I'm going to make a new guide in a few days for the newer edify scripting.
As for your note about mounting the blocks, for amend scripting, it is not necessary since the recovery automatically mounts the blocks and maps them with the appropriate name. For the newer edify script, though, yes, you need to remember to mount them before any manipulation.
-
The Following User Says Thank You to phoenixsong6 For This Useful Post:
Saurus (11-19-2011)
- 12-28-2011, 05:36 AM #11
Itty Bitty Modder
- Join Date
- Dec 2011
- Posts
- 1
- Thanks
- 0
- Thanked 0 Times in 0 Posts
- Downloads
- 0
- Uploads
- 0
Signature failed when try to use with Motorola XT531, help
I got your procedure as a final chance to my case.
Let me explain:
I root my XT531 and start to move some files from /system/app to have more space on the internal memory.
So, I had succes using the follow, I move the file.apk to my sdcard and replace a link to it in the original place.
So far I was feeling good and had 55 MB free.
But, my proud was broken when a I move a file named motoswitch.apk from /system/app to sdcard and forgotten to create a respective link to it on the original place. After reboot I got a blank Screen.
So, to make worst, I had enter in recovery mode and used "wipe data user" this was big mistake, because I lost the profile that could be used for example to receive an email and paste the file again.
So, as I explain, my final change is create a update.zip to restore the file to the correct folder.
When I tried your tip I got the message "E:Signature verification failed" ou "Invalid" I guess.
PS: the USB Debug option is not checked.
Please help me.
Regards.
Edson
- 12-28-2011, 10:12 AM #12
Did you remember to sign the update.zip? (Step 8)
- 12-28-2011, 11:46 AM #13
Oh shiet this is an old thread. :O.
There are a lot of ways to sign a file out there, google it.
Sent from my MB501 using Tapatalk
"Remember that life loves you, but most of the time, you don't love life"



- 02-07-2012, 12:31 PM #14
Itty Bitty Modder
- Join Date
- Feb 2012
- Posts
- 10
- Thanks
- 0
- Thanked 1 Time in 1 Post
- Downloads
- 0
- Uploads
- 0
the same wi
- 02-07-2012, 12:46 PM #15
Are you using a custom recovery? If so, which one?


LinkBack URL
About LinkBacks
Reply With Quote



