Repository navigation
fix(helper): recognise the accessibility service by component, not string - #169
Open
zhangifonly wants to merge 1 commit into
Open
zhangifonly wants to merge 1 commit into
zhangifonly wants to merge 1 commit into
Conversation
…ring The Settings UI stores the fully-qualified component (com.artemis.helper/com.artemis.helper.ArtemisAccessibilityService) while adb stores the short form (com.artemis.helper/.ArtemisAccessibilityService). ROMs that reject the adb secure-settings write (seen on ColorOS / realme, Android 14) can only be enabled by hand, so is_service_enabled() stayed False forever, provision() kept reporting the service as disabled, and _revive_service()/uninstall() missed the entry. Compare the normalized component in all four places instead.
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
enabled_accessibility_servicescan hold the same component in two spellings:_enable_service()writes):com.artemis.helper/.ArtemisAccessibilityServicecom.artemis.helper/com.artemis.helper.ArtemisAccessibilityServiceSome ROMs reject the adb secure-settings write. On a realme RMX2202 (ColorOS / realme UI, Android 14)
artemis helper installreports "This device rejected enabling the accessibility service from adb" and opens the Accessibility screen, as designed. After the user enables the service by hand, only the fully-qualified spelling is present, and:is_service_enabled()staysFalse, soartemis helper statuskeeps showing Service enabled: no andprovision()keeps trying (and failing) to enable it;_revive_service()keeps the qualified entry and appends the short one (duplicate);uninstall()leaves the qualified entry behind.Fix
Add
_is_helper_service(), which expands a leading-dot class name and compares the normalized component, and use it at all four call sites. Writes still useSERVICE_NAMEunchanged.Tests
tests/unit/runtime/test_helper_manager.py(settings-UI spelling is recognised byprovision()without rewriting the setting;uninstall()removes it). Both fail without the fix and pass with it.tests/unit/runtime/: 141 passed;ruff check/ruff format --checkclean;pyright --project pyright-core.json: 0 errors.artemis helper statusnow reports Service enabled: yes / Service answering: yes, and a Flash task completes using the helper.