[Magisk] zgfg:
Ok, so as guessed in my yesterday's post/answer #54234, it seems that you could more-or-less achieve your wanted functionality - could you try please:

1) Install the following module and reboot - all thanks to @huskydg for his interesting and excellent module:

GitHub - HuskyDG/magic_proc_monitor: A Magisk/Zygisk module allows user to run script whenever app process start

A Magisk/Zygisk module allows user to run script whenever app process start - HuskyDG/magic_proc_monitor

github.com

2) Go to:

/data/adb/modules/magisk_proc_monitor

and rename the original (dummy/template) dynmount.sh script to dynmount.bak,

and replace that dynmount.sh with my customized script:

File on MEGA

mega.nz

My changes (customizations) in the script can be recognized as commented by CAPS LOCK comments

How it works:

myAPP=com.swedbank defines the package name for your Estonian Swedbank app

myPROP=sys.oem_unlock_allowed defines the property you want to 'hide'/'un-hide'(corresponding to your Developer Options, OEM Unlock disable/enable switch)

hidePROP=0 defines the 'hidden' property value (OEM Unlock disabled)

unhidePROP=1 defines the 'un-hidden' property value (OEM Unlock enabled)

You can redefine those variables (lines 24-32) if you need

Eg, I did my own non-intrusive tests (still commented out in the script if somebody else wants to play) with MiXPlorer instead of your banking app:

myAPP=com.mixplorer

and by playing with a dummy prop:

myPROP=my.test

a)

When module recognizes that your banking app $myAPP is pre-initializing,

it will 'hide' $myPROP 'by setting to $hidePROP (lines 39-46)

and you will see the notification like:

"Hide my prop / com.swedbank, sys.oem_unlock_allowed=0"

For this event to happen, the banking app $myAPP must be started, not brought back from background (kill and restart your app)

b)

Whenever the module recognizes that any other user app is pre-initializing AND that $myPROP was still 'hidden',

it will 'un-hide' the prop by setting it back to $unhidePROP (lines 51-60)

and you will see the notification like:

"Un-hide my prop / com.xda.labs.play, sys.oem_unlock_allowed=1"

All the $myPROP sitches are systemless - when you reboot, the prop will be back to its original/default value

Issue/question:

Of course, instead of monitoring while any other user app is initializing (case b),

it would be better if the module could directly recognize when your banking app $myAPP gets closed (killed) and to 'un-hide' then the $myPROP property back

However, I did not find how to recognize in the dynmount.sh script when an app is really closing and that's why I put the case b as described above

Maybe the module's developer @huskydg could better customize the script dynmount.sh to more closely cover the original functionality as you needed:

- 'hide' the $myPROP property only for the $myAPP application

---

The really good and interesting thing with his module is that user can customize the provided default dynmount.sh script

to catch-up events when particular app(s) are starting to dynamically apply certain changes (redefine certain properties, do particular mounts)

Otherwise, one would need to develop his own Zygisk module, but there the Zygisk part must be coded in C (and recompiled),

it cannot be made simply by scripting as here with his simple dynmount.sh script