[Updated: 04/June/2011] [How-To] Create update.zip flashable via recovery

Search This thread

DooMLoRD

Inactive Recognized Developer
Jul 27, 2010
13,187
39,710
Pune
Hey everyone just thought that this info might be useful to the this community...
this info is already available, though in parts, over XDA forums.. so i thought that i will try n make it easily available/understandable to all users here...


seems this info is useful to other android users too... so will try and post generic as well as X10 specific info...


WARNING:
  • I AM NOT RESPONSIBLE FOR THE FILES THAT U CREATE USING THIS INFO
  • I AM NOT RESPONSIBLE IF U LOOSE UR DATA WHEN TRYING THIS OUT
  • REMEMBER THIS DEALS WITH SYSTEM MODIFICATIONS AND ANY WRONG COMMAND CAN RENDER UR CURRENT ROM UNUSABLE/BROKEN
  • SO BE SURE U CAN USE FLASHTOOL TO FLASH STOCK FW IF U END UP WITH UNUSABLE/BROKEN SYSTEM
  • DO NOT CIRCULATE THE UPDATE.ZIPs CREATED UNLESS U ARE CERTAIN THAT THEY WORK PROPERLY
  • ALSO DO NOT FLASH ANY RANDOM UPDATE.ZIP WHICH U DOWNLOAD UNLESS U CHECK OUT THE CODE WRITTEN IN THE UPDATE SCRIPT




now that i have scared u enough ;) lets begin...



[BASICS]

there are two versions of update scripts (codes/syntax) which can be used:
  • Amend (update-script)
  • Edify (updater-script) [along with update-binary]

both of the above mentioned versions use different syntax...

both of these versions work on the recoveries currently available for x10 (xRecovery & FreeXperia Recovery)

ONLY EDIFY SYNTAX IS SUPPORTED BY xRecovery v1.0.0 (latest recovery for X10)

these files can be found in "\META-INF\com\google\android" of the zip package... depending on which file update-script OR updater-script is present in the update.zip u will understand which update scripts (codes/syntax) is to be used...



[SYNTAX | READING MATERIAL]

following are very useful guides which cover most of the available syntax...



[PROGRAM | APPLICATION]

now that u follow the differences lets get the program to make update.zips and sign them...

Update.zip 2.0 Modifier/Creator by Daneshm90
its a windows only tool and i personally use it regularly to make update.zips

read through that post as it is pretty straight forward on how the application works... there is even a video... and it even signs the zip...

this program basically handles (modifies/creates) only Amend (update-script) but u can just place ur modified updater-script (along with the update-binary) in <ROOT_DIR_OF_PROGRAM>\placehere\META-INF\com\google\android\
and execute update.bat to make the update.zip package.... this program automatically signs the zip so u wont have any errors while flashing...




[ EXAMPLES ]

Amend scripts (update-script)
list of functions that can be used in Edify scripts and explanations about them by nubecoder



[ CONVERTORS ]

update-script to edify script converter by Chumby_666 (a.k.a. aZuZu)
amend2edify script converter by nubecoder



[ADDITIONAL INFO]

i will keep adding more to this as and when i get time...

till then happy reading the links posted here...

also if u have any queries/doubts feel free to post them here...



[BEST OF LUCK]
 
Last edited:

Nikhil_007

Senior Member
Oct 13, 2009
76
3
mumbai
thats wonderful...

Hi Doomlord,

thats a wonderful work..i mean thats a perfect explanation of creating update.zips...
another alternative, which i use frequently to update apps in system forlder only is..
go to titanium back up options and create update.zip
now select this update.zip from mounted SD card and then open it with 7zip or any zip editor.
then replace system/app forlder ->app to any app u want to install in system..
save and close the file. and u r good to go...
just an alternative which i personally found easy...but nothing to take away from your awsum thread here..keep the good work..thanks..
 

DooMLoRD

Inactive Recognized Developer
Jul 27, 2010
13,187
39,710
Pune
Hi Doomlord,

thats a wonderful work..i mean thats a perfect explanation of creating update.zips...
another alternative, which i use frequently to update apps in system forlder only is..
go to titanium back up options and create update.zip
now select this update.zip from mounted SD card and then open it with 7zip or any zip editor.
then replace system/app forlder ->app to any app u want to install in system..
save and close the file. and u r good to go...
just an alternative which i personally found easy...but nothing to take away from your awsum thread here..keep the good work..thanks..

ah thats a nice idea to do it on the device itself!

u can even add specific files which need to be placed on other partitions (SYSTEM / DATA / SDCARD) when flashing it from recovery... though u will have to edit update-script for the recovery to copy those files..
 
  • Like
Reactions: solomon4400

Mister J

Senior Member
Mar 6, 2011
583
131
Root Explorer:

1. Long press on folder you want to zip

2. Select Compress into .zip

3. Wham, Bam, thank you Ma'am!

Use META Wipe Data for flashing ROMS

Use META No Data Wipe for flashing Updates, themes, etc.
 
  • Like
Reactions: rex4u and glim9981

RaDi

Senior Member
Aug 8, 2010
558
100
thank you DooMLoRD for this great topic and for all your usffull comment around X10 dev forum .

but i have a qustion :D :

i am beginner in cooking roms but i want to ask you how to use FreeX10 Froyo by Z to built a full froyo rom ?

and what i can do with X10_2.2_Froyo_sources.tar.bz2


thanks alot
 

DooMLoRD

Inactive Recognized Developer
Jul 27, 2010
13,187
39,710
Pune
thank you DooMLoRD for this great topic and for all your usffull comment around X10 dev forum .

but i have a qustion :D :

i am beginner in cooking roms but i want to ask you how to use FreeX10 Froyo by Z to built a full froyo rom ?

and what i can do with X10_2.2_Froyo_sources.tar.bz2


thanks alot


hi! thank you!

i am sorry but even i dont know how to build a rom from sources... wht most chefs do is just mix files from various roms, using FreeX10 as base and then adding content from other roms (of other devices)
 
  • Like
Reactions: RaDi

RaDi

Senior Member
Aug 8, 2010
558
100
thank you DooMLoRD :)

ok great , but i need to know what is the important files should copy from Freex10 to other roms ?

thanx man
 
E

EdgarCupari

Guest
have found a other methode for make a update.zip fast and easier!!

hi..
I have found a other methode for make a update.zip fast and easier!!

You can downloading a update.zip, whatever you want ... for example;
you downloaded update3.zip. open it with 7zip

in update3.zip> (you have 3 folders> data, META-INF, system)
is missing you as a path,
for example, because you want to update an audio fix .. can you just move the lib folder in System Folder.

if you want to update system apps, you can move the desired app in the System folder> app
framework-res> in system> framwork
the META-INF file from update3.zip should always be maintained.

It is important that you choose a update.zip,! Since the directories and systemlinks / already been set with the open-mentioned program are correct!

can not explain it better .. this method saves me a lot of time and is, I think the easiest way.

greeting edgar......
 

DooMLoRD

Inactive Recognized Developer
Jul 27, 2010
13,187
39,710
Pune
hi..
I have found a other methode for make a update.zip fast and easier!!

You can downloading a update.zip, whatever you want ... for example;
you downloaded update3.zip. open it with 7zip

in update3.zip> (you have 3 folders> data, META-INF, system)
is missing you as a path,
for example, because you want to update an audio fix .. can you just move the lib folder in System Folder.

if you want to update system apps, you can move the desired app in the System folder> app
framework-res> in system> framwork
the META-INF file from update3.zip should always be maintained.

It is important that you choose a update.zip,! Since the directories and systemlinks / already been set with the open-mentioned program are correct!

can not explain it better .. this method saves me a lot of time and is, I think the easiest way.

greeting edgar......

so u dont believe in setting permissions in the update.zip is it?

the most important thing is that u READ the update-script / updater-script PROPERLY before using any update.zip... and modify it for ur needs...
 

j.anderson618

Senior Member
Feb 22, 2011
253
42
Create it in mnt since its a rootfs set perms rxrxrx Meta then set your perms 4 w.e else I'd getzipsigner 2 to make sure its right..

Sent from my X10a using XDA App
 

DooMLoRD

Inactive Recognized Developer
Jul 27, 2010
13,187
39,710
Pune
EXAMPLE FOR AMEND SCRIPTS (update-script)

from my experience (for X10 users only):
Edify scripts (updater-script) support copying to /tmp but Amend scripts (update-script) doesnt allow such a location... it only allows for SYSTEM, DATA, CACHE
the Edify scripts (updater-script) doesnt always work properly on our current recovery... better stick to Amend scripts (update-script)...
any programs that u want to run (which doesnt require additional files) place it at the root of ur packege
any programs that u want to run (which require additional files) place it at the /data/local/tmp folder of ur packege

Additional: http://xdaforums.com/showpost.php?p=5776278&postcount=3

(generic info for all androids)

format:
Code:
format SYSTEM:
format DATA:
format CACHE:

copy package:
Code:
copy_dir PACKAGE:system SYSTEM:
copy_dir PACKAGE:data DATA:
copy_dir PACKAGE:cache CACHE:

set permissions:
Code:
set_perm_recursive 0 0 0755 0644 SYSTEM:
set_perm_recursive 0 2000 0755 0755 SYSTEM:bin
set_perm 0 0 04755 SYSTEM:bin/su
set_perm 0 0 0755 SYSTEM:etc/dhcpcd/dhcpcd-run-hooks
...
.
.
..

busybox installation:
Code:
run_program PACKAGE:installbusybox

installbusybox:
Code:
#!/system/bin/sh
cd /system/bin
/system/bin/chmod 755 busybox
./busybox --install -s /system/bin
OR
Code:
#!/system/bin/sh
cd /system/bin
/system/bin/chmod 755 busybox
./busybox --install -s /system/xbin

running any other program/shell script:
Code:
run_program PACKAGE:mycustomshellscript.sh
OR
Code:
copy_dir PACKAGE:data DATA:
set_perm 0 0 777 DATA:local/tmp/mycustomshellscript.sh
run_program DATA:local/tmp/mycustomshellscript.sh
OR
-[ i have not tested the following but might work ]-
Code:
copy_dir PACKAGE:tmp TMP:
set_perm 0 0 777 TMP:mycustomshellscript.sh
run_program TMP:mycustomshellscript.sh


contents of mycustomshellscript.sh:
Code:
#!/sbin/sh
<commands u want to execute>




using update.zip for app installation :

place the app (appname.apk) in <rootdir>\app\

if u want to "install" an app as system app then
Code:
copy_dir PACKAGE:app SYSTEM:app
else if u want it as a user app then
Code:
copy_dir PACKAGE:app DATA:app



for modules:

place the module (modulename.ko) in <rootdir>\system\lib\modules

Code:
copy_dir PACKAGE:system SYSTEM:
set_perm 0 0 0644 SYSTEM:lib/modules/modulename.ko



for modified chargemon (Xperia Android users only):

place the modified chargemon script in <rootdir>\system\bin
Code:
copy_dir PACKAGE:system SYSTEM:
set_perm 0 0 04755 SYSTEM:bin/chargemon
set_perm 0 0 04755 SYSTEM:bin/charger




for copying files to SDCARD:

place the files u want to copy to sdcard in: <rootdir>\sdcard\
for copying GScript scripts: place the .sh files in: <rootdir>\sdcard\gscript\
Code:
copy_dir PACKAGE:sdcard SDCARD:
 
Last edited:
  • Like
Reactions: civicvx94 and rex4u

Mortyx10

Senior Member
Nov 19, 2010
181
32
Auckland
Hi doom thanks for this great tutorial...Im trying to learn these thing so I tried to make an update.zip to install astro as system app
using Daneshm90 tool here is what I did but didnt work...

first copied the directories to the placehere folder:like this=>> placehere/system/app/astro.apk

then chose the forst option: creat update-script
then 1. copy directories
what partition to place files in?: system
what folder within that partition?: app
what folder from this update.zip within placehere folder?: app

then I chose 6. set permissiions for file
what partition is the file located in?: system
what file within that partition?: app/astro.apk
UID ?: (I had no Idea what this is so I entered chmod number 644)
GID ?: (again have no idea so just pressed enter and skiped)
MODE ?: (same as above)

then 8.done

and 2.create update.zip

and obviously didnt work
could you please help me?
Thanks
 

realunited123

Senior Member
Jun 23, 2010
1,167
200
Bhubaneswar
Hi doom thanks for this great tutorial...Im trying to learn these thing so I tried to make an update.zip to install astro as system app
using Daneshm90 tool here is what I did but didnt work...

first copied the directories to the placehere folder:like this=>> placehere/system/app/astro.apk

then chose the forst option: creat update-script
then 1. copy directories
what partition to place files in?: system
what folder within that partition?: app
what folder from this update.zip within placehere folder?: app

then I chose 6. set permissiions for file
what partition is the file located in?: system
what file within that partition?: app/astro.apk
UID ?: (I had no Idea what this is so I entered chmod number 644)
GID ?: (again have no idea so just pressed enter and skiped)
MODE ?: (same as above)

then 8.done

and 2.create update.zip

and obviously didnt work
could you please help me?
Thanks

If you are just copying a file then do this. Create a folder "app" and place the apk inside it.

And use only this line in update-script to copy it to /system/app

Code:
copy_dir PACKAGE:app SYSTEM:app

I know it is not "ideal" but works for me and saves me some time. ( i am one of the most laziest persons you will ever meet) :p
 

Mortyx10

Senior Member
Nov 19, 2010
181
32
Auckland
Hi thanks for the reply
I just did it and its a no go for me
Cant mount system/app
error in line 1 or something like this
 

DooMLoRD

Inactive Recognized Developer
Jul 27, 2010
13,187
39,710
Pune
Hi doom thanks for this great tutorial...Im trying to learn these thing so I tried to make an update.zip to install astro as system app
using Daneshm90 tool here is what I did but didnt work...

first copied the directories to the placehere folder:like this=>> placehere/system/app/astro.apk

then chose the forst option: creat update-script
then 1. copy directories
what partition to place files in?: system
what folder within that partition?: app
what folder from this update.zip within placehere folder?: app

then I chose 6. set permissiions for file
what partition is the file located in?: system
what file within that partition?: app/astro.apk
UID ?: (I had no Idea what this is so I entered chmod number 644)
GID ?: (again have no idea so just pressed enter and skiped)
MODE ?: (same as above)

then 8.done

and 2.create update.zip

and obviously didnt work
could you please help me?
Thanks

actually i just use the update.zip creator to "pack" & sign the files...

once u have the files in place... just go to...
placehere\META-INF\com\google\android
and edit the update-script

if u have app in:
placehere\system\app\astro.apk

u just need
Code:
copy_dir PACKAGE:system SYSTEM:

once u finish editing the file

just run Script.bat
enter: n (do not clean previous files)
enter: 2 (create update.zip)

thats it!

a new file update.zip will be created in root folder of the program
 
Last edited:

Mortyx10

Senior Member
Nov 19, 2010
181
32
Auckland
@realunited no I don't do it manually

@Doom well dont know why but still not working....same error in recovery...cant mount system line1

Dont I need to set permissions cuz its in system?

Sent from my X10 TripNMiUI using XDA App
 

Top Liked Posts

  • There are no posts matching your filters.
  • 29
    Hey everyone just thought that this info might be useful to the this community...
    this info is already available, though in parts, over XDA forums.. so i thought that i will try n make it easily available/understandable to all users here...


    seems this info is useful to other android users too... so will try and post generic as well as X10 specific info...


    WARNING:
    • I AM NOT RESPONSIBLE FOR THE FILES THAT U CREATE USING THIS INFO
    • I AM NOT RESPONSIBLE IF U LOOSE UR DATA WHEN TRYING THIS OUT
    • REMEMBER THIS DEALS WITH SYSTEM MODIFICATIONS AND ANY WRONG COMMAND CAN RENDER UR CURRENT ROM UNUSABLE/BROKEN
    • SO BE SURE U CAN USE FLASHTOOL TO FLASH STOCK FW IF U END UP WITH UNUSABLE/BROKEN SYSTEM
    • DO NOT CIRCULATE THE UPDATE.ZIPs CREATED UNLESS U ARE CERTAIN THAT THEY WORK PROPERLY
    • ALSO DO NOT FLASH ANY RANDOM UPDATE.ZIP WHICH U DOWNLOAD UNLESS U CHECK OUT THE CODE WRITTEN IN THE UPDATE SCRIPT




    now that i have scared u enough ;) lets begin...



    [BASICS]

    there are two versions of update scripts (codes/syntax) which can be used:
    • Amend (update-script)
    • Edify (updater-script) [along with update-binary]

    both of the above mentioned versions use different syntax...

    both of these versions work on the recoveries currently available for x10 (xRecovery & FreeXperia Recovery)

    ONLY EDIFY SYNTAX IS SUPPORTED BY xRecovery v1.0.0 (latest recovery for X10)

    these files can be found in "\META-INF\com\google\android" of the zip package... depending on which file update-script OR updater-script is present in the update.zip u will understand which update scripts (codes/syntax) is to be used...



    [SYNTAX | READING MATERIAL]

    following are very useful guides which cover most of the available syntax...



    [PROGRAM | APPLICATION]

    now that u follow the differences lets get the program to make update.zips and sign them...

    Update.zip 2.0 Modifier/Creator by Daneshm90
    its a windows only tool and i personally use it regularly to make update.zips

    read through that post as it is pretty straight forward on how the application works... there is even a video... and it even signs the zip...

    this program basically handles (modifies/creates) only Amend (update-script) but u can just place ur modified updater-script (along with the update-binary) in <ROOT_DIR_OF_PROGRAM>\placehere\META-INF\com\google\android\
    and execute update.bat to make the update.zip package.... this program automatically signs the zip so u wont have any errors while flashing...




    [ EXAMPLES ]

    Amend scripts (update-script)
    list of functions that can be used in Edify scripts and explanations about them by nubecoder



    [ CONVERTORS ]

    update-script to edify script converter by Chumby_666 (a.k.a. aZuZu)
    amend2edify script converter by nubecoder



    [ADDITIONAL INFO]

    i will keep adding more to this as and when i get time...

    till then happy reading the links posted here...

    also if u have any queries/doubts feel free to post them here...



    [BEST OF LUCK]
    2
    Root Explorer:

    1. Long press on folder you want to zip

    2. Select Compress into .zip

    3. Wham, Bam, thank you Ma'am!

    Use META Wipe Data for flashing ROMS

    Use META No Data Wipe for flashing Updates, themes, etc.
    2
    EXAMPLE FOR AMEND SCRIPTS (update-script)

    from my experience (for X10 users only):
    Edify scripts (updater-script) support copying to /tmp but Amend scripts (update-script) doesnt allow such a location... it only allows for SYSTEM, DATA, CACHE
    the Edify scripts (updater-script) doesnt always work properly on our current recovery... better stick to Amend scripts (update-script)...
    any programs that u want to run (which doesnt require additional files) place it at the root of ur packege
    any programs that u want to run (which require additional files) place it at the /data/local/tmp folder of ur packege

    Additional: http://xdaforums.com/showpost.php?p=5776278&postcount=3

    (generic info for all androids)

    format:
    Code:
    format SYSTEM:
    format DATA:
    format CACHE:

    copy package:
    Code:
    copy_dir PACKAGE:system SYSTEM:
    copy_dir PACKAGE:data DATA:
    copy_dir PACKAGE:cache CACHE:

    set permissions:
    Code:
    set_perm_recursive 0 0 0755 0644 SYSTEM:
    set_perm_recursive 0 2000 0755 0755 SYSTEM:bin
    set_perm 0 0 04755 SYSTEM:bin/su
    set_perm 0 0 0755 SYSTEM:etc/dhcpcd/dhcpcd-run-hooks
    ...
    .
    .
    ..

    busybox installation:
    Code:
    run_program PACKAGE:installbusybox

    installbusybox:
    Code:
    #!/system/bin/sh
    cd /system/bin
    /system/bin/chmod 755 busybox
    ./busybox --install -s /system/bin
    OR
    Code:
    #!/system/bin/sh
    cd /system/bin
    /system/bin/chmod 755 busybox
    ./busybox --install -s /system/xbin

    running any other program/shell script:
    Code:
    run_program PACKAGE:mycustomshellscript.sh
    OR
    Code:
    copy_dir PACKAGE:data DATA:
    set_perm 0 0 777 DATA:local/tmp/mycustomshellscript.sh
    run_program DATA:local/tmp/mycustomshellscript.sh
    OR
    -[ i have not tested the following but might work ]-
    Code:
    copy_dir PACKAGE:tmp TMP:
    set_perm 0 0 777 TMP:mycustomshellscript.sh
    run_program TMP:mycustomshellscript.sh


    contents of mycustomshellscript.sh:
    Code:
    #!/sbin/sh
    <commands u want to execute>




    using update.zip for app installation :

    place the app (appname.apk) in <rootdir>\app\

    if u want to "install" an app as system app then
    Code:
    copy_dir PACKAGE:app SYSTEM:app
    else if u want it as a user app then
    Code:
    copy_dir PACKAGE:app DATA:app



    for modules:

    place the module (modulename.ko) in <rootdir>\system\lib\modules

    Code:
    copy_dir PACKAGE:system SYSTEM:
    set_perm 0 0 0644 SYSTEM:lib/modules/modulename.ko



    for modified chargemon (Xperia Android users only):

    place the modified chargemon script in <rootdir>\system\bin
    Code:
    copy_dir PACKAGE:system SYSTEM:
    set_perm 0 0 04755 SYSTEM:bin/chargemon
    set_perm 0 0 04755 SYSTEM:bin/charger




    for copying files to SDCARD:

    place the files u want to copy to sdcard in: <rootdir>\sdcard\
    for copying GScript scripts: place the .sh files in: <rootdir>\sdcard\gscript\
    Code:
    copy_dir PACKAGE:sdcard SDCARD:
    1
    Usefull information. There is update zip for ubuntu?
    1
    Hi Doomlord,

    thats a wonderful work..i mean thats a perfect explanation of creating update.zips...
    another alternative, which i use frequently to update apps in system forlder only is..
    go to titanium back up options and create update.zip
    now select this update.zip from mounted SD card and then open it with 7zip or any zip editor.
    then replace system/app forlder ->app to any app u want to install in system..
    save and close the file. and u r good to go...
    just an alternative which i personally found easy...but nothing to take away from your awsum thread here..keep the good work..thanks..

    ah thats a nice idea to do it on the device itself!

    u can even add specific files which need to be placed on other partitions (SYSTEM / DATA / SDCARD) when flashing it from recovery... though u will have to edit update-script for the recovery to copy those files..