Skip to content

fix(sdcard): prevent crash when listing non-tree SAF URIs - #2708

Merged
bajrangCoder merged 1 commit into
mainfrom
fix/saf-single-file-crash
Aug 9, 2026
Merged

bajrangCoder merged 1 commit into
mainfrom
fix/saf-single-file-crash

Conversation

@bajrangCoder

Copy link
Copy Markdown
Member

No description provided.

@greptile-apps

greptile-apps Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR prevents SD-card directory listings from throwing while handling non-tree SAF URIs.

  • Moves URI parsing and child-URI construction inside the existing guarded error-handling path.
  • Detects a non-tree URI before extracting its tree document ID.
  • Returns a controlled Cordova callback error for unsupported directory URIs.

Confidence Score: 5/5

The PR appears safe to merge, with non-tree SAF directory inputs now failing through a controlled callback rather than escaping the listing path.

The normal initial and recursive listing flows continue to use tree URIs, while unsupported non-tree inputs return the same public error through a safer guarded path.

Important Files Changed

Filename Overview
src/plugins/sdcard/src/android/SDcard.java Adds an early SAF tree-URI validation and keeps URI-related failures within the directory-listing callback error path; no actionable regression was identified.

Reviews (1): Last reviewed commit: "fix(sdcard): prevent crash when listing ..." | Re-trigger Greptile

@bajrangCoder
bajrangCoder added this pull request to the merge queue Aug 9, 2026
Merged via the queue into main with commit 3ee2609 Aug 9, 2026
9 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in The Code Board - Acode Aug 9, 2026
@bajrangCoder
bajrangCoder deleted the fix/saf-single-file-crash branch August 9, 2026 10:55
7HR4IZ3 pushed a commit to cyber-sight/Acode that referenced this pull request Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant