Tested with Google Pixel.
You have to grant WRITE_SECURE_SETTINGS permission:
$ adb shell pm grant me.lucky.aodify android.permission.WRITE_SECURE_SETTINGS
* NOTIFICATION_LISTENER - turn on AOD on new notification
* WRITE_SECURE_SETTINGS - control AOD
It is Free Open Source Software.
Although APK downloads are available below to give you the choice, you should be aware that by installing that way you will not receive update notifications and it's a less secure way to download. We recommend that you install the F-Droid client and use that.Download F-Droid