In my case, Oppo F1s, I found out one solution.
First of all, your device should be rooted, the best way to do that is through resetting firmware to factory or updating to newer Oppo system image, then installing custom recovery, then rooting under Recovery mode using Magisk. All this is described in some XDA-developers forum topic.
But that is not our issue for now. To prevent accessibility permission to be revoked from our service or app:
- We have to go developer, by browsing SETTINGS > DEVICE INFO, then clicking 7 times on BUILD NUMBER.
- Now that we have become DEVELOPER for good, we go back and then we navigate towards SETTINGS > ADVANCED SETTINGS > DEVELOPER SETTINGS.
- Then enable DEVELOPER OPTIONS, open section RUNNING SERVICES, browse for application named SECURITY CENTER, inside which we can see 4 running services.
- Then STOP service named CONTROL_VERIFY_SERVICE (of course on your own risk).
That is it, now just go to SETTINGS > ADVANCED SETTINGS > ACCESSIBILITY and enable accessibility for your application and enjoy it.