d4rken-org / sdmaid-se

SD Maid 2/SE is Android's most thorough cleaning tool.
https://play.google.com/store/apps/details?id=eu.darken.sdmse
GNU General Public License v3.0
2.4k stars 376 forks source link

OnePlus 11 @ Android 14 does not return screen content via accessibility service #1016

Open d4rken opened 5 months ago

d4rken commented 5 months ago

SD Maid can't retrieve the screen content via accessibility from the system.


I'm also facing the same issue with the last 2 builds. The same apps also keeps popping up during deletion and once it completes and if i scan again, the same size is shown. I'm using a oneplus 11. Maybe an issue with oneplus devices?

Update: Added logs. @d4rken eu.darken.sdmse DebugLog - v0.20.0-beta0 (2000000) ~ 9747173e_FOSS_BETA).zip

Device: Oneplus 11 Android version: 14 Steps: AppCleaner-> Scan-> Delete(takes ~25 min) -> Scan again. Shows the same size.

I went through the logs and could see that all the operations being timed out because it couldn't find the [Storage usage] target. Does SD Maid search for buttons with the text [Storage usage] or something?

Originally posted by @aadithya96 in https://github.com/d4rken-org/sdmaid-se/issues/1012#issuecomment-1945631383

d4rken commented 5 months ago
2024-02-15T09:04:15.111Z  V/SDMSE:Automation:Crawler: Waiting for window event filter to pass...
2024-02-15T09:04:16.175Z  V/SDMSE:Automation:Service: New automation event: EventType: TYPE_VIEW_SCROLLED; EventTime: 78864271; PackageName: com.android.settings; MovementGranularity: 0; Action: 0; ContentChangeTypes: []; WindowChangeTypes: [] [ ClassName: androidx.recyclerview.widget.RecyclerView; Text: []; ContentDescription: null; ItemCount: -1; CurrentItemIndex: -1; Enabled: true; Password: false; Checked: false; FullScreen: false; Scrollable: false; ImportantForAccessibility: true; AccessibilityDataSensitive: false; BeforeText: null; FromIndex: -1; ToIndex: -1; ScrollX: 0; ScrollY: 0; MaxScrollX: 0; MaxScrollY: 0; ScrollDeltaX: 0; ScrollDeltaY: 0; AddedCount: -1; RemovedCount: -1; ParcelableData: null; DisplayId: 0 ]; recordCount: 0
2024-02-15T09:04:16.187Z  V/SDMSE:Automation:Service: Fallback root was android.view.accessibility.AccessibilityNodeInfo@1447a; boundsInParent: Rect(0, 0 - 1440, 3216); boundsInScreen: Rect(0, 0 - 1440, 3216); boundsInWindow: Rect(0, 0 - 1440, 3216); packageName: com.android.systemui; className: android.widget.FrameLayout; text: null; error: null; maxTextLength: -1; stateDescription: null; contentDescription: null; tooltipText: null; containerTitle: null; viewIdResName: null; uniqueId: null; checkable: false; checked: false; focusable: false; focused: false; selected: false; clickable: false; longClickable: false; contextClickable: false; enabled: true; password: false; scrollable: false; importantForAccessibility: true; visible: true; actions: [AccessibilityAction: ACTION_SELECT - null, AccessibilityAction: ACTION_CLEAR_SELECTION - null, AccessibilityAction: ACTION_ACCESSIBILITY_FOCUS - null, AccessibilityAction: ACTION_SHOW_ON_SCREEN - null]; isTextSelectable: false, now is null
2024-02-15T09:04:16.228Z  V/SDMSE:Automation:Service: Providing event: EventType: TYPE_VIEW_SCROLLED; EventTime: 78864271; PackageName: com.android.settings; MovementGranularity: 0; Action: 0; ContentChangeTypes: []; WindowChangeTypes: [] [ ClassName: androidx.recyclerview.widget.RecyclerView; Text: []; ContentDescription: null; ItemCount: -1; CurrentItemIndex: -1; Enabled: true; Password: false; Checked: false; FullScreen: false; Scrollable: false; ImportantForAccessibility: true; AccessibilityDataSensitive: false; BeforeText: null; FromIndex: -1; ToIndex: -1; ScrollX: 0; ScrollY: 0; MaxScrollX: 0; MaxScrollY: 0; ScrollDeltaX: 0; ScrollDeltaY: 0; AddedCount: -1; RemovedCount: -1; ParcelableData: null; DisplayId: 0 ]; recordCount: 0
2024-02-15T09:04:16.229Z  V/SDMSE:Automation:Crawler: Testing window event EventType: TYPE_VIEW_SCROLLED; EventTime: 78864271; PackageName: com.android.settings; MovementGranularity: 0; Action: 0; ContentChangeTypes: []; WindowChangeTypes: [] [ ClassName: androidx.recyclerview.widget.RecyclerView; Text: []; ContentDescription: null; ItemCount: -1; CurrentItemIndex: -1; Enabled: true; Password: false; Checked: false; FullScreen: false; Scrollable: false; ImportantForAccessibility: true; AccessibilityDataSensitive: false; BeforeText: null; FromIndex: -1; ToIndex: -1; ScrollX: 0; ScrollY: 0; MaxScrollX: 0; MaxScrollY: 0; ScrollDeltaX: 0; ScrollDeltaY: 0; AddedCount: -1; RemovedCount: -1; ParcelableData: null; DisplayId: 0 ]; recordCount: 0
2024-02-15T09:04:16.230Z  V/SDMSE:Automation:Crawler: Waiting for window event filter passed!
2024-02-15T09:04:16.234Z  W/SDMSE:Automation:Service: Using fallback rootNode: android.view.accessibility.AccessibilityNodeInfo@1447a; boundsInParent: Rect(0, 0 - 1440, 3216); boundsInScreen: Rect(0, 0 - 1440, 3216); boundsInWindow: Rect(0, 0 - 1440, 3216); packageName: com.android.systemui; className: android.widget.FrameLayout; text: null; error: null; maxTextLength: -1; stateDescription: null; contentDescription: null; tooltipText: null; containerTitle: null; viewIdResName: null; uniqueId: null; checkable: false; checked: false; focusable: false; focused: false; selected: false; clickable: false; longClickable: false; contextClickable: false; enabled: true; password: false; scrollable: false; importantForAccessibility: true; visible: true; actions: [AccessibilityAction: ACTION_SELECT - null, AccessibilityAction: ACTION_CLEAR_SELECTION - null, AccessibilityAction: ACTION_ACCESSIBILITY_FOCUS - null, AccessibilityAction: ACTION_SHOW_ON_SCREEN - null]; isTextSelectable: false
2024-02-15T09:04:16.235Z  V/SDMSE:Automation:Service: Providing window root: android.view.accessibility.AccessibilityNodeInfo@1447a; boundsInParent: Rect(0, 0 - 1440, 3216); boundsInScreen: Rect(0, 0 - 1440, 3216); boundsInWindow: Rect(0, 0 - 1440, 3216); packageName: com.android.systemui; className: android.widget.FrameLayout; text: null; error: null; maxTextLength: -1; stateDescription: null; contentDescription: null; tooltipText: null; containerTitle: null; viewIdResName: null; uniqueId: null; checkable: false; checked: false; focusable: false; focused: false; selected: false; clickable: false; longClickable: false; contextClickable: false; enabled: true; password: false; scrollable: false; importantForAccessibility: true; visible: true; actions: [AccessibilityAction: ACTION_SELECT - null, AccessibilityAction: ACTION_CLEAR_SELECTION - null, AccessibilityAction: ACTION_ACCESSIBILITY_FOCUS - null, AccessibilityAction: ACTION_SHOW_ON_SCREEN - null]; isTextSelectable: false
2024-02-15T09:04:16.235Z  V/SDMSE:Automation:Crawler: Looking for viable window root, current nodes:
2024-02-15T09:04:16.237Z  D/SDMSE:Automation:Crawler:Common: Refresh success: false
29vivek commented 5 months ago

Hi @d4rken, I'm running version 0.20.0-beta0 on OnePlus 12 running Android 14 and face the same issue in app cleaner not working since it's looking for [Storage] before (Storage used) but the app info screen directly has a (Storage used) option.

d4rken commented 5 months ago

@29vivek The issue of the user here is different, SD Maid is not getting any screen info, so it fails before that step where it looks for the text.

If the screen lookup is working for you then it means @aadithya96's issue is not a global ROM issue, which would be great. The lookup can be fixed. Can you get me a short log so I can confirm?

29vivek commented 5 months ago

Attaching a debug log of the whole operation, eu.darken.sdmse_logfile_1708275500684.zip.

Let me know if this suffices.

d4rken commented 5 months ago

@29vivek Same issue as the OP, system doesn't tell SD Maid about the screen :thinking:

2024-02-18T16:58:41.361Z  V/SDMSE:Automation:Crawler: Waiting for window event filter passed!
2024-02-18T16:58:41.366Z  V/SDMSE:Automation:Service: Providing window root: null
2024-02-18T16:58:41.367Z  W/SDMSE:Automation:Crawler: crawl(): Attempt 2 failed on Spec(parent=SDMSE:AppCleaner:Automation:OnePlus:Specs, label=Find & click 'Storage' (targets=[Storage usage])):
io.github.z4kn4fein.semver.VersionFormatException: Root node is currently null
    at eu.darken.sdmse.automation.core.AutomationService.windowRoot(Unknown Source:105)
    at eu.darken.sdmse.automation.core.common.StepProcessor$doCrawl$targetWindowRoot$1.invokeSuspend(Unknown Source:178)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(Unknown Source:8)
    at kotlinx.coroutines.DispatchedTask.run(Unknown Source:107)
    at com.android.billingclient.api.zzl.run(Unknown Source:33)
    at kotlinx.coroutines.scheduling.TaskImpl.run(Unknown Source:2)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(Unknown Source:93)
29vivek commented 5 months ago

Interesting, the app freezes at "app info" screen.

d4rken commented 5 months ago

The normal behavior is that SD Maid tells the system to open the app info screen, then the system tells SD Maid what is visible on the screen, then SD Maid finds the right button and clicks it, but your ROM just says " " (nothing)...

rivalcomp commented 5 months ago

Same here on OnePlus 10 Pro 5G (Android 14).

Good to know that the old SD Maid Pro is working properly and is cleaning cache using the accessibility service (targeting the Storage used option), while this new SD Maid 2 doesn't.

d4rken commented 5 months ago

Same here on OnePlus 10 Pro 5G (Android 14).

Good to know that the old SD Maid Pro is working properly and is cleaning cache using the accessibility service (targeting the Storage used option), while this new SD Maid 2 doesn't.

Can you provide a debug log of that? Both SD Maids use similar accessibility options. I don't think there is a difference in terms of what data is requested. 🤔

aadithya96 commented 4 months ago

Same here on OnePlus 10 Pro 5G (Android 14). Good to know that the old SD Maid Pro is working properly and is cleaning cache using the accessibility service (targeting the Storage used option), while this new SD Maid 2 doesn't.

Can you provide a debug log of that? Both SD Maids use similar accessibility options. I don't think there is a difference in terms of what data is requested. 🤔

I can confirm that the old sd maid works fine with the OnePlus 11 as well.

TheSSJ2612 commented 4 months ago

Same issue with Oneplus 12R (Android 14). SD Maid 1 works fine but SD Maid SE doesnt.

d4rken commented 3 months ago

The base flags in SD Maid 1 and 2 are the same:

<?xml version="1.0" encoding="utf-8"?>
<accessibility-service xmlns:android="http://schemas.android.com/apk/res/android"
    android:accessibilityEventTypes="typeViewClicked|typeViewScrolled|typeWindowStateChanged"
    android:accessibilityFeedbackType="feedbackGeneric"
    android:accessibilityFlags="flagReportViewIds|flagRetrieveInteractiveWindows"
    android:canRetrieveWindowContent="true"
    android:description="@string/description_accessibility_service"
    android:notificationTimeout="1000" />

I'm wondering if this is related to the targetAPI, SD Maid 2 has a higher target than SD Maid 1 for obvious reasons... :thinking:

I don't think there is any specific issue in SD Maid 2, otherwise all other phones would have the same issue, but this is only limited to OnePlus. :shrug:

d4rken commented 3 months ago

This keeps being an issue and I currently don't see a solution. I'll likely have to buy a OnePlus device with a matching configuration. Can anyone recommend one, that is as cheap as possible? 🤔 Preferably rootable, so I can use it to improve SD Maid on OnePlus in other ways too.

aadithya96 commented 3 months ago

This keeps being an issue and I currently don't see a solution. I'll likely have to buy a OnePlus device with a matching configuration. Can anyone recommend one, that is as cheap as possible? 🤔 Preferably rootable, so I can use it to improve SD Maid on OnePlus in other ways too.

I think you can get a 11R or a 12R. Those are relatively cheap with almost the same specs and builds. 11R is around 150$ cheaper where I'm from. I can also test some debug builds if you want.

d4rken commented 2 months ago

Please report back after the next update, I think #1152 might fix this.

TheSSJ2612 commented 2 months ago

Please report back after the next update, I think #1152 might fix this.

Doesn't appear to be fixed in the latest play store version 0.24.0-beta0. At the beginning it is sometimes able to clear caches of some of the apps (like 4-5 apps) in the beginning but after that it fails to clear the cache of rest of the apps. Otherwise it fails to clear any of the apps caches.

Device : Oneplus 12r (Android 14)

aadithya96 commented 2 months ago

Please report back after the next update, I think #1152 might fix this.

Doesn't appear to be fixed in the latest play store version 0.24.0-beta0. At the beginning it is sometimes able to clear caches of some of the apps (like 4-5 apps) in the beginning but after that it fails to clear the cache of rest of the apps. Otherwise it fails to clear any of the apps caches.

Device : Oneplus 12r (Android 14)

Exact same behaviour on Oneplus 11

rivalcomp commented 2 months ago

Device : Oneplus 12r (Android 14) Exact same behaviour on Oneplus 11

+1 on Oneplus 10 Pro (Android 14)