[Android Software/Hacking General [Developers Only]] osm0sis:
Happy February holiday! I've been staying busy, mostly making some major feature updates to AnyKernel3, helping out with Open GApps, and messing around with addon.d-v2 for the last while. Fun has also been ongoing over at Magisk HQ, and still some more to be had. ;)

The big advance in this post is the addition of addon.d-v2 support in FlashAfterUpdate! While booted the output goes to logcat just like my Magisk and TWRP A/B addon.d-v2 scripts. It also supports printing to the recovery UI for the upcoming recovery addon.d-v2 support. I've renamed the script from 99- to 999- to make sure it happens after Magisk for addon.d-v2, so please remove the old one when you update. It should also still catch a running Magisk addon.d (v1) and wait as before so there won't be any conflicts.

Up-to-date AnyKernel3 zips support FlashAfterUpdate addon.d-v2 out-of-the-gate, but it's important to note that for other mod zips, due to the major differences between how addon.d (v1) and addon.d-v2 work only ones that have been specifically updated for FlashAfterUpdate addon.d-v2 will work in an addon.d-v2 A/B OTA update. The way this works is the zip signifying support by adding #FLASHAFTERUPDATEV2 to their updater-script.

For mod creators wanting to add FlashAfterUpdate addon.d-v2 support to their zips, here's what I've noted so far as required:

1) do not attempt to unmount or mount active partitions or modify the global environment while booted

2) upcoming TWRP recovery addon.d-v2 requires /system and /system_root stay mounted

3) addon.d-v2 detection should be based on whether /postinstall/tmp exists, then that may be used instead of /tmp for installation work

4) file mods are restricted to changing things in the system slot as /postinstall (the SAR / directory of the updated slot) mounted through addon.d-v2, and updated vendor slot as /postinstall/vendor mounted through FlashAfterUpdate

5) #FLASHAFTERUPDATEV2 in the updater-script to opt in to the whitelist

I work on these projects in my limited time off, so if you like the progress I'm making, or enjoy anything else I've done on xda, please consider sponsoring my ongoing work using my GitHub Sponsors profile. For a one-time donation you can hit the donate link from my profile. Thanks for your support!

97-dumpbootimage.sh:

- use /postinstall/tmp path to call functions from addon.d-v2 in progress

- auto-detect boot partition location

98-twrp_ab.sh:

- find OUTFD from recovery update_engine for addon.d-v2 output

- fix finding OUTFD on addon.d failure with toybox ps

- use /postinstall/tmp path to call functions from addon.d-v2 in progress

999-flashafterupdate.sh:

- add log output feature (enabled by placing a file named log in FlashAfterUpdate directory)

- fix no files check

- add addon.d-v2 support for supported zips (#FLASHAFTERUPDATEV2 in updater-script)

- fix unzip with toybox

- find OUTFD from recovery update_engine for addon.d-v2 output

- fix finding OUTFD on addon.d failure with toybox ps

- use /postinstall/tmp path to call functions from addon.d-v2 in progress

- mount opposite slot vendor partition to /postinstall/vendor during zip flashes

UPDATE-adb.Installer.v1.0.39-signed.zip;

UPDATE-Adreno.Systemless.Installer-signed.zip;

UPDATE-Busybox.Installer.v1.31.1-ALL-signed.zip;

UPDATE-mtd-utils.Installer.v2.1.1-signed.zip;

UPDATE-Nexus.Media.Installer-signed.zip:

- fix mknod loop mount on newer devices (thanks [MENTION=6037748]Zackptg5[/MENTION])

UPDATE-nano.Terminal.Editor.v4.8-signed.zip:

- rebuild with libncurses 6.1 ARM and generated headers (thanks [MENTION=6037748]Zackptg5[/MENTION])

- fix execution from recovery via modules_update

- fix mknod loop mount on newer devices (thanks [MENTION=6037748]Zackptg5[/MENTION])

- update to latest nano official source

UPDATE-ZipSigner.Installer.v3.0-signed.zip:

- fix dalvikvm invocation for Android 10 (-Xnodex2oat is removed upstream)

- fix mknod loop mount on newer devices (thanks [MENTION=6037748]Zackptg5[/MENTION])

As mentioned above, AnyKernel3 got AVBv1 signing and SAR mount support fixes, plus FlashAfterUpdate addon.d-v2 support, and I updated my N5X-6P_BLOD_Workaround_Injector_Addon-AK3-signed.zip with these changes as well!

Edit

: Just uploaded a new version of 999-flashafterupdate.sh allowing updated vendor slot mods by mounting it to /postinstall/vendor! Guidelines updated above. :cowboy::D