yashsingh1/xdaforums huggingface dataset:
[G1 Android Development] RichieDaze:
I thought that android_bootable_recovery / updater / install.c holds the majority of the commands for edify.

RegisterFunction("mount", MountFn);
RegisterFunction("is_mounted", IsMountedFn);
RegisterFunction("unmount", UnmountFn);
RegisterFunction("format", FormatFn);
RegisterFunction("show_progress", ShowProgressFn);
RegisterFunction("set_progress", SetProgressFn);
RegisterFunction("delete", DeleteFn);
RegisterFunction("delete_recursive", DeleteFn);
RegisterFunction("package_extract_dir", PackageExtractDirFn);
RegisterFunction("package_extract_file", PackageExtractFileFn);
RegisterFunction("symlink", SymlinkFn);
RegisterFunction("set_perm", SetPermFn);
RegisterFunction("set_perm_recursive", SetPermFn);

RegisterFunction("getprop", GetPropFn);
RegisterFunction("file_getprop", FileGetPropFn);
RegisterFunction("write_raw_image", WriteRawImageFn);

RegisterFunction("apply_patch", ApplyPatchFn);
RegisterFunction("apply_patch_check", ApplyPatchCheckFn);
RegisterFunction("apply_patch_space", ApplyPatchSpaceFn);

RegisterFunction("read_file", ReadFileFn);
RegisterFunction("sha1_check", Sha1CheckFn);

RegisterFunction("ui_print", UIPrintFn);

RegisterFunction("run_program", RunProgramFn);

While vendor extended commands come from device / htc / common / recovery_updater.c

RegisterFunction("htc.install_radio", UpdateFn);
RegisterFunction("htc.install_hboot", UpdateFn);
[G1 Android Development] ezterry:
For the custom vendor functions to be included the build tree must have 'librecovery_updater_htc' in both TARGET_RECOVERY_UPDATER_LIBS and PRODUCT_PACKAGES (as of Gingerbread)

Without this the librecovery_updater.htc.a library will not be statically linked to updater (aka updater-binary) and thus you will not be able to flash the radio or hboot using that version of updater-binary. This is easy to inadvertently do on many open source rom builds since we are not usually building the rom with a radio included; and all the other functions will work as expected.

The code in question however is part of the update.zip not part of recovery.. Thus the recovery being used on the phone need not worry about the options mentioned.
[G1 Android Development] furrelkt:
Hello guru's, needing some help. What is the correct syntax for updater-script to set the system font to something i like.. DroidSans-Bold.ttf

Thanks for any help someone can provide. :D

Keri
[G1 Android Development] Droidzone:
Interesting stuff..

Does anybody have a working if else construct in their updater script?

Sent from my Desire running Supernova Extreme - Gingerbread goodness with Unlimited Internal memory
[G1 Android Development] Droidzone:
It has nothing to do with updater script

Sent from my Desire running Supernova Extreme - Gingerbread goodness with Unlimited Internal memory
[G1 Android Development] RichieDaze:
SuperWipe script shows some examples.
[G1 Android Development] Droidzone:
Excellent! Thanks a lot!

Sent from my Desire running Supernova Extreme - Gingerbread goodness with Unlimited Internal memory
[G1 Android Development] kyle77680:
error statut 6

I've got an error :(

My updater-script

is it an syntax error ?

thanks
[G1 Android Development] Droidzone:
It's a long script. You've either missed a closing marker (bracket or ; ), or edited the eol character wrongly in a non-supported editor (use Notepad+ in unix mode)
[G1 Android Development] kyle77680:
thanks :)

what's a closing marker ?

I've ever edited the eol in UNIX :( with notepad ++

thanks
[G1 Android Development] Droidzone:
Closing tag: Bracket and Semicolon

Use Notepad+ in Unix mode. You cant use Notepad
[G1 Android Development] kyle77680:
thanks

i'll see ;)
[G1 Android Development] KhanSW:
Status 6

Sorry ahead of time, I am still learning as I go and have searched everywhere but still can't figure out where I am going wrong here. I am using Notepad+ with EOL formatting set to Unix so I only get "LF" instead of "CR"+"LF" but I still keep getting the following error:

Can someone check over my script and tell me whats wrong? My thanks in advance for any help given as its hard to learn when you can't tell what exactly is causing the problem :)

My updater-script

ui_print(" ");
ui_print(" ");
show_progress(0.1, 30);
ui_print(">>>> Mounting Partitions ");
run_program("/sbin/busybox", "mount", "/system");
ui_print("");
show_progress(0.5, 30);
ui_print(">>>> Applying Theme ");
package_extract_dir("system", "/system");
ui_print("");
show_progress(0.8, 30);
ui_print(">>>> Unmounting Partitions ");
unmount("/system");
ui_print("");
ui_print(">>>> Almost Done ");
ui_print("");
show_progress(1.0, 10);
ui_print(">>>> Theme sucessfully applied ");
run_program("/sbin/busybox", "cp", "/tmp/recovery.log", "/sdcard/recovery.log");
run_program('/sbin/sleep", "6");

I don't know if it makes a difference but when I save my script, I'm saving it as "updater-script" with "All types (*.*)" as file type. Please help this newb out :)
[G1 Android Development] Droidzone:
Instead of posting the script, upload it to dropbox and put up a link here..I'll take a look tomorrow (if noone else have been able to help till then)..Too late today 2:40am..got to sleep :)

Edit: YOU SAVE IT AS WHAT?

Sorry abt shouting..but it's updater-script, not installer-script!
[G1 Android Development] AndDiSa:
Not sure, but might be also a problem with the "update-binary". Either an incompatible command, or update-binary for a different cpu, or ...

I've found some days ago an update.zip for the latest gapps which caused the same error message, but I didn't analyze the reason.
[G1 Android Development] arunmcops:
If i have to change few pngs in framework-res.apk/res/drawable/hdpi what should be the syntax ?
[G1 Android Development] Droidzone:
There is no direct updater-script command for that. You have to devise bash scripts for that, and run them from updater-script
[G1 Android Development] arunmcops:
Can u please quote some examples? That would be very helpful.
[G1 Android Development] Droidzone:
Pls remind me later.. Testing out my rom now..
[G1 Android Development] pumpeduse1973:
i hope somebody can help me to solve my problem.

when i flash my custom rom(made with dsixda-Android-Kitchen) i get the error using clockwordmod recovery

assert failed:write_raw_image("/tmp/boot.img", "boot") error in sd card etc.(status 7)

I have this error in cwm log

no mtd partition named "boot"

Any help please..
[G1 Android Development] RichieDaze:
package_extract_dir("system", "/system");

make sure that you have the files in the right directory!

framework-res.apk should be in the zip, in a directory called system/framework

I never seen a device that does not have a boot partition.:confused: Can you post that code block related to this error.
[G1 Android Development] ezterry:
My tab is lacking any MTD partitions;

It just has an internal MMC card with ext4 file systems and raw data for recovery/boot (ie: dd is used to write to the boot partition of the mmc device.)
[G1 Android Development] Actura:
hello, i need your help :)

i want to create an update.zip that contains additional tweak inside system directory, so i'm trying to create the update-script

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

when i'm trying to flash it, i got an error said "syntax error"

but when i check it by using dsixda kitchen, it doesn't say any error on my update-script

and my recovery is clockworkmod 2

sorry for my bad english :p
[G1 Android Development] Droidzone:
Guys, does anyone know the Linux equivalent of this command:

It seems to be a binary patch. I'd like to patch the file via linux.
[G1 Android Development] gee one:
As far as I can tell, there are two kinds of patches bsdiff40 files and imgdiff files. The imgdiff files are a little tricker.

I've been using the apply_patch executable in the recovery git. Of course this means that I have to run it on my tablet or other android system, but I wrote some scripts so that I don't have to apply it to the running system. I also run the updater-script through grep, sed, and cut to generate the sh scripts to run.

Now if someone can figure out how to cross-compile the executable, we could run it under linux.

sent from my cyanogen(mod) vision
[G1 Android Development] Droidzone:
I've tried bsdiff itself, but dont know where to specify the additional argument.

I could try to cross compile the sources. The source is within the AOSP code, right? I never figured how to compile update-binary alone..
[G1 Android Development] gee one:
My dev box is tied up at the moment, but if I recall correctly, you can just make the apply patch part in the android_bootable_recovery of the aosp. I think the command is something like mm apply_patch or maybe mm android_bootable_recovery (whatever the branch is called)

Here is the thread- I attached the source and binary in post 3

http://xdaforums.com/showthread.php?t=1286731
[G1 Android Development] royal-kingzzz:
Hey guy , a question :

what the mining of all the orange numbeur !?

:confused:

soorry for my bad english
[G1 Android Development] joedeuce:
You have to add that line between where /data is mounted and where it is unmounted... Look for where the dalvik cache is deleted... It happens while /data is mounted.
[G1 Android Development] joedeuce:
Lmao... Poots post was in February.
[G1 Android Development] ghost45:
Is Possible to sign one file .zip

How?

I try several progs but i don't understant why not run!

I'm very glad if some one tell me the steps!

Thanks in advance!

:good:
[G1 Android Development] Ricky Divjakovski:
check the script for "(" that doesnt have a closing brackett or for an extra "," or "."

Error status 6 in due to an unexpected end of script.

---------- Post added at 05:29 PM ---------- Previous post was at 05:28 PM ----------

download a zip thats already signed but dont extract it, that will keep the signature.
[G1 Android Development] ZduneX25:
Can you guys poin what can be wrong?

updater-script:

7f605fb1ce39fd77abce324621a22e829ca31843 - sha1 of the new file (after update)

600d6e70204d78fe1e2ff9854ae655915ed443ca- sha1 of the old file (before update)

3498 - size of the new file (after update)

recovery_log:
[G1 Android Development] gee one:
Check your syntax, I think it is apply_patch [target sha1] [target size] [source sha1]:[patch file] ... or something like that. Note the colon between source sha1 and the patch file.

Edit: syntax might be dependant on where your apply_patch binary comes from.

sent while running with scissors
[G1 Android Development] ZduneX25:
I typed bsdiff new old patch instead of bsdiff old new patch, now it works like a charm.
[G1 Android Development] sirocyl:
I've been seeing some posting activity and got a few PMs in reply to this thread, so I guess I should say something.

Just a notice:

It's been forever since I wrote this guide. It was originally for the recovery system used by the HTC Dream (G1) and Android versions from Beta, RC to Donut, and custom recovery systems based upon those.

I think this was indeed posted around when Froyo wasn't out yet and was still being speculated on.

Ever since new things (proprietary systems, edify, AROMA, and more) have proliferated, this guide has been less and less useful.

I'm considering this guide DEPRECATED now.

You'll find a better guide for making update.zip files by demkantor, in the XDA University board at

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

You can find a description of Edify update-script commands at:

http://xdaforums.com/wiki/Edify_script_language

I'll be happy to answer your questions, and I'm glad you all found this topic useful.

Soon, I will be working on a new recovery UI based around the AROMA system by amarullz.

I no longer have the G1 anymore; my current Android devices are a Nook HD+, HTC DesireZ/G2, Galaxy Nexus (Toro), Nook Simple Touch, and a Motorola MoroACTV.
[G1 Android Development] RichieDaze:
Throw back

I remember that day like it was yesterday...
[G1 Android Development] Firerat:
you need a space after ,

e.g.

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

package_extract_dir("data", "/data");
[G1 Android Development] animefans:
Thanks

I might have the space in my original code, but since I make too many changes, I don't know what I did before

Will try out the space after comma!
[G1 Android Development] animefans:
It still does not copy files to data partition

Here's my updater-script content

assert(getprop("ro.product.device") == "trout" || getprop("ro.build.product") == "trout" || getprop("ro.product.board") == "trout" ||
getprop("ro.product.device") == "sapphire" || getprop("ro.build.product") == "sapphire" || getprop("ro.product.board") == "sapphire");
ui_print("Installing KK Mod");
mount("MTD", "system", "/system");
show_progress(0.500000, 40);
package_extract_dir("system", "/system");
set_perm_recursive(0, 2000, 0755, 0750, "/system/etc/init.d");
unmount("/system");
mount("MTD", "data", "/data");
package_extract_dir("data", "/data");
set_perm_recursive(0, 0, 0755, 0755, "/data/local/bin");
unmount("/data");
show_progress(0.200000, 10);
ui_print("Install complete!");
unmount("/system");

and my zip content

Archive: mymod.zip
Length Date Time Name
-------- ---- ---- ----
570 02-28-08 18:33 META-INF/MANIFEST.MF
623 02-28-08 18:33 META-INF/CERT.SF
1714 02-28-08 18:33 META-INF/CERT.RSA
630 06-03-10 12:41 META-INF/com/google/android/kk
255904 04-29-10 21:19 META-INF/com/google/android/update-binary
721 06-03-10 12:42 META-INF/com/google/android/updater-script
797652 05-04-10 12:35 data/local/bin/busybox.bin
935 04-30-10 12:05 system/etc/init.d/15gpu_perms
586 06-02-10 16:53 system/etc/init.d/25swap
-------- -------
1059335 9 files
[G1 Android Development] leonnib4:
Hi,

I would like to know how do you wrote those scripts with function-like syntax?

I think is has to be compiled, but how?

For now I'm using the syntax used in the first post, but would like to print some text while applying.

thx
[G1 Android Development] fastludeh22:
Pls do...

edit: figured out the problem i was having was with wordpad. used notepad++ and my edits worked. but pls id love to learn more of this new style, so pls go on.
[G1 Android Development] leonnib4:
Simple question: when using the updater script the binary is always the same?

EDIT:

Answer: YES

-------------------------------------

Sent via the XDA Tapatalk App
[G1 Android Development] soulbkd:
I'm new to ROM modding, and this guidance is a great knowledge to start with. Thanks :)
[G1 Android Development] Daneshm90:
I spent a little time to create this batch script. For now it allows you to place any file inside a specified folder and tell the script where u want it to go, script creates the update-script and packages and signs a update.zip. Let me know wht u guys think n ill pursue it further to add a lot more functionality.

Link

Instructions:

Extract zip, create a folder inside "placehere" and inside it put the files u want to use. Now just run the script.

For example, if i want swype to go to /data/app

Id create a folder lets say, putswype

Place swype.apk inside tht folder

Now run script, select option 1

First input id type DATA

Second input id type app

Third input id type putswype

Then id select create update.zip

Then you should find a update.zip in the main folder that is flash ready.

Done.
[G1 Android Development] leonnib4:
Could you please write another topic on the updateR-script syntax please?

:D would be nice
[G1 Android Development] Artifex14:
The way to copy file over data partition is :

assert(getprop("ro.product.device") == "trout" || getprop("ro.build.product") == "trout" || getprop("ro.product.board") == "trout" ||

getprop("ro.product.device") == "sapphire" || getprop("ro.build.product") == "sapphire" || getprop("ro.product.board") == "sapphire");

ui_print("Installing KK Mod");

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

show_progress(0.500000, 40);

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

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

unmount("/system");

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

package_extract_dir("data", "/data");

set_perm_recursive(0, 0, 0755, 0755, "/data/local/bin");

unmount("/userdata");

show_progress(0.200000, 10);

ui_print("Install complete!");

unmount("/system");
[G1 Android Development] Android-Jeck:
how can I delete APK from /data/app with the update script?
[G1 Android Development] Firerat:
you could just read the OP and the comments instead of repeating a question that has already been answered.
[G1 Android Development] Daneshm90:
Are u a windows user if so i want u to try something im working on. let me know.
[G1 Android Development] Android-Jeck:
Sorry, I've read through this thread and found nothing ... if I was ignored, a link to it would be nice

"delete /data/app/*APK*" doesn´t work for me
[G1 Android Development] Android-Jeck:
Yes, I am Windows user. If it solves my problem, I like to try out
[G1 Android Development] Daneshm90:
Cool k try this n let me know wht u think.

Link
[G1 Android Development] Android-Jeck:
Just to make sure:

I grab my in Apps "placehere" and click script.bat?
[G1 Android Development] Daneshm90:
Yup, heres a video i had made. However this was lot earlier but still applies.

[YOUTUBE]<object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/EAtIfW081Jc&hl=en_US&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/EAtIfW081Jc&hl=en_US&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object>[/YOUTUBE]
[G1 Android Development] Android-Jeck:
Nice work, but I tried to create an update script with it, but after I've entered the name of the app I want to delete nothing happens ...
[G1 Android Development] Daneshm90:
K come on here. I'll help u faster there.

Link
[G1 Android Development] Android-Jeck:
Sorry, but I have to go to bed...it´s 1 AM in Germany...

I try tomorrow again, maybe I´m too tired:o
[G1 Android Development] Daneshm90:
Ah i see. Cool, anyway ill test out my script some more. Hit me up when u're free. L8r.
[G1 Android Development] ImGeneralZod:
Hello Artifex14,

I did this suggestion (thanks for posting this btw) and it will install some of my APK's. However only one of the programs does not force close when opened. Also, some of my APK's don't install. Any suggestions are appreciated?

Thanks :)
[G1 Android Development] han.azuki:
guys I have been trying to create an update.zip to erase apps/wallpapers i don't need and to install programs (voicesearch.apk, adw.launcher, etc).i took the update.zip found here and edited the update-script, as well as adding the apks into data/app and system/app. but nothing happens afterwards, i only get superuser permission. i signed the file after finishing. what do i need to do?

Please help I am using I9000.

here is my update-script:

show_progress 0.100000 0

show_progress 0.500000 0

delete SYSTEM:bin/su

delete SYSTEM:xbin/su

delete SYSTEM:app/aldiko-standard-1.2.6.1-samsung-s1.apk

delete SYSTEM:app/BuddiesNow.apk

delete SYSTEM:app/BuddiesNow.odex

delete SYSTEM:app/Days.apk

delete SYSTEM:app/Days.odex

delete SYSTEM:app/DualClock.apk

delete SYSTEM:app/DualClock.odex

delete SYSTEM:app/Email.apk

delete SYSTEM:app/Email.odex

delete SYSTEM:app/FMRadio.apk

delete SYSTEM:app/FMRadio.odex

delete SYSTEM:app/InfoAlarm.apk

delete SYSTEM:app/InfoAlarm.odex

delete SYSTEM:app/JobManager.apk

delete SYSTEM:app/JobManager.odex

delete SYSTEM:app/Layar-samsung.apk

delete SYSTEM:app/MagicSmokeWallpapers.apk

delete SYSTEM:app/MagicSmokeWallpapers.odex

delete SYSTEM:app/MiniDiary.apk

delete SYSTEM:app/MiniDiary.odex

delete SYSTEM:app/SamsungWidget_CalendarClock.apk

delete SYSTEM:app/SamsungWidget_CalendarClock.odex

delete SYSTEM:app/SamsungWidget_FeedAndUpdate.apk

delete SYSTEM:app/SamsungWidget_FeedAndUpdate.odex

delete SYSTEM:app/SamsungWidget_ProgramMonitor.apk

delete SYSTEM:app/SamsungWidget_ProgramMonitor.odex

delete SYSTEM:app/SamsungWidget_StockClock.apk

delete SYSTEM:app/SamsungWidget_StockClock.odex

delete SYSTEM:app/SamsungWidget_WeatherClock.apk

delete SYSTEM:app/SamsungWidget_WeatherClock.odex

delete SYSTEM:app/TATLiveWallpapersAurora.apk

delete SYSTEM:app/TATLiveWallpapersAurora.odex

delete SYSTEM:app/TATLiveWallpapersBlueSea.apk

delete SYSTEM:app/TATLiveWallpapersBlueSea.odex

delete SYSTEM:app/TATLiveWallpapersDandelion.apk

delete SYSTEM:app/TATLiveWallpapersDandelion.odex

delete SYSTEM:app/thinkdroid.apk

delete SYSTEM:app/UnifiedInbox.apk

delete SYSTEM:app/UnifiedInbox.odex

delete SYSTEM:app/VisualizationWallpapers.apk

delete SYSTEM:app/VisualizationWallpapers.odex

delete SYSTEM:app/WriteandGo.apk

delete SYSTEM:app/WriteandGo.odex

copy_dir PACKAGE:system SYSTEM:

copy_dir PACKAGE:data DATA:

symlink ../xbin/su SYSTEM:bin/su

set_perm 0 0 06755 SYSTEM:xbin/su

set_perm 0 2000 0755 SYSTEM:xbin/busybox

show_progress 0.100000 10

here is my updater-script

assert(getprop("ro.product.device") == "GT-I5800" ||

getprop("ro.build.product") == "GT-I5800" ||

getprop("ro.product.device") == "GT-I9000" ||

getprop("ro.build.product") == "GT-I9000"

);

show_progress(0.100000, 0);

show_progress(0.500000, 0);

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

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

symlink("../xbin/su", "/system/bin/su");

set_perm(0, 0, 06755, "/system/xbin/su");

set_perm(0, 0, 0777, "/system/xbin/busybox");

unmount("/system");
[G1 Android Development] FusionX:
Any idea why syntax error?

If anyone could help me figure out why this has a syntax error i would be appreciative. I'm certain it's something obvious.

show_progress 0.1 0

delete DATA:app/com.fede.launcher.apk

delete SYSTEM:app/Facebook.apk

copy_dir PACKAGE:data DATA:

show_progress 0.1 10​
[G1 Android Development] watanuo:
Thanks for your code.

But I want to ask, if a want the apk files in data floder can be auto-installed, how should I write the updater-script?

Just so is ok?

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

package_extract_dir("data", "/data");

set_perm(1000, 1000, 0771, "/data/app");

show_progress(0.200000, 10);
[G1 Android Development] Android-Jeck:
I found a solution to delete apps and files from a ROM with the updater-script.

if you want to delete from /system/...try this (this works fine for me):

...

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

show_progress(1, 15);

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

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

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

delete("/system/etc/CHANGELOG-CM.txt");

delete("/system/bin/backuptool.sh");

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

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

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

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

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

delete("/system/app/com.amazon.mp3.apk");

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

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

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

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

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

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

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

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

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

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

ui_print("Installation complete!");

unmount("/system");

if you want to delete from /data/... try this (I´ve not tested yet):

...

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

package_extract_dir("data", "/data");

set_perm(1000, 1000, 0771, "/data/app");

delete(/data/.../...");

...

unmount("/data");
[G1 Android Development] Android-Jeck:
I think that works...

You just have to create the folder "/data/" and and the folder "/data/app/" if you want to push apk there.
[G1 Android Development] watanuo:
thx, I have done it.

But... the apk is not install from /data/app floder....

Who could help me?:confused:
[G1 Android Development] watanuo:
Thanks，that has worked!