Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,786,281 Members 49,680 Now Online
XDA Developers Android and Mobile Development Forum

[GUIDE] how to make a flashable package (update.zip)

Tip us?
 
daktah
Old
(Last edited by daktah; 23rd July 2010 at 12:01 AM.)
#1  
daktah's Avatar
Senior Member - OP
Thanks Meter 98
Posts: 228
Join Date: Jun 2010
Location: Las Vegas, Nevada
Thumbs up [GUIDE] how to make a flashable package (update.zip)

thanks to this page for teaching me: http://www.robmcghee.com/android/cre...e-zip-package/
note: although i am copying this from the page, this isnt a straight ctrl+c, ctrl+p from it. ive rewritten it with slightly more english. ok alot more.

before we start, grab ppcgeeks auto signer here, or nothing will flash anyway. its the easiest method since its drag, drop, and click.
also i recommend 7-zip but its not necessarily needed.

first step, make the folder structure.
ive included prebuilt updates to make it a little faster for you. they contain no actual files, just the appropriate folder structure and update script. they must be resigned if you add files and expect to flash them.

if what your looking for isnt included, make a folder and name it "workdir". this will contain your work.
this is just to make it easier to organize all your stuff. if you feel so inclined you can name it whatever you want, it doesnt really matter.
next youll need to make folders inside the workdir according to where your flashing stuff, ie if your flashing wallpapers youd need to make a structure that looks like this: "workdir/system/customize/resource"

next to make the update-script. this tells the system what to do.
first make this folder structure: "workdir/META-INF/com/google/android"
make sure you capitalize "META-INF"
now put a text file into the "android" folder and call it "update-script"
the easiest way to code it would be to copy this into it:
Code:
show_progress 0.1 0
copy_dir PACKAGE:(x) (X):
set_perm_recursive 0 0 0755 0644 (X):(y)
show_progress 0.1 10
replace the (x) with the directory in the root your flashing to in lowercase, ie system or data or sdcard.
replace the (X)'s with the same thing as (x) except in UPPERCASE such as SYSTEM or DATA or SDCARD.
replace the (y) with the next directory in lowercase like media or app or customize.
note: if your adding to the root of (X) folder then leave this blank, no spaces or anything.

if your flashing an app it should look something like this:
Code:
show_progress 0.1 0
copy_dir PACKAGE:system SYSTEM:
set_perm_recursive 0 0 0755 0644 SYSTEM:app
show_progress 0.1 10
after youve done that, save and close the file. now you need to take the extension off of the text file. simply delete the .txt at the end of the file.
if there is no extension showing, make sure you have "hide extensions for known file types" unchecked in tools> folder options> "view" tab.

second to last step! compress the workdir contents into a zip file, not the actual workdir though. it should look like this inside the zip: "update.zip/(folders)" not "update.zip/workdir/(folders)"

finally, sign the zip with the auto signer and put it into the root of the sd card.
boot into recovery and flash it up! with a bit of luck, it should work.

if you have any questions, problems, or concerns just post them. i have instant subscription to this thread and will be notified every 30 min when my evo fetches my mail.


Device History
10: HTC One (Black, 64GB) [AT&T]
9: HTC Evo 4G LTE [Sprint]
8-2c: HTC G1 APD1 [Afghan GSMs]
8-2b: HTC Evo View 4G [WiFi]
8-2a: HP Prē [Afghan GSMs]
8-1: HTC Evo 3D (Black, Launch Week) [Sprint]
7: HTC Evo 4G (Black, Launch Week) [Sprint]
6: iPhone 3G[s] (White, Launch Week) [AT&T]
5: iPhone 3G (White, Launch Week) [AT&T]
4: Motorola i830 [Sprint Nextel]
3: Motorola i836 [Sprint Nextel]
2: Motorola i95cl [Sprint Nextel]
1: Motorola B/W flip phone [Sprint Nextel]
The Following 87 Users Say Thank You to daktah For This Useful Post: [ Click to Expand ]
 
rori~
Old
#2  
rori~'s Avatar
Senior Member
Thanks Meter 705
Posts: 3,942
Join Date: Aug 2009
Location: Vienna

 
DONATE TO ME
Thanx for this thread!

Ok, my app should be installed in /system/app/
but is it possible to include in the same (app)update-script: delete /data/app/xxx.apk?
The Following User Says Thank You to rori~ For This Useful Post: [ Click to Expand ]
 
Foxwolfe
Old
#3  
Foxwolfe's Avatar
Member
Thanks Meter 4
Posts: 59
Join Date: Nov 2009
Location: Seattle
What directories do boot animations go into?

Awesome thread and thanks btw.
The Following User Says Thank You to Foxwolfe For This Useful Post: [ Click to Expand ]
 
rori~
Old
#4  
rori~'s Avatar
Senior Member
Thanks Meter 705
Posts: 3,942
Join Date: Aug 2009
Location: Vienna

 
DONATE TO ME
Quote:
Originally Posted by Foxwolfe View Post
What directories do boot animations go into?
/data/local/
 
daktah
Old
#5  
daktah's Avatar
Senior Member - OP
Thanks Meter 98
Posts: 228
Join Date: Jun 2010
Location: Las Vegas, Nevada
Quote:
Originally Posted by rori~ View Post
Ok, my app should be installed in /system/app/
but is it possible to include in the same (app)update-script: delete /data/app/xxx.apk?
honestly, i couldnt tell you for sure but i dont see why you couldnt

Quote:
Originally Posted by Foxwolfe View Post
Awesome thread and thanks btw.
thanks


Device History
10: HTC One (Black, 64GB) [AT&T]
9: HTC Evo 4G LTE [Sprint]
8-2c: HTC G1 APD1 [Afghan GSMs]
8-2b: HTC Evo View 4G [WiFi]
8-2a: HP Prē [Afghan GSMs]
8-1: HTC Evo 3D (Black, Launch Week) [Sprint]
7: HTC Evo 4G (Black, Launch Week) [Sprint]
6: iPhone 3G[s] (White, Launch Week) [AT&T]
5: iPhone 3G (White, Launch Week) [AT&T]
4: Motorola i830 [Sprint Nextel]
3: Motorola i836 [Sprint Nextel]
2: Motorola i95cl [Sprint Nextel]
1: Motorola B/W flip phone [Sprint Nextel]
The Following User Says Thank You to daktah For This Useful Post: [ Click to Expand ]
 
nzdcoy
Old
#6  
Senior Member
Thanks Meter 1
Posts: 165
Join Date: Jul 2010
Location: Auckland
I keep getting a syntax error. I am trying to flash silent.mp3 so i can select that in my notifications, because for some reason it does not have that option :/

can you let me know where I went wrong?

have tried both
set_perm_recursive 0 0 0755 0644 SYSTEM:media
set_perm_recursive 0 0 0755 0644 SYSTEM:notifications
but to no avail
Attached Files
File Type: zip update_signed.zip - [Click for QR Code] (2.4 KB, 429 views)
 
daktah
Old
#7  
daktah's Avatar
Senior Member - OP
Thanks Meter 98
Posts: 228
Join Date: Jun 2010
Location: Las Vegas, Nevada
what was the whole code in the update-script?
did you use the example i posted?

show_progress 0.1 0
copy_dir PACKAGE:system SYSTEM:
set_perm_recursive 0 0 0755 0644 SYSTEM:media
show_progress 0.1 10


Device History
10: HTC One (Black, 64GB) [AT&T]
9: HTC Evo 4G LTE [Sprint]
8-2c: HTC G1 APD1 [Afghan GSMs]
8-2b: HTC Evo View 4G [WiFi]
8-2a: HP Prē [Afghan GSMs]
8-1: HTC Evo 3D (Black, Launch Week) [Sprint]
7: HTC Evo 4G (Black, Launch Week) [Sprint]
6: iPhone 3G[s] (White, Launch Week) [AT&T]
5: iPhone 3G (White, Launch Week) [AT&T]
4: Motorola i830 [Sprint Nextel]
3: Motorola i836 [Sprint Nextel]
2: Motorola i95cl [Sprint Nextel]
1: Motorola B/W flip phone [Sprint Nextel]
 
nzdcoy
Old
#8  
Senior Member
Thanks Meter 1
Posts: 165
Join Date: Jul 2010
Location: Auckland
Quote:
Originally Posted by daktah View Post
what was the whole code in the update-script?
did you use the example i posted?

show_progress 0.1 0
copy_dir PACKAGE:system SYSTEM:
set_perm_recursive 0 0 0755 0644 SYSTEM:media
show_progress 0.1 10
yeah, sorry for not making it clear. Im kinda rote-learning this atm, I did a straight copy of your notifications script into my flashable-zip. when that didnt work I tried it with line3 modified as a stab in the dark.

what does the entire folder structure look like? if I am changing notifications is it /system/media/audio/notification where I put the files?
 
daktah
Old
(Last edited by daktah; 6th August 2010 at 06:28 AM.)
#9  
daktah's Avatar
Senior Member - OP
Thanks Meter 98
Posts: 228
Join Date: Jun 2010
Location: Las Vegas, Nevada
i believe it is
Code:
workdir.zip/
_system/
__media/
___audio/(files).mp3
_META-INF/
__com/
___google/
____android/update-script
if you still cant get it going i can assemble it for you


Device History
10: HTC One (Black, 64GB) [AT&T]
9: HTC Evo 4G LTE [Sprint]
8-2c: HTC G1 APD1 [Afghan GSMs]
8-2b: HTC Evo View 4G [WiFi]
8-2a: HP Prē [Afghan GSMs]
8-1: HTC Evo 3D (Black, Launch Week) [Sprint]
7: HTC Evo 4G (Black, Launch Week) [Sprint]
6: iPhone 3G[s] (White, Launch Week) [AT&T]
5: iPhone 3G (White, Launch Week) [AT&T]
4: Motorola i830 [Sprint Nextel]
3: Motorola i836 [Sprint Nextel]
2: Motorola i95cl [Sprint Nextel]
1: Motorola B/W flip phone [Sprint Nextel]
 
PMDColeslaw
Old
(Last edited by PMDColeslaw; 6th August 2010 at 08:10 PM.)
#10  
PMDColeslaw's Avatar
Senior Member
Thanks Meter 87
Posts: 1,361
Join Date: Dec 2008
Location: Memphis

 
DONATE TO ME
Just wanting to be sure here because Ive read the first post a few times and still can't tell. On the root of the update.zip I am supposed to create the folder structure that I want it to flash too. (ie. media/audio/ringtones) and then place the actual file that im flashing in that directory. (ie media/audio/ringtones/newring.mp3) At this point then the whole .zip dir would look like:

update.zip
__media/
_____audio/
_______ringtones/
__________newring.mp3
__META-INF/
_____com/
_______google/
___________android/
_______________update-script
_____CERT.RSA
_____CERT.SF
_____MANIFEST.MF

Then just sign the .zip and flash it... Is this correct?

Tags
flashable, guide, make, package, update
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes