Restrict StreamFileProvider paths to only used directories#6183
Restrict StreamFileProvider paths to only used directories#6183VelikovPetar merged 1 commit intodevelopfrom
Conversation
Co-Authored-By: Claude <[email protected]>
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Repository UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (1)
WalkthroughThe changes restructure file provider paths in the Android manifest by removing broad external access declarations and replacing them with specific directories. The generic Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
SDK Size Comparison 📏
|
|
|
🚀 Available in v6.32.4 |



Goal
stream_filepaths.xmlregistered 6 path entries forStreamFileProvider, but only 2 were actually used by the SDK. The unused entries unnecessarily expanded the FileProvider's URI surface area, including<external-path>which mapped to the raw external storage root (Environment.getExternalStorageDirectory()) — the broadest possible grant.Implementation
<files-path>,<external-path>,<external-cache-path>,<external-media-path><external-files-path>frompath="."(entire app-specific external dir) to two scoped entries —Pictures/andMovies/— which are the only subdirectoriesStreamFileManageractually writes to for camera captureThe two remaining entries:
<cache-path path=".">— used by audio recording, bitmap sharing, attachment downloads, and the camera fallback path<external-files-path path="Pictures/">and<external-files-path path="Movies/">— used exclusively by camera capture (StreamFileManager.createPhotoInExternalDir/createVideoInExternalDir)🎨 UI Changes
No UI changes.
Testing
Camera photo and video capture should continue to work. All other file sharing (attachments, audio recordings, bitmaps) should be unaffected as they all use
cacheDir.Summary by CodeRabbit