yashsingh1/xdaforums huggingface dataset:
[Android General] Primokorn:
You're welcome.

It's also a pleasure for myself to play with system data without using a 3rd party tool :)

I have no idea how to backup/restore the splash screen. However I only have the line below in the updater-script file of my flashable zip (to replace my splash screen too). There's no line to u•mount partitions:

package_extract_file("logo.bin", "/dev/block/bootdevice/by-name/LOGO");

Maybe putting /dev/block/bootdevice/by-name/LOGO in the addond.d script is enough. I wouldn't play too much with this partition though :)
[Android General] rickysidhu_:
Hey sorry to continually bother you, but I do have one more question if you don't mind! :)

As for the splash screen, I actually ended up taking your advice and stopped playing with that partition, better safe than sorry! :silly:

As for my question, I actually ended up replacing all the font files with my own, and I was wondering, instead of listing each font file in the addon script, is it possible to just do something like:

fonts/

or

fonts/*.ttf

Would that tell the addon script to keep every single font on a dirty flash?

Thanks in advance :) :highfive:
[Android General] Primokorn:
Good question :)

I've never tried so you'll have to dig yourself. I only replace the Roboto-Regular.ttf file.

Please let us know if you find something that works.
[Android General] rickysidhu_:
No worries, I will give it a try the next time I flash. I am just waiting for a new build of the ROM I am on to release, so in the meantime I am just continually working on my flashable zip.

I will update this post to share what does and doesn't work, it's the least I can do to my part in giving back to this community, thanks for this guide once again!!

:)

UPDATE:

adding "fonts/*.ttf did NOT work

However, adding just "fonts/" in the addon script worked like a charm! No need to individually add fonts if you have more than one, and I didn't even set permissions and it still worked! Hope this helps
[Android General] lil_ith:
Hello, thanks for the wonderful guide, i have managed to setup for flashing apps, but i have two questions. 1, if i make it flash google dialer for example, it puts the app into /system/priv-app but it doesn't put it in as a folder containing the app, is there a way to fix that? and the second is if i edit the updater script to debloat, even just slightly editing it, i get error 6 no matter what.
[Android General] Primokorn:
You don't need to put these apks into a dedicated folder.

However you can create /system/priv-app/GoogleDialer/Dialer.apk for example and update your updater-script and addond.d script accordingly.

Probably spaces that should be removed. Save the recovery log next time. It may help.
[Android General] pedro1977:
Im trying to create a script for the LG G5 LOS 14.1 to remove a system file but keep receiving the following error.

Checking for digest file

Skipping digest check: no digest file found.

Update process ended with ERROR 6

Error installing zip file '/sdcard/delnfclgg5.zip

Here is the script

ui_print("+-------------------------------------+");

ui_print("|Removing NFCService from LOS14.1 LG G5|");

ui_print("| |");

ui_print("| by Pedro1977 |");

ui_print("+-------------------------------------+");

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

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

ui_print("***Deleting NFCService***");

delete_recursive("/system/vendor/app/NQNfcNci/NQNfcNci.apk");

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

ui_print("Completed. Ready to Reboot");

I would prefer to just delete the NQNfcNci folder and all its contents.

Zip and logs are attached.

Any help would be appreciated.
[Android General] narshi shukla:
I dont know much but why u have umount before Mount??
[Android General] pedro1977:
Its explained in the first post.
[Android General] Primokorn:
In the recovery.log file there's no reference to your delnfclgg5.zip file.

A few things I noticed in your attached zip:

• 2 semi-colons at the end of updater-script

• Just put this if you want to delete the folder:

delete_recursive(
"/system/vendor/app/NQNfcNci/NQNfcNci.apk"
);

• Be careful on the syntax. The following line doesn't work for example:

delete_recursive(
"/system/vendor/app/NQNfcNci");

• Removed "systemxxxx" folder if you don't want to add system stuff.
[Android General] pedro1977:
I tried adding two semi colons at the end and changing the syntax but I still receive a parsing syntax error at line 1 column 53 in the log. See attached.
[Android General] Primokorn:
You have the same errors in the updater-script. Read again my previous post.

You shouldn't have 2 semi-colors for example. Your syntax of delete_recursive has mistakes.
[Android General] pedro1977:
I tried to flash it with one and two semi colons but neither worked, in fact I didn't even see two semi colons when I went to edit the zip so I must have already updated prior to posting. I have adjusted the delete recursive to the second example in your previous post and this didn't work either. What is actually the syntax error with this and why does the error log refer to line 1 and not the line with delete recursive in it? Can you indicate a good example of my delete recursive line?
[Android General] pedro1977:
In fact no matter what I do with the script it always generates the following error even after deleting out most of the lines. So the error is not within the script itself, it's from something else.

I:Legacy property environment initialized.

line 1 col 51: syntax error, unexpected BAD

1 parse errors

Updater process ended with ERROR: 6

Update: forget this I found another way around. Im sure the Ui print only has "" and not the other symbols in the syntax ();
[Android General] Primokorn:
Did you get it working?
[Android General] pedro1977:
Yup I found a solution thanks
[Android General] nextheart:
I have created a custom flashable zip containing apps, fonts, audio, boot animation. It works perfectly. I need to add busybox in this zip. Can you please guide me? Thank you.
[Android General] Primokorn:
Busybox, the app or the tools? If it's the latter then I'm afraid that I can't help you. It's a more complex process than just adding/removing a file in a folder.
[Android General] nextheart:
Thanks for quick response. I mean Busybox tool. I use it from here. https://xdaforums.com/android/software-hacking/tool-busybox-flashable-archs-t3348543.
[Android General] rickysidhu_:
Hey so I have moved from a OnePlus 5 to a Pixel 2 XL since I last created my flashable zip using this guide, and I'm having trouble getting it to work on my new device.

I have a feeling it has something to do with the dual slot layout; because when I boot back into the system, no files have been changed and there is also no error when flashing the zip in TWRP either.

In the TWRP file manager, there are two locations, for example:

/system/media/ and /system/system/media/

My zip is written for the first way (without the second "system").

I am thinking of trying it the second way, but before doing so, I just wanted to see if anyone else can confirm that will work or if there is a different/correct way of going about this.

Thanks in advance!
[Android General] oF2pks:
EDIT: this is for regular

NON

-A/B System Updates​

[MENTION=4958579]Primokorn[/MENTION] , instead of creating another "zip/edify" thread, I thought more profitable to post here.

-addon.d support for all (addon.d-less) roms like aosp-ota.zip (OxygenOS...):

Attached are "sandwich" zips to flash BEFORE/tmpBackup and AFTER/tmpRestor

every aosp-ota.zip (or others...) in a single twrp session, WITH no reboot between.

They are based on LineageOS 15 specific/powerful "edify" recovery.

Considering that Magisk' flash will feed /system/addon.d/ survival(sh), ONLY if already created, the 3rd 755addonD.zip can be used to initiate /addon.d rep, with included script for etc/host survival.

-update-binary "engine" (included in the 3 zips):

Actually it seems that LineageOS15 update-binary is more powerful (and thus h?armful) than any other, including Omnirom/twrp' : it allows a lot of variations like https://github.com/LineageOS/android_bootable_recovery/blob/lineage-15.1/updater/install.cpp#L1440

and doesn't need busybox for advanced commands.

-microG & hybrid/light Google account:

For microG patched, these PlaystoreOnly/ContactSync and CalendarSync are using addon.d survivals (origin 100% [MENTION=5227588]Deltadroid[/MENTION] ) and thus "live" updated app/permissions will be restored after ota.

If advanced users will prefer [MENTION=4544860]osm0sis[/MENTION] "thunder" , I thought we should point LineageOS' specifics to standard users for boosted edify uses, instead of outdated :

https://source.android.com/devices/tech/ota/nonab/inside_packages

https://xdaforums.com/wiki/Edify_script_language

For developers , LineageOS can also help making advanced auto ota.zip : https://github.com/LineageOS/androi...ls/releasetools/ota_from_target_files.py#L479

Nota : all verified/tested on latest aosp8.1 (sonyxperiadev, 1000xThx [MENTION=359497]jerpelea[/MENTION] )
[Android General] Twisted Prime:
Download links are broken
[Android General] Primokorn:
Yes, sorry. I switched to new Nextcloud servers.

Links updated.
[Android General] lucario94:
Could you share your solution? I'm facing the same problem.

Solved. Error 6 was solved by either:

or update-binary from https://xdaforums.com/galaxy-nexus/themes-apps/tutorial-making-flashable-zips-edify-t1611615
[Android General] HemanthJabalpuri:
[MENTION=4958579]Primokorn[/MENTION]

Sir I think MiXSigner test keys are not verifying succesfully in recoveries when zip signature verification is enabled.....

[MENTION=4544860]osm0sis[/MENTION] sir made a zipsigner-dexed build that is compatible within android...

From that build i made a step by step newbie guide here https://xdaforums.com/showpost.php?p=77483475&postcount=3 ....

It verifies signature in recovery successfully.....

Other alternative is package signer from https://www.dropbox.com/s/7wljrp4rhhk12kj/PackageSigner_1.1.apk?dl=0 to sign below 15mb files

Please add this guide to first post...sir...

To help others like me who don't have pc
[Android General] Primokorn:
Sure, added to OP.
[Android General] Ibuprophen:
I've got a question regarding the editing of the updater-script file within a flashable zip.

After creating a simple flashable zip to place a Bootanimation.zip file...

What can I add to the following that will first copy (or move) the original Bootanimation.zip file to the "/storage/emulated/0/Download" directory?

ui_print("******************");
ui_print("* Bootanimation *");
ui_print("******************");
ui_print("");

show_progress(1.000000, 0);
ui_print("Mounting filesystems...");
run_program("/sbin/busybox", "mount", "/system");
set_progress(0.100000);

ui_print("Extracting files...");
package_extract_dir("system", "/system");
set_progress(0.300000);

ui_print("Setting permissions...");
set_perm(0, 0, 0644, "/system/media/bootanimation.zip");
set_progress(0.400000);
set_progress(0.500000);
set_progress(0.700000);

# Unmounting filesystems...
run_program("/sbin/busybox", "umount", "/system");
set_progress(0.900000);

set_progress(1.000000);
ui_print("******************");
ui_print("* Completed *");
ui_print("******************");

I tried a handful of times and just crapping out big time... LMAO! :eek:

Thanks a bunch! :)

~~~~~~~~~~~~~~~

UNLESS asked to do so, PLEASE don't PM me regarding support. Sent using The ClaRetoX Forum App on my SM-G900V device.
[Android General] oF2pks:
Check tmpbackup.zip in https://xdaforums.com/showpost.php?p=76455910&postcount=56

you need to do it via a script.sh inside your zip + package_extract() this script.sh to /tmp + run_program() this script.sh

always use LineageOS [update-binary] engines: they are much powerful https://github.com/LineageOS/android_bootable_recovery/blob/lineage-15.1/updater/install.cpp#L1440
[Android General] HemanthJabalpuri:
Sorry for newbie thing..

How I can get update-binary with the above link?:rolleyes:
[Android General] oF2pks:
My zips include

arm64

update-binary; it comes included will all los rom zip.

Using latest is important for advanced function like [block_image_update].

[MENTION=4958579]Primokorn[/MENTION] [MENTION=4828250]Ibuprophen[/MENTION] attached is update-binary (zipped with updater-script) from latest

15.1

arm

https://wiki.lineageos.org/devices/find7 , for example: [write_raw_image] was removed from 14.1

[B][U]14.1 [/U][/B]void RegisterInstallFunctions() {
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);

// Usage:
// set_metadata("filename", "key1", "value1", "key2", "value2", ...)
// Example:
// set_metadata("/system/bin/netcfg", "uid", 0, "gid", 3003, "mode", 02750, "selabel", "u:object_r:system_file:s0", "capabilities", 0x0);
RegisterFunction("set_metadata", SetMetadataFn);

// Usage:
// set_metadata_recursive("dirname", "key1", "value1", "key2", "value2", ...)
// Example:
// set_metadata_recursive("/system", "uid", 0, "gid", 0, "fmode", 0644, "dmode", 0755, "selabel", "u:object_r:system_file:s0", "capabilities", 0x0);
RegisterFunction("set_metadata_recursive", SetMetadataFn);

RegisterFunction("getprop", GetPropFn);
RegisterFunction("file_getprop", FileGetPropFn);
[B][U] RegisterFunction("write_raw_image", WriteRawImageFn);[/U][/B]

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

RegisterFunction("wipe_block_device", WipeBlockDeviceFn);

RegisterFunction("read_file", ReadFileFn);
RegisterFunction("sha1_check", Sha1CheckFn);
RegisterFunction("rename", RenameFn);
RegisterFunction("write_value", WriteValueFn);

RegisterFunction("wipe_cache", WipeCacheFn);

RegisterFunction("ui_print", UIPrintFn);

RegisterFunction("run_program", RunProgramFn);

RegisterFunction("reboot_now", RebootNowFn);
RegisterFunction("get_stage", GetStageFn);
RegisterFunction("set_stage", SetStageFn);

RegisterFunction("enable_reboot", EnableRebootFn);
RegisterFunction("tune2fs", Tune2FsFn);
}
[Android General] HemanthJabalpuri:
[MENTION=7489364]oF2pks[/MENTION] [MENTION=4958579]Primokorn[/MENTION]

Sir do you have experience with apktool v4.4 for android Create ROM feature?

If yes I have some doubts..

With that feature we can create the present using ROM as flashable zip without need of symlink and set_metadata commands...

How it is possible without needed commands?

Thanks..

Edit:- also how newer roms set permissions and symlink files without those commands in updater script?
[Android General] Ibuprophen:
[MENTION=7489364]oF2pks[/MENTION], I didn't go that deep as to the Arch of the device... :eek:

For the time being, I'm going to stick with the ARM 32-bit...

I know that the following is incorrect but, I'm not sure as to where/what it needs to be corrected.

The following is just that specific portion of what I had came up with that's added to the updater-script file (after a little research):

ui_print("Copying files...");
package_extract_file("/system/media/bootanimation.zip", "-p", "/storage/emulated/0/Download/bootanimation.zip");
set_progress(0.300000);

ui_print("Setting permissions...");
set_perm(0, 0, 0644, "");
set_progress(0.400000);
set_progress(0.500000);
set_progress(0.700000);

Maybe [MENTION=1143630]osmosis[/MENTION] might be able to provide some additional input as well... :thumbup:

Thanks! :)

~~~~~~~~~~~~~~~

UNLESS asked to do so, PLEASE don't PM me regarding support. Sent using The ClaRetoX Forum App on my SM-G900V device.
[Android General] HemanthJabalpuri:
I think instead of package extract file below should be better

run_program("/sbin/busybox", "cp", "-f", "/system/media/bootanimation.zip", "/sdcard/Download/bootanimation.zip");
[Android General] Ibuprophen:
So the correct updater-script should reflect the following:

ui_print("******************");
ui_print("* Bootanimation *");
ui_print("******************");
ui_print("");

show_progress(1.000000, 0);
ui_print("Mounting filesystems...");
run_program("/sbin/busybox", "mount", "/system");
set_progress(0.100000);

ui_print("Backing up existing bootanimation");
ui_print("to your Download directory");
run_program("/sbin/busybox", "cp", "-f", "/system/media/bootanimation.zip", "/sdcard/Download/bootanimation.zip");
set_progress(0.300000);

ui_print("Extracting files...");
package_extract_dir("system", "/system");
set_progress(0.300000);

ui_print("Setting permissions...");
set_perm(0, 0, 0644, "/system/media/bootanimation.zip");
set_progress(0.400000);
set_progress(0.500000);
set_progress(0.700000);

# Unmounting filesystems...
run_program("/sbin/busybox", "umount", "/system");
set_progress(0.900000);

set_progress(1.000000);
ui_print("******************");
ui_print("* Completed *");
ui_print("******************");

Whereas the script would backup the old bootanimation file prior to replacing it with the new one.

Though, I've created various successful "Basic" flashable zip files, I've recently thought about other things like this that I've never really delved into before.

~~~~~~~~~~~~~~~

UNLESS asked to do so, PLEASE don't PM me regarding support. Sent using The ClaRetoX Forum App on my SM-G900V device.
[Android General] HemanthJabalpuri:
yes

i think you are using always zipme right...?

I can help you sir... since i am also a basic user in updater-script...
[Android General] Ibuprophen:
I've used that and other alternatives depending on what I want to accomplish.

In this case, after a few different alternatives, i did decide to that app since this is a simple task.

I had planned to just add the backup portion to it when I thought about the backup process.

I look at tasks like this using an old saying called KISS (Keep It Simple Stupid)... LMAO! :eek:

I really appreciate your taking the time to help me out with this!

I always try to impress the fact that, no matter how experienced someone is, there's always something to learn to expand on it. :thumbup:

~~~~~~~~~~~~~~~

UNLESS asked to do so, PLEASE don't PM me regarding support. Sent using The ClaRetoX Forum App on my SM-G900V device.
[Android General] HemanthJabalpuri:
sir are you succeeded with the above help?

i.e., to backup the original one?

if not then replace /sdcard with /storage/emulated/0 and try again..
[Android General] HemanthJabalpuri:
[MENTION=4958579]Primokorn[/MENTION]

Now with MiXplorer v6.29.8 onwards we can sign zip files without any error in signature verification and also without separate MiX-Signer addon....

So you can remove my guide in first post or edit as another guide for signing sir....

Thanks..
[Android General] nextheart:
I want to add some user apks (not in system/app or system/priv-app, but at data/app) in flashable zip, where I should put them? Thank you in advance.
[Android General] oF2pks:
Depends on android version; check https://medium.com/@quaful/the-changes-of-apk-install-location-since-android-oreo-e646d1b53c4d

if it's for personal use give a try to zipme and tick option [App+Data], otherwise you can still use it for "prebuilding" and modify the zip to your convenance.

For more infos on apps storage path (and more), check my uploaded app_PackagesInfo attached here https://xdaforums.com/android/software-hacking/dexdump-xodus-trackers-apk-static-t3833391
[Android General] HemanthJabalpuri:
[MENTION=4958579]Primokorn[/MENTION]

Can you please able to make a guide from this thread https://xdaforums.com/android/software-hacking/dev-complete-shell-script-flashable-zip-t2934449 ....

It is useful for people who learned EDIFY and want to tweak more....

Thank you

[MENTION=7489364]oF2pks[/MENTION]

Sir can you please see what is going wrong in my updater-script...

I am using update-binary given by you...

recovery.log also attached
[Android General] oF2pks:
Check post https://xdaforums.com/showpost.php?p=77786681&postcount=65

updater-script/set_perm(... is deprecated and replaced by powerful set_metadata & set_metadata_recursive; when you use an update-binary, you have to use the "related" instructions : https://github.com/LineageOS/android_bootable_recovery/blob/lineage-15.1/updater/install.cpp#L1440
[Android General] Tomatot-:
Hi, I'm trying to make my own script for my OnePlus 6 running oxygenOS.

I didn't understand why my script wasn't working as I tried to carefully follow OP's instructions.

I did several attempts and to save time everytime I directly checked in the TWRP file manager if the folder I wanted to delete was gone or not. That's how I realized, from TWRP, the apps are not located in "system/app" (or s"ystem/priv-app") but they're actually located in "system/system/app" (or system/system/priv-app).

Were you aware of this? Is there a problem with my device or is it a normal "feature"?

My guess is that's it's related to the fact the OP6 uses the A/B partitions thing.

Also, I was wondering, I would like to share with the public my script. I would like people to be able to modify it easily so can I add "#"wherever I want as long as it's a new line.

For example, could my script be this?

ui_print("+-------------------------------------+");
ui_print("| |");
ui_print("| CLEAN FLASH SCRIPT |");
ui_print("| |");
ui_print("| by Tomatot- |");
ui_print("| (thanks to Primokorn) |");
ui_print("| |");
ui_print("+-------------------------------------+");
run_program("/sbin/busybox", "umount", "/system");
run_program("/sbin/busybox", "mount", "/system");
ui_print(" busybox ready ");
ui_print("***Deleting bloatwares***");
delete_recursive(
#This is the Chrome browser
"/system/system/app/Chrome"
);
run_program("/sbin/busybox", "umount", "/data");
run_program("/sbin/busybox", "umount", "/system");
ui_print(" ");
ui_print("Done.");
ui_print(" ");
ui_print("Ready to reboot.");
ui_print(" ");
[Android General] koboi.ngangkang:
excuse me, but why we need 99-dirty.sh? AFAIK, dirty flash means only wipe dalvik and cache ( not system), should any apps still remain in /system/ after dirty flash? I understand the need the remove certain apps and write it in 99-dirty.sh. but why we need to keep app that is still in /system/? or does it mean dirty flash also wipe /system/?

and can you please teach us about your afscript.sh? :D
[Android General] Swagnik:
Hey,

Is it possible to create a removal tool based on this method ( flash able zip to remove unwanted apps) having UI like the Aroma pack of the Open Gapps??

It should have all installed apps !!

If possible!!!!!!!

It would be more like an Custom recovery application manager!!
[Android General] :
Why does it gives error: updater ended with error 6??

Here's My updater Script:

ui_print("+--------GameTools----------+");

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

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

ui_print("***Installing Tools***");

show_progress(8.800000, 5);

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

ui_print("***Fixing permissions***");

set_perm(0, 0, 0644, "/system/app/GameOptimizer.apk");

set_perm(0, 0, 0644, "/system/priv-app/GameTools_Dream.apk");

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

ui_print("Done");

ui_print("Completed.");
[Android General] Iliketech:
[SLOT A/B devices] Universal A/B-cloner

https://xdaforums.com/android/software/slot-b-devices-universal-b-cloner-t3973751