refactor: add share-safe file provider helpers PR 1 [WPB-26687]#5033
refactor: add share-safe file provider helpers PR 1 [WPB-26687]#5033MohamadJaara wants to merge 1 commit into
Conversation
|
|
|
||
| fun getShareableTempAvatarUri(filePath: Path): Uri { | ||
| return FileProvider.getUriForFile(context, context.getProviderAuthority(), filePath.toFile()) | ||
| return context.shareableFileProviderUri(context.fileProviderSharedCacheFile(filePath.name)) |
There was a problem hiding this comment.
Could you clarify this part? It looks like we're creating a new file, but I can't see where it's populated with the avatar data
|
I think this will break Cells code from com.wire.android.feature.cells.util.FileHelper since it is not updated. Will not be able to open Cell files in external apps. |
Unfortunately, there is no e2e tests to verify it but i will test it manually and if it is broken i will handle it in its own PR |



https://wearezeta.atlassian.net/browse/WPB-26687
Summary
General Idea
This stack separates “share externally” from “forward/share inside Wire” while keeping the behavior different per Android version:
flowchart TD A["User taps Share"] --> B{"Android 15+?"} B -- "Yes" --> C["Use Android share sheet"] C --> D["Enable share identity"] D --> E["Wire target can be trusted"] B -- "No" --> F{"Target action"} F -- "Share externally" --> G["Open external chooser"] G --> H["Exclude Wire targets"] F -- "Share via Wire" --> I["Create shared-cache FileProvider URI"] I --> J["Navigate directly to ImportMediaScreen"] J --> K["Validate URI is from Wire shared_files root"] K --> L["Import as pending asset"]Stack
This PR is part of a stacked series:
mo/share-forward-01-share-plumbingShare-safe FileProvider helpers and chooser behavior.
mo/share-forward-02-import-safetyIncoming share validation and trusted Wire caller handling.
mo/share-forward-03-asset-actionsUI split between “Share via Wire” and “Share externally”.
mo/share-forward-04-log-sharingShare logs as one archive, either externally or via Wire.
mo/share-forward-05-stability-baselinesGenerated stability baseline updates.