LibreShift / red-moon

Android screen filter app for night time phone use.
GNU General Public License v3.0
653 stars 82 forks source link

Accessibility Service Overlay MVP #329

Open AdamNiederer opened 2 years ago

AdamNiederer commented 2 years ago

I'm not going to pretend that this is the finest code I've written, but this should be daily-usable and I want to prevent as much eye-searing as possible among our Android 12 users. This should be in a reasonable state to build upon as well.

It adds a link in the settings to the accessibility services page, and will always use the accessibility service instead of a standard overlay when said service is enabled. It all goes through the existing FilterService, so it should work with all the possible ways one can toggle and set filters.

Good news:

Bad news:

Resolves #309 Resolves #253 Resolves #252 Resolves #312 Resolves #236 (repro'd + confirmed fixed on Android 11) Probably Resolves #234 Probably Resolves #277

Uranusek commented 1 year ago

Maybe you could merge it now and release as beta only on Github?

AdamNiederer commented 7 months ago

I've been using this for the past year or so on my phone and it's worked well. If there's no major blocking issues then I think approving and merging this would be a net benefit.

Uranusek commented 7 months ago

Could you add the apk version with your changes here? Then people could install and test it. I tried to compile it myself, but Android Studio throws errors :/

AdamNiederer commented 7 months ago

I'm pretty sure the (rightfully-added) anti-scam measures on newer android versions would prevent you from actually testing the accessibility service if I gave you an APK. I did just push a change which fixes the failing APK build, though, which might fix your issue.

Uranusek commented 6 months ago

I managed to compile. It works perfectly, thanks a lot! This should definitely be merged.

Commenter25 commented 5 months ago

I'm pretty sure the (rightfully-added) anti-scam measures on newer android versions would prevent you from actually testing the accessibility service if I gave you an APK.

Actually, it is still possible to use accessibility services from an APK. It will stop you from doing it the normal way, but if you know where to look, in the app details menu, in a kebab menu in the top right, you can disable this safeguard. So an APK actually would be useful. Assuming you're trustworthy ;D