Skip to content

AppCleaner: Add fallback strategies for clearing cache on Android 16 Beta 1#2057

Draft
d4rken wants to merge 7 commits intomainfrom
appcleaner-aosp-36beta-2056
Draft

AppCleaner: Add fallback strategies for clearing cache on Android 16 Beta 1#2057
d4rken wants to merge 7 commits intomainfrom
appcleaner-aosp-36beta-2056

Conversation

@d4rken
Copy link
Member

@d4rken d4rken commented Dec 19, 2025

Refactors the "Clear cache" button finding logic on AOSP. Adds multiple fallback mechanisms for modern Android versions (API 36+) where the button might not be found via accessibility text.

Strategies, in order:

  1. Find by accessibility text (legacy).
  2. Find by content description (new for API 36+).
  3. Attempt keyboard D-pad navigation (requires Root/ADB).

Gesture click simulation didn't work.

I also tried via UIAutomator but that conflicts with the accessibility service.

Only the key input injection via ADB/Root is currently a possibly workaround for #2056 so far.

Didn't find a way with out elevated permissions so far. ☹️

Root users won't need accessibility service anyways. If this is "working as intended" 🫠 then at least ADB access (Shizuku etc.) will be required going forward...

Add `contentDescription` property to the `ACSNodeInfo` interface and its implementations. This allows automation logic to match nodes by their content description in addition to their text.
Refactors the "Clear cache" button finding logic on AOSP. Adds multiple fallback mechanisms for modern Android versions (API 36+) where the button might not be found via accessibility text.

Strategies, in order:
1.  Find by accessibility text (legacy).
2.  Find by content description (new for API 36+).
3.  Attempt keyboard D-pad navigation (requires Root/ADB).

Only the key input injection via ADB/Root is a possibly workaround for #2056 so far. Didn't find a way with out elevated permissions so far.
Gesture click simulation didn't work.
Extends the Android 16 Beta fallback strategies with:
- InputInjector.tap(x, y) for coordinate-based clicking via shell
- UiDumper for parsing UI hierarchy via `uiautomator dump`
- Query methods for finding nodes by text, content-desc, resource-id

Note: UiDumper cannot be used during automation as uiautomator
conflicts with the accessibility service (causes service unbind).
Code retained for debugging and future standalone use cases.

Keyboard navigation remains the working fallback for API 36+
where Clear cache button has NAF=true (hidden from accessibility).
@d4rken d4rken added enhancement New feature, request, improvement or optimization c: AppCleaner Automation Accessibility service related (ACS) ROM: AOSP AOSP or close to AOSP. api: 36 A16 (Baklava) labels Dec 19, 2025
@d4rken d4rken force-pushed the appcleaner-aosp-36beta-2056 branch from bc6d7ce to 7378669 Compare December 19, 2025 16:32
@d4rken d4rken force-pushed the appcleaner-aosp-36beta-2056 branch from 7378669 to f790bd8 Compare December 19, 2025 17:05
Add `application = TestApplication::class` to `@Config` annotation in
UiNodeExtensionsTest to fix CI test failures. Without this config,
Robolectric tests can crash the JVM test executor.
Restore UiDumperTest.kt with the proper `application = TestApplication::class`
in the `@Config` annotation. The original test was removed due to CI failures
caused by this missing configuration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: 36 A16 (Baklava) Automation Accessibility service related (ACS) c: AppCleaner enhancement New feature, request, improvement or optimization ROM: AOSP AOSP or close to AOSP.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant