[OnePlus 3 Guides, News, & Discussion] Deleted member 4405529:
This is a good idea!

Just some notes:

It only works for system-as-root roms (most - if not all - android 10 source build roms), for all other roms (oos and most - if not all - android 9 and below source build roms) you need to replace "system/system" by "system". For my taste it would be easier to use a shell script instead of the edify interpreter. To tell sar roms from non-sar roms you can use something like this:

#!/sbin/sh

OUTPUT=/proc/self/fd/$2;

ui_print() {
until [ ! "$1" ]; do
echo -e "ui_print $1\nui_print" >$OUTPUT;
shift;
done;
}

ui_print "***********************************";
ui_print "Settting ";
ui_print "ro.build.version.security_patch to ";
ui_print "2019-04-01 matching OOS 9.0.2";
ui_print "build fingerprint";
ui_print "(c) 2019 nvertigo67@xda ";
ui_print "***********************************";

ui_print "mount system";
system_mounted=$(mount | grep "system")
if [ -z "$system_mounted" ]; then
mount -o rw /system;
else
umount /system;
mount -o rw /system;
fi

if [ -e /system/build.prop ]; then
PROPFILE=/system/build.prop
ui_print "using /system/build.prop";
else
if [ -e /system/system/build.prop ]; then
PROPFILE=/system/system/build.prop
ui_print "using /system/system/build.prop";
else
ui_print "Can't locate the build.prop file,";
ui_print "nothing will be changed!";
ui_print "unmounting system";
umount_msg=$(umount /system 2>&1);
if [ -z "$umount_msg" ]; then
ui_print "system unmounted";
else
ui_print "$umount_msg";
fi
exit 1;
fi
fi

Instead of PROPFILE set SYSTEM_PATH to /system/system or /system accordingly, before mounting firmware_mnt, then you can throw away the not needed files with

find $SYSTEM_PATH -iname \*ifaa\* -o -iname \*soter\* -o -iname \*alipay\* |xargs rm -rf

For some source build roms (at least for all los-16.0 and los-17.1 based roms) deleting the mentioned files is only the first part of the job. The second part is removing "/system/framework/org.ifaa.android.manager.jar:" from "BOOTCLASSPATH" in /init.environ.rc (for non-sar roms; probably /system/init.environ.rc for sar roms). Otherwise boot.art can't be assemled on boot time. The rom works without boot.art in image-less mode, but this is significantly slower causing lags on app start, unlock and many more actions as e.g. opening of Settings.

I guess this is easy for sar roms (just sed /system/init.environ.rc) but is ugly for non-sar roms: you need to unpack the ramdisk from the boot partition change init.environ.rc repack the boot image, resign (for locked bootloaders) and reflash it to the boot partition.

For extracting, changing init.environ.rc and reflashing the boot image you can use [MENTION=4544860]osm0sis[/MENTION]' anykernel3 templates (https://xdaforums.com/showthread.php?t=2670512 ); for resigning you may want to use [MENTION=631273]Chainfire[/MENTION]'s VerifiedBootSigner (https://xdaforums.com/android/software-hacking/signing-boot-images-android-verified-t3600606 ). I've made one, which uses the oneplus bootloader required aosp keys: https://xdaforums.com/showpost.php?p=78433989&postcount=4

There's also some more cosmetics: to completely remove all traces of ifaa, soter and alipay, from the build I've needed these commits:

https://github.com/nvertigo/android...mmit/2ab32d492f0b8d109b503c86208394c8fa5e7486

https://github.com/nvertigo/proprie...mmit/99a6fdf5dbbc8f5f7a9d2ccf43d139b5eecc08d5

Hope this helps making a final zip.