GSM Shop GSM Shop
GSM-Forum  

Welcome to the GSM-Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features.
Only registered members may post questions, contact other members or search our database of over 8 million posts.

Registration is fast, simple and absolutely free so please - Click to REGISTER!

If you have any problems with the registration process or your account login, please contact contact us .

Go Back   GSM-Forum > GSM & CDMA Phones / Tablets Software & Hardware Area > Android based Phones / Tablets


Android based Phones / Tablets For all of your questions relating to the android mobile phones.

Closed Thread
 
LinkBack Thread Tools Display Modes
Old 06-24-2013, 17:41   #1 (permalink)
Super Moderator
 
Join Date: Jul 2008
Location: Villa del rosario/Nsd Colombia
Posts: 3,605
Member: 813309
Status: Offline
Thanks Meter: 1,912
[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: 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:
Code:
mkdir systemapp
For Unix Command Line:
Code:
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:
Code:
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...
Code:
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:
Code:
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 '/'
 
The Following 8 Users Say Thank You to Braycel For This Useful Post:
Show/Hide list of the thanked
Closed Thread

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


 



All times are GMT +1. The time now is 19:07.



Powered by Searchlight © 2024 Axivo Inc.
vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
- GSM Hosting Ltd. - 1999-2023 -
Page generated in 0.13363 seconds with 8 queries

SEO by vBSEO