Skip to content

AppCleaner: Fix ArrayIndexOutOfBoundsException when scanning via Storage Access Framework - #1110

Merged
d4rken merged 1 commit into
mainfrom
appcleaner_index_out_of_bounds
Apr 2, 2024
Merged

AppCleaner: Fix ArrayIndexOutOfBoundsException when scanning via Storage Access Framework#1110
d4rken merged 1 commit into
mainfrom
appcleaner_index_out_of_bounds

Conversation

@d4rken

@d4rken d4rken commented Apr 2, 2024

Copy link
Copy Markdown
Member

Filters work with prefix free paths, i.e. they don't care about the specific "sdcard name".

#1059 removed the overlap when passing scanned paths to filters, so filters get more path information.

Before filters worked with "/sdcard/nextcloud/folderA" -> "folderA"

After filters worked with "/sdcard/nextcloud/folderA" -> "nextcloud/folderA"

This worked for LocalPath but caused a bug with SAFPath because paths here are split into a treeUri and segments. The path logic failed when we tried to check SAFPath(treeUri,1-segment).startsWith(SAFPath(treeUri,0-segments)). startsWith should return true, but checked only via segments and tried to do array operations on an empty array.

Closes #1100

…age Access Framework

filters work with prefix free paths, i.e. they don't care about the specific "sdcard name".
#1059  removed the overlap when passing scanned paths to filters, so filters get more path information.
Before filters worked with "/sdcard/nextcloud/folderA" -> "folderA"
After filters worked with "/sdcard/nextcloud/folderA" -> "nextcloud/folderA"

This worked for `LocalPath` but caused a bug with `SAFPath` because paths here are split into a `treeUri` and segments.
The path logic failed when we tried to check `SAFPath(treeUri,1-segment).startsWith(SAFPath(treeUri,0-segments))`.

Closes #1100
@d4rken d4rken added bug Something isn't working as expected c: AppCleaner c: IO SAF/Normal/Root access labels Apr 2, 2024
@d4rken
d4rken force-pushed the appcleaner_index_out_of_bounds branch from d880b87 to 96a4994 Compare April 2, 2024 14:14
@d4rken
d4rken merged commit 3cf4ae5 into main Apr 2, 2024
@d4rken
d4rken deleted the appcleaner_index_out_of_bounds branch April 2, 2024 15:05
@KBiT7777

KBiT7777 commented Apr 3, 2024

Copy link
Copy Markdown

Problema solucionado! Gracias. Problem solved! Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working as expected c: AppCleaner c: IO SAF/Normal/Root access

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug with AppCleaner: Error - ArrayIndexOutOfBoundsException

2 participants