stricter accessibility settings restriction

This commit is contained in:
minish 2025-10-10 00:34:08 -04:00
parent a017d1e27f
commit 6002eaf0cf
Signed by: min
SSH Key Fingerprint: SHA256:mf+pUTmK92Y57BuCjlkBdd82LqztTfDCQIUp0fCKABc
2 changed files with 6 additions and 8 deletions

View File

@ -91,12 +91,10 @@ class DigicaService : AccessibilityService() {
&& className == "android.app.AlertDialog"
&& event.text.getOrNull(0) == appLabel
// Is user trying to disable the service?
val attemptingDisableService = pkgName == "com.android.settings"
&& (className == "android.app.AlertDialog"
|| className == "androidx.appcompat.app.AlertDialog")
&& event.text.size == 3
&& event.text[0].contains(serviceLabel)
// Is user entering the accessibility service page?
val attemptingServicePage = pkgName == "com.android.settings"
&& className == "com.android.settings.SubSettings"
&& event.text.getOrNull(0) == serviceLabel
// Is user trying to go on a banned app?
val usingApp = pkgName == "com.zhiliaoapp.musically"
@ -104,7 +102,7 @@ class DigicaService : AccessibilityService() {
|| pkgName == "app.revanced.android.youtube"
val attempting = (attemptingUninstall
|| attemptingDisableService
|| attemptingServicePage
|| attemptingForceStop
|| usingApp)

View File

@ -1,7 +1,7 @@
<accessibility-service xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:description="@string/accessibility_service_description"
android:accessibilityEventTypes="typeWindowStateChanged|typeViewClicked"
android:accessibilityEventTypes="typeWindowStateChanged"
android:accessibilityFlags="flagDefault"
android:accessibilityFeedbackType="feedbackGeneric"
android:notificationTimeout="0"