Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AppCleaner: Improve ACS based cache clearing resilience by detecting storage entries "on-the-fly" via app size values #1065

Merged
merged 1 commit into from
Mar 16, 2024

Conversation

d4rken
Copy link
Member

@d4rken d4rken commented Mar 16, 2024

Most "Storage" entries in system details have a summary row that says something like "604 MB in internal storage" While we don't know the translation of "in internal storage", we know the app size, so we can look for "604 MB". There is a slight chance for false-positives if the data-usage of the app is the same as the app size, but that's pretty rare. If that happens SD Maid just keeps retrying as usual.

With 218 apps this had a 99% success rate.
There was one app ("Digital Wellbeing", a system app), that showed the wrong app size (36,06 MB) on first load. Only when SD Maid retried and reloaded the settings details, the size displayed correct (35,96 MB). No idea why the size was displayed incorrectly the first time...

When clearing caches via ACS we now have 3 tier process:

  1. Try to get the storage entry label via string resource ID

  2. Try hard coded labels by language code

  3. Try to find the summary row by looking up the app size

This should make it a lot easier to automatically support ROMs after updates, where the texts change.

…storage entries "on-the-fly" via app size values

Most "Storage" entries in system details have a summary row that says something like "604 MB in internal storage"
While we don't know the translation of "in internal storage", we know the app size, so we can look for "604 MB".
There is a slight chance for false-positives if the data-usage of the app is the same as the app size, but that's pretty rare.
If that happens SD Maid just keeps retrying as usual.

With 218 apps this had a 99% success rate.
There was one app ("Digital Wellbeing", a system app), that showed the wrong app size (36,06 MB) on first load.
Only when SD Maid retried and reloaded the settings details, the size displayed correct (35,96 MB).
No idea why the size was displayed incorrectly the first time...

When clearing caches via ACS we now have 3 tier process:
1: Try to get the storage entry label via string resource ID
2: Try hard coded labels by language code
3: Try to find the summary row by looking up the app size

This should make it a lot easier to automatically support ROMs after updates, where the texts change.
@d4rken d4rken added enhancement New feature, request, improvement or optimization c: AppCleaner Automation Accessibility service related labels Mar 16, 2024
@d4rken d4rken changed the title AppCleaner: Improve ACS based cache clearing resilience by detecting … AppCleaner: Improve ACS based cache clearing resilience by detecting storage entries "on-the-fly" via app size values Mar 16, 2024
@d4rken d4rken merged commit 8bb82ad into main Mar 16, 2024
16 checks passed
@d4rken d4rken deleted the appcleaner_smart_label_lookup branch March 16, 2024 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Automation Accessibility service related c: AppCleaner enhancement New feature, request, improvement or optimization
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant