yashsingh1/xdaforums huggingface dataset:
[Android Software Development] de_annere:
Thanks for this great tutorial!

I tried to flash a new framework-res.apk, but always get

"E:Syntax error in update script"

This is my update-script:

I also tried it with

delete SYSTEM:framework/framework-res.apk

before line 2, line 3 or line 4.

Here is the directory of my update-script:

update.zip\META-INF\com\google\android

And here for my framework-res.apk:

update.zip\system\framework

What am I doing wrong?

(Htc Hero, newest AmonRa-Recovery)

Thanks for your help!
[Android Software Development] ThyMaster:
I've done it exactly this way but how should the update-script look like then?

The one from the example update_ringtones.zip won't work...

- ThyMaster
[Android Software Development] dkdude36:
what would you do in update script for a boot animation in /system/customize/resource??? i dont know what to write in the set perm line. plz help.
[Android Software Development] dkdude36:
Ok i have another problem. I tried to flash an apk to data app, but it didn't work. The text went by too fast to see what my recovery said happened (anybody know how to get this info?) and the app simply wasn't installed. Then, I checked the package itself in Astro, and all the directories had some sort of file in them that had something in the name to do with Mac or osx or something. I am working on a Mac.please help. It will save me hours of reinstalling after wipes. Thanks
[Android Software Development] kangi26:
Flashing a Dialer?

Could you give a little guidance on what the update-script might look like to install a dialer?
[Android Software Development] dateno1:
i want to make rom install script

i try this source

ui_print("format SYSTEM");

format("MTD", "system");

mount("MTD", "system", "/system");

show_progress(0.100000, 0);

ui_print("flash SYSTEM");

write_raw_image("PACKAGE:system.img", "system"

unmount("/system");

show_progress(0.100000, 0);

ui_print("format DATA");

format("MTD", "data");

mount("MTD", "userdata", "/data");

show_progress(0.100000, 0);

ui_print("flash DATA");

write_raw_image("PACKAGE:data.img", "data"

unmount("/data");

show_progress(0.100000, 0);

ui_print("format CACHE");

format CACHE:

show_progress(0.100000, 0);

ui_print("patch 1.11");

package_extract_file("system/bin/mot_boot_mode", "/system/bin/mot_boot_mode");

set_perm_recursive 0 2000 0755 0755 SYSTEM:bin

show_progress(0.100000, 0);

ui_print("Thank you, now you can Reboot!!");

but i get just a error (-4) (i knew it is update-script or binary error)

i got a updater from clockworkmod for my device's version (it works well)
[Android Software Development] dateno1:
even i try only the

ui_print("format CACHE");

format CACHE:

show_progress(0.100000, 0);

but get same error :(
[Android Software Development] Rivertamer:
Thanks for this thread......great having folks like you when you are a noob and still learning all this stuff.....gotta love this hobby.!!!!
[Android Software Development] yatindroid:
Download AndroidSigner work auto

http://www.4shared.com/file/V-xV2MvN/AndroidSigner.html
[Android Software Development] blaksheep:
Fantastic tutorial. Thanks for posting this. I have been looking for info on how to package these.
[Android Software Development] NicholasQ:
With gingerbread, it seems we need an update-binary. Can you explain how to make that?
[Android Software Development] Michealtbh:
How can I write a script to remove an app, before installing a new one?

*edit; nevermind, got it sorted :)
[Android Software Development] zolah:
WOW,

thanks for this.

I have just extracted apps from one theme and flashed them onto the theme im currently using and it worked great.

Good stuff
[Android Software Development] lucas.scott:
Thanks so much man . really came in handy .
[Android Software Development] Janis:
copy_dir PACKAGE:framework SYSTEM:framework

show_progress 0.1 0
copy_dir PACKAGE:system SYSTEM:
show_progress 0.1 10

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

Why do I keep getting:

E:Syntax error in update script
installation aborted

Does it matter which text editor you use? I'm using WordPad (7) since I've had pretty good luck with it not messing with things. I've stolen all of these from other mods that have worked, or right from here. None of them work for me now. I'm just trying to replace framework-res.apk.

(the file works if I copy it manually)

Thanks ahead!

EDIT: OK this worked:

show_progress 0.1 0
copy_dir PACKAGE:system SYSTEM:
show_progress 0.1 10

I got it from here (flash.zip):

http://xdaforums.com/showthread.php?t=954281

The difference is that I copied the whole file using 7zip for both archives. (I opened both in 7zip and dragged & dropped the whole file from flash.zip to my.zip, which was already signed). I think the text file format matters.

When in doubt, kill the civillians too? Looks to me like this one throws a blanket and relies entirely on the file structure, where the other update-scripts were trying to be more specific. Am I off on this?

Can anyone point me to a place that defines what this code does, a list of what can go in update-script & why & syntax, yada, yada... you know, mega-detail. It helps me figure out what I'm doing wrong when I know for sure exactly what I'm doing.
[Android Software Development] dean_fx:
Great thread.

Thanks for the help! :D
[Android Software Development] zolah:
This doesnt work for gingerbread any more.

Does anyone know how to make a flashable zip for gingerbread?
[Android Software Development] propsia:
update for GINGERBREAD it's not working
[Android Software Development] hyun18:
Please make one fo rigngerbread.......
[Android Software Development] cj chitwood:
Adding +1 to the requests for Gingerbread. I am following what I've seen elsewhere for how to sign an apk (which I've also read should be the same method for doing an update.zip, which is what I'm trying to do). I've gotten it signed, but the recovery keeps saying "No signature (172 files) Verification Failed". Is it a gingerbread thing, or is there some trick to it? I followed the directions on ANDROID.COM, so I would think they'd be correct, but I still get this error.

AmonRA 1.7.0 on an HTC Dream running COS-DS

Trying to make an update.zip that has special ringtones because for whatever reason when I install an update even without wiping my custom ringtones get wiped and even if I just modify his ROM not to wipe ringtones I still need to figure out the signing part.

But I have other aspirations which still require this knowledge, so many thanks in advance for any help...
[Android Software Development] Gene Poole:
I don't know about AmonRa recovery, but unless you somehow have manufacturer's private key or have added your public key to the keylist for all your target devices (neither of these are remotely likely) then it won't be able to verify your signature. Just turn signature checking off.
[Android Software Development] cj chitwood:
I don't have an option in AmonRA to disable sigchecking, but that's never been a problem with rom updates and patches and such... So, when Roalex or Cyanogen or EZTerry or any of a slew of others release their update.zips, are they not signing with their own private keys?
[Android Software Development] Gene Poole:
Most ROM cookers just use the test key supplied with the kitchen. I don't bother signing my ROMs; it's useless.

There're like 5 different ways to sign a file using x509. Like I said, I don't know about AmonRa, but clockwork recovery checks for only one method and only one key, the test key that most kitchens use and the one supplied by the SDK and android source code. It's a key anyone can get and use and is therefore useless at conveying any kind of signature information at all.

I'm curious though. I downloaded an AmonRa recovery from here and extracted the ramdisk and I can't find any keys or certs of any kind within the image so I wonder what the sig check is even using for keys.
[Android Software Development] DooMLoRD:
u guys can actually refer to this thread i made...

[How-To] Create update.zip flashable via recovery

it has links to a few examples for amend & edify syntax

hope it helps!
[Android Software Development] cj chitwood:
Thanks.

I *think* I already understood basically how to sign. I was thrown off by the recovery saying that my zip wasn't signed when in fact it was, just not with testkeys. What I didn't get before was that apparently everyone's using testkeys -- just like you do in the script -- or a recovery that can disable signature checking. But, seeing the script will help me make sure that if/when I sign with testkeys I'll get the command right.

I don't expect to put anything on the Market -- at least no time soon -- so using testkeys probably is about the only option for me if I want to provide my zips (ever) on the forums.

Thanks again...
[Android Software Development] famonaco:
hi all, can i make it using linux???

if yes how to do???

thx in advance
[Android Software Development] cj chitwood:
If you're using Linux, I assume you're smart enough to figure out the details as long as you have the basic roadmap, yes?

The procedure is essentially the same, you're just using different tools.

You make the same files in the same locations, zip them up using your favourite package manager, then (apparently optionally) sign it using Java. You'll still need a Java SDK installed, and I saw somewhere that using the GNU Java tools is either not going to work or will need modification. Since "Real" Java from Sun (Oracle) is available in Linux, I would use that collection instead of the GNU one for this case.

Then the commands are the same, because you're still using Java to run the Signapk.jar app, with the same command-line-arguments (because Java is platform-independent).

If you need more details, let us know. But what I did to get mine to work is I had to sign with Testkeys, so google that as well.

HIH, let us know if it doesn't...
[Android Software Development] lingfude:
Hi,

I have a chinese phone "Ciphone A9" with Android 2.2.1 but the original ROM of this phone has a GPS speed bug, but I fix this bug on my phone and added a new language support for Portuguese (Portugal).

Now I want take the original update.zip of my phone and replace the old apks with the new apks and update some applications like Maps, Gmail, etc.

I tried make this but when I apply the new update.zip it stops with the message "Installation aborted" with no error code.

Can anyone help me with this?

Thanks,

LF
[Android Software Development] DooMLoRD:
can u post/upload ur current update.zip?
[Android Software Development] lingfude:
Hi DooMLoRD,

Thank you for your help.

Later I will upload my update.zip and post the link for you.

LF
[Android Software Development] lingfude:
Hi DooMLoRD,

Here they are the links to download updates.

Original Update: www.mediafire.com/file/z6ays72l98cmace/orig_update.zip

Modified Update: www.mediafire.com/file/od21y2wdy4tngp9/my_update.zip

I hope you can find out what's wrong in my update.zip and can help me to fix it.
[Android Software Development] Mikekelso421:
so i created an update zip for framework-res and after it flashed successfully,there is no changes whatsoever...any idea why it didnt apply the changes??
[Android Software Development] cj chitwood:
Without seeing it we can only guess. If it flashed successfully, and didn't have errors, and nothing changed, I'd say that either your files aren't as you expect or maybe there's a script running that's changing the files on the phone e.g. on first boot.

But then again, that's just a guess. :)
[Android Software Development] idephili:
Hi,

just 2 questions:

Is it generally possible to create a folder structure like system\framework\framework-res\res\drawable-hdpi in order to replace only some single files? Or "ends" structure at a specific *.apk-file?

Do I need a special update.zip for sensation 2.3.3 or will it work with Update-Apps-signed.zip from post #1?

Greets

idephili
[Android Software Development] kawaiiDango:
hey, if i already have a flashable zip and if i modify/ delete some of the files with winzip, do i need to sign it again?
[Android Software Development] DooMLoRD:
no need to resign...
[Android Software Development] prboy1969:
Thank you. Just what I needed.
[Android Software Development] AndroidGraphix:
Wow. I've been waiting for good instructions on this topic. Thanks
[Android Software Development] CallMeLaNN:
daktah,

I always found updater-script instead of update-script and I read somewhere told that updater-script require update-binary and we need to use updater-script for Gingerbread.

How you can confirm this info?

How to generate update-binary file?

Does the different on update & updater (file name) as well as the syntax inside is depend on Recovery type?

I am using 4ExtRecovery it based on CWM.
[Android Software Development] japseye:
Titanium Pro has a function to create an update.zip of itself. This has never worked for me. I have Desire CM7 Android 2.35. If I unzip this file there is updater-script and update-binary in the android folder. I removed these and substituted with this posts method and now it works fine.
[Android Software Development] taaviu:
Its to easy, to be true :)

But IT WORKS :)

Thanks.
[Android Software Development] thegob:
Thank you! That was easy!
[Android Software Development] dyetheskin:
this is script for installing fast charge,sdcache size,removing some unwanted apps and installing my copy of rom manager since every build likes to install the free version of it. the recovery tells me something about update-binary but a guide i read about an update zip doesnt require nor make this. what am i doing wrong?

ui_print("Extracting 94fastcharge...");

set_progress(1.000000);

mount("MTD", "system", "/system");

package_extract_dir("system", "/system");

set_perm(0, 0, 0755, "/system/etc/init.d/94fastcharge");

ui_print("Done!");

ui_print("Extracting SDmod...");

mount("MTD", "system", "/system");

package_extract_dir("system", "/system");

set_perm_recursive(0, 2000, 0755, 0750, "/system/etc/init.d");

set_perm(0, 0, 0755, "/system/etc/init.d");

set_perm(0, 0, 0777, "/system/etc/init.d/77sdcardspeedfix");

unmount("/system");

ui_print("Done!");

ui_print("");ui_print("Removing ****...");

run_program("/sbin/busybox", "mount", "/system");

package_extract_dir("system", "/system");

delete("/system/app/adwlauncher.apk");

delete("/system/app/email.apk");

delete("/system/app/filemanager.apk");

delete("/system/app/gallery3d.apk");

delete("/system/app/RomManager.apk");

run_program("/sbin/busybox", "umount", "/system");

show_progress 0.1 0

copy_dir PACKAGE:system SYSTEM:

set_perm_recursive 0 0 0755 0644 SYSTEM:app

show_progress 0.1 10[/QUOTE]
[Android Software Development] Gene Poole:
(I added [code][/code] tags around your code to make this more readable. Please do this in the future).

This is an "edify" type script except for the old style code marked in red. I don't think you can mix the two.

If you're using "edify" you definitely need the update-binary. There are a ton of them floating around so it's hard to know if you have one that will support all the commands. I usually try to get on from one of the latest stock OTA updates or from the latest CM build.
[Android Software Development] dyetheskin:
how about an edify command for copying over rommanager from zip into /system/app?
[Android Software Development] Gene Poole:
package_extract_dir("system", "/system");

That will copy everything in the zip in subdir "system" to the /system/ partition. Just have at least "system/app/MyRomManager.apk" in the zip.
[Android Software Development] bengals1975:
I took the sample file in the OP, added a system/app/SystemUI.apk folder/file, zipped it into a zip I called usaf_update.zip. Then I signed it with androidsigner and ended up with usaf_update_signed.zip which I moved to my phone to flash in CWM recovery. It didn't work, I got a "installation aborted" message. any ideas? I took the script and all from the OP and didn't change it at all.
[Android Software Development] Gene Poole:
Perhaps your recovery doesn't support the older "amend" scripts and only the newer "edify" scripts.
[Android Software Development] bengals1975:
Perhaps, I used an updater-script I had from a different update and it worked fine.

I have the latest clockworkmod recovery, I thought it did both??

Sent from my CM7 Incredible
[Android Software Development] Gene Poole:
No. Actually the opposite. Older "amend" recoveries would work with both because "edify" scripts actually include a "update-binary" which parses the script commands instead of the internal parser. Later "edify" recoveries have no built-in parser so they MUST have an "update-binary" to do the parsing.
[Android Software Development] bengals1975:
Interesting, thanks for the little education!
[Android Software Development] Actura:
hello guys, i have a problem :(

show_progress 0.1 0
copy_dir PACKAGE:system SYSTEM:
set_perm 0 0 0755 SYSTEM:etc/install-recovery.sh
show_progress 0.1 10

i'm trying to flash it on clockworkmod 2 and got error said "Syntax error in update-script" :confused:

could you help me ?? :)

thank you :D
[Android Software Development] Junnie:
nice to try this out,thanks :D
[Android Software Development] Gene Poole:
Newer recoveries only support "edify" scripts, not "amend" scripts. I covered this just a few posts upthread from this.
[Android Software Development] hb5:
I would like to add one line to build.prop file in system(debug.sf.hw=1), my phone is S-on so I can't do it directly with File expert. How can I make .zip file with which I could update build.prop directly from recovery? Thank you!
[Android Software Development] dyetheskin:
just add it to the system folder,if you don't have it then create and don't forget the commands in updater-script
[Android Software Development] hb5:
I added that line and now I have final build.prop file. Now I would only need to make .zip file so I can flash it from recovery. I can't do it directly from the ROM because I am S-on. Can you be more specific how I have to do it? I am beginner.
[Android Software Development] dyetheskin:
can't be done with s on as far as I know.others can correct me if I'm wrong. need s off to use cwm in order to flash your own updates
[Android Software Development] hb5:
But I can flash new kernel and custom ROM. Phone is rooted.
[Android Software Development] dyetheskin:
in that case learn partition/folder structure with a file explorer with root access. take someone's package and learn commands from their updater script. learn how to properly sign and most importantly use notepad++ so you're text editing in unix and not windows
[Android Software Development] DooMLoRD:
check my thread:

http://xdaforums.com/showthread.php?t=1246402

download the zip provided there...

and study the updater-script and then check the other script which i call
[Android Software Development] hb5:
Thank you guys!

@DooMLoRD

Is it necessary to have S-off to modify build.prop, for instance with Root Explorer, after all?
[Android Software Development] DooMLoRD:
sorry i dont know much abt that
[Android Software Development] hb5:
Ok, not a problem. Thank you for your input, I will try to study your work and try to do it myself.
[Android Software Development] Johnsondr80:
Just thought you guys would like to know.

http://xdaforums.com/showthread.php?p=19322266

[Utility-Tool][DEVandThemers]CWMflashpack.zipCreatorV1{TheCollective}w/EdifyScripting

Just sharing
[Android Software Development] dyetheskin:
great find
[Android Software Development] 10arecare:
some roms have /system/media/
[Android Software Development] dyetheskin:
and some are /data/system/theme/......best to use root access and learn/note folder structure
[Android Software Development] P00t:
that is my code to update a app in a rom.

i flashed it but it didnt apply. can anyone help me?

i have the apk in the zip file; system/app
[Android Software Development] Johnsondr80:
Package extract system /system

With all the ("", "");

:)
[Android Software Development] P00t:
EDIT: got it working! thanks!
[Android Software Development] x10minilover:
any one make a structure for modifying framework-res.apk file pls.....newbie here...
[Android Software Development] eep2378:
Is this the same process when creating a CWM flashable zip?
[Android Software Development] agent205:
ui_print("Begin");

show_progress(1.000000, 0);

ui_print(" Extracting the launcher ");
package_extract_dir("system", "/system");
set_perm(0, 0, 0644, "/system/app/Launcher2.apk");

ui_print("End !");
set_progress(1.000000);

is it the right code ???

myfolders :

system/app/Launcher2.apk

META-INF/com/google/android/updater-script

please help anyone :D
[Android Software Development] Gene Poole:
Looks OK, but you need a "META-INF/com/google/android/updater-binary" with edify scripts. Grab one from a CM7 update.zip if you can't find one.
[Android Software Development] neoxx3m:
so useful,thanks.:)
[Android Software Development] vijai2011:
I am extremely noob to all these things.I read all the posts and got confused with "amend" and "edify".I even don't know what are those.I have uploaded my update.zip.can any one check the file and say is it correct?I have cwm 5 and iam in galnet MIUI.If there is some mistakes please correct it as soon as possible.Thanks

P.S.Or can i use the update-binary and updater-script from the file included?i.e META-INF.rar
[Android Software Development] Gene Poole:
"amend" and "edify" are just the names given to two different (but similar) scripting languages. CWM Recovery uses a command interpreter to parse and execute the commands in the script to do its formatting, installation, etc. Early CWM versions had built-in support for the "amend" scripting language. This was sufficient for most common scripting tasks and all you needed was a "update-script" to do your installing tasks. Later, "edify" came on the scene which is more powerful and can handle many more tasks, but because it was not part of CWM recovery, you also needed the binary file containing the command interpreter (update-binary) as well as the script (but the script was called "updater-script" to distinguish it from older "amend" scripts). I believe current versions of CWM recovery have removed the "amend" interpreter altogether so that only "edify" scripting can be used on later devices.

The main problem with "edify" is that it requires a separate binary interpreter. Because of this, there are hundreds of copies floating around with varying degrees of support for the "edify" commands. It is always a good idea to get the latest version available for the platform you intend to use. I get mine from the latest CyanogenMod source tree, but this is basically the same version that you'll find in the installer package for "CM nightlies".

Edit:

I looked at your package. It is "amend" only and probably won't work on the latest versions of CWM recovery. Your RAR file looks like it has the correct files (where did it come from?). I didn't actually look at the scripts.
[Android Software Development] vijai2011:
First of all thanks for clearing my doubts.I took the META-INF folder of sgs2 reader's hub and archived it.But I found that it din't work.In cwm it said installed successfully but no changes where made in system folders.So instead I downloaded gapps from CM and deleted lib,res and etc(not sure) and edited updater-script(as it has script to delete some system apps).Then added my apps to app folder zipped it and signed it.It works now!!!!!!!

Can you help me in one more thing?How do i edit the script to copy the contents of a folder(not app) to different location in sdcard?
[Android Software Development] agent205:
so the "updater-binary" is random ?

or for 1 file each ?

still confuse over here :D
[Android Software Development] zx34:
Thanks for a very useful thread..... :)

Sent from HTC Sensation, Elegancia ROM Series....
[Android Software Development] timvdhoorn:
when i try to flash i got an error that i can only flash in android 1.5?