{"id":50652120,"url":"https://github.com/chickendrop89/hyperos-accessibility-fix","last_synced_at":"2026-06-13T07:01:38.187Z","repository":{"id":363174166,"uuid":"1262215473","full_name":"chickendrop89/hyperos-accessibility-fix","owner":"chickendrop89","description":"Stop HyperOS from randomly disabling accessibillity services","archived":false,"fork":false,"pushed_at":"2026-06-07T18:34:52.000Z","size":20,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-06-07T20:03:32.633Z","etag":null,"topics":["a11y","accessibility","activitymanager","android","hyperos","ksu","magisk","magisk-module","miui","mksh","xiaomi"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chickendrop89.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"ko_fi":"chickendrop89"}},"created_at":"2026-06-07T18:05:18.000Z","updated_at":"2026-06-07T19:01:52.000Z","dependencies_parsed_at":"2026-06-07T20:03:34.430Z","dependency_job_id":null,"html_url":"https://github.com/chickendrop89/hyperos-accessibility-fix","commit_stats":null,"previous_names":["chickendrop89/hyperos-accessibility-fix"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/chickendrop89/hyperos-accessibility-fix","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chickendrop89%2Fhyperos-accessibility-fix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chickendrop89%2Fhyperos-accessibility-fix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chickendrop89%2Fhyperos-accessibility-fix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chickendrop89%2Fhyperos-accessibility-fix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chickendrop89","download_url":"https://codeload.github.com/chickendrop89/hyperos-accessibility-fix/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chickendrop89%2Fhyperos-accessibility-fix/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34275068,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-13T02:00:06.617Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["a11y","accessibility","activitymanager","android","hyperos","ksu","magisk","magisk-module","miui","mksh","xiaomi"],"created_at":"2026-06-07T20:00:35.860Z","updated_at":"2026-06-13T07:01:37.811Z","avatar_url":"https://github.com/chickendrop89.png","language":"Shell","funding_links":["https://ko-fi.com/chickendrop89"],"categories":[],"sub_categories":[],"readme":"# hyperos-accessibility-fix\nStop HyperOS from randomly disabling accessibility services\n\n## What's happening\nOn Android, when an accessibility app is force-stopped via `ActivityManager`, the [accessibility permission of the app is stripped](https://cs.android.com/android/platform/superproject/+/android-16.0.0_r4:frameworks/base/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java;drc=7f9ce6b127e5d17d7a2ccef1ccc21db212f60084;l=1050).\n\n```java\nboolean onPackagesForceStoppedLocked(String[] packages, AccessibilityUserState userState) {\n    final Set\u003cString\u003e packageSet = Set.of(packages);\n    \n    final ArrayList\u003cComponentName\u003e continuousServices = userState.mInstalledServices.stream()\n            .filter(s -\u003e (s.flags \u0026 FLAG_REQUEST_ACCESSIBILITY_BUTTON) == FLAG_REQUEST_ACCESSIBILITY_BUTTON)\n            .map(AccessibilityServiceInfo::getComponentName)\n            .filter(name -\u003e packageSet.contains(name.getPackageName()))\n            .collect(Collectors.toCollection(ArrayList::new));\n\n    final boolean enabledServicesChanged = userState.mEnabledServices.removeIf(comp -\u003e {\n        if (packageSet.contains(comp.getPackageName())) {\n            userState.getBindingServicesLocked().remove(comp);\n            userState.getCrashedServicesLocked().remove(comp);\n            return true;\n        }\n        return false;\n    });\n\n    if (enabledServicesChanged) {\n        persistComponentNamesToSettingLocked(\n            Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES,\n            userState.mEnabledServices, userState.mUserId);\n    }\n}\n    ...\n```\n\nAnd HyperOS is hardcoded to trigger a force-stop (not a kill) on \ncertain events like when the user is entering Ultra Battery Saver (`LockScreenClean`),\nand others:\n\n```log\n\u003cultra battery saver was enabled\u003e\nI ActivityManager: Force stopping com.urbandroid.lux appid=10415 user=0: LockScreenClean\nD ActivityManager: Force removing proc 8855:com.urbandroid.lux:background/u0a415 (com.urbandroid.lux:background/10415)\n```\n\n## How it works\nThis module installs a background script that monitors the `logcat` `event` stream for force stop events (`Force stopping.*($PKG_PATTERN)`, etc) \nwith minimal system overhead.\n\nOn boot, it checks what accessibility services are enabled, and writes them to `a11y_watchlist.txt`. It also listens for signs of manual \nconfiguration changes (done by user in settings) and updates the watchlist automatically.\n\nWhen a forced stop of a watched service is detected, the script performs a verification of enabled accessibility services against the local \n`a11y_watchlist.txt`. And when the list doesn't match up, the changes (done by `system_server`) are reverted instantly.\n\nThis script also runs at `OOM` score `-800` to prevent `LMKD` from killing it in the background. And if it still gets killed under memory pressure,\nanother (monitor) script (that runs at `-900`) is running in background to restart it (provided it wasn't killed aswell lol)\n\n## Why use background scripts, and not zygisk/xposed?\nOn my device, these two frameworks cause a range of problems for some reason, so i decided to follow this approach instead.\n\nIt's also more minimal this way, having almost no requirements.\n\n## Do they really have minimal system overhead?\nAfter 2 days of uptime, the scripts used only ~160 seconds of CPU time (`USER_HZ=100`) in total since they started.\n\nThese background scripts have negligible effect on performance and they won't slow the system down.\n\n```bash\n$ getconf CLK_TCK\n100\n```\n```bash\n$ cat /proc/7562/stat \n7562 (sh) S 1 7562 7562 0 -1 4194560 1303 11306 82 0 3 181 7 25 20 0 1 0 4514 11082203136 720 18446744073709551615 391135674368 391135918392 549159233360 0 0 0 0 6 1208083705 1 0 0 17 0 0 0 0 0 0 391135936512 391135937152 391696969728 549159237033 549159237184 549159237184 549159243753 0\n\n$ cat /proc/7563/stat                                                                                                                                                                                   \n7563 (sh) S 1 7563 7563 0 -1 4194304 73566 952234 7750 8335 63 893 1169 3535 20 0 1 0 4515 11065425920 825 18446744073709551615 401645289472 401645533496 549315373280 0 0 0 0 6 1208083705 1 0 0 17 3 0 0 0 0 0 401645551616 401645552256 402234515456 549315376568 549315376704 549315376704 549315383273 0\n```\n```bash\n$ uptime\n02:20:46 up 2 days,  6:37,  0 users,  load average: 24.01, 11.73, 8.87\n```\n\n## Note\n- When Ultra Battery Saver is turned on, the accessibility services will still keep running in the background\n- Force stopping an app via App Manager will not (permanently) remove it's accessibility permission anymore.\nSo be careful at what you enable\n\n## Installation:\n* [Download the module archive here](https://github.com/chickendrop89/hyperos-accessibility-fix/releases/latest/download/hyperos-accessibility-fix.zip)\n* Flash it in magisk app, or using command line\n\n## Requirements\n- HyperOS 1.0+ (or any A14+ system)\n- KernelSU 1.0.2+\n- Magisk 28.0+\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchickendrop89%2Fhyperos-accessibility-fix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchickendrop89%2Fhyperos-accessibility-fix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchickendrop89%2Fhyperos-accessibility-fix/lists"}