Skip to content

feat: Wire forwarding and external sharing [WPB-26687] - #5115

Open
MohamadJaara wants to merge 15 commits into
developfrom
epic/forward-vs-external-share
Open

feat: Wire forwarding and external sharing [WPB-26687]#5115
MohamadJaara wants to merge 15 commits into
developfrom
epic/forward-vs-external-share

Conversation

@MohamadJaara

@MohamadJaara MohamadJaara commented Jul 30, 2026

Copy link
Copy Markdown
Member

https://wearezeta.atlassian.net/browse/WPB-26687

What changed

This epic integrates the Wire forwarding and external-sharing work while hardening every URI import boundary:

  • separates in-app Wire forwarding from Android external sharing actions
  • adds share-safe FileProvider helpers and guarded internal import routing
  • supports sharing logs through Wire and secures Cells sharing
  • allows only content:// URIs for asset imports
  • recognizes Android user-qualified authorities such as 10@com.wire.android.provider for security comparison while preserving the original URI
  • validates the launch caller's read access for every Wire-provider URI on Android 15+
  • captures each intent together with its caller-permission result so a later intent cannot authorize an earlier queued intent
  • fails closed when Wire-provider caller access cannot be verified

Stack

The following PRs were reviewed and merged into epic/forward-vs-external-share:

  1. refactor: add share-safe file provider helpers PR 1 [WPB-26687] #5033 — Share-safe FileProvider helpers
  2. feat: guard internal Wire share imports PR2 [WPB-26687] #5034 — Guard internal Wire share imports
  3. feat: Split Asset Share Actions PR 3 [WPB-26687] #5035 — Split asset share actions
  4. feat: share logs via Wire PR 4 [WPB-26687] #5036 — Share logs via Wire
  5. chore: update stability baselines PR 5 [WPB-26687] #5037 — Update stability baselines
  6. fix(cells): secure file sharing [WPB-26687] PR 6 #5081 — Secure Cells file sharing

This PR is the final epic integration into develop, plus the content-scheme and cross-profile caller-validation follow-ups.

@pull-request-size

Copy link
Copy Markdown

Ups 🫰🟨

This PR is too big. Please try to break it up into smaller PRs.

@MohamadJaara MohamadJaara changed the title feat: secure Wire forwarding and external sharing [WPB-26687] feat: Wire forwarding and external sharing [WPB-26687] Jul 30, 2026
@MohamadJaara
MohamadJaara marked this pull request as ready for review July 30, 2026 12:37
@codecov

codecov Bot commented Jul 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 46.56863% with 109 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.04%. Comparing base (d10673c) to head (cea62e8).
⚠️ Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
...id/ui/sharing/ImportMediaAuthenticatedViewModel.kt 54.09% 22 Missing and 6 partials ⚠️
.../kotlin/com/wire/android/util/SecureFileSharing.kt 61.53% 9 Missing and 11 partials ⚠️
...e/android/ui/home/gallery/MediaGalleryViewModel.kt 38.88% 11 Missing ⚠️
...kotlin/com/wire/android/util/logging/LogSharing.kt 0.00% 11 Missing ⚠️
.../src/main/kotlin/com/wire/android/util/FileUtil.kt 0.00% 8 Missing ⚠️
...otlin/com/wire/android/ui/WireActivityViewModel.kt 76.47% 0 Missing and 4 partials ⚠️
...n/com/wire/android/ui/edit/ShareAssetMenuOption.kt 0.00% 4 Missing ⚠️
.../com/wire/android/ui/WireActivityActionsHandler.kt 0.00% 3 Missing ⚠️
...nversations/edit/MessageOptionsModalSheetLayout.kt 0.00% 3 Missing ⚠️
...rsations/messages/ConversationMessagesViewModel.kt 0.00% 3 Missing ⚠️
... and 7 more

❌ Your patch check has failed because the patch coverage (46.56%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #5115      +/-   ##
===========================================
+ Coverage    49.87%   50.04%   +0.17%     
===========================================
  Files          666      671       +5     
  Lines        24291    24417     +126     
  Branches      3765     3802      +37     
===========================================
+ Hits         12114    12219     +105     
+ Misses       11059    11058       -1     
- Partials      1118     1140      +22     
Files with missing lines Coverage Δ
...rc/main/kotlin/com/wire/android/ui/WireActivity.kt 62.99% <ø> (ø)
.../userprofile/avatarpicker/AvatarPickerViewModel.kt 91.78% <100.00%> (ø)
...c/main/kotlin/com/wire/android/util/FileManager.kt 17.24% <100.00%> (+8.46%) ⬆️
.../main/kotlin/com/wire/android/util/FileNameUtil.kt 100.00% <100.00%> (ø)
...ndroid/ui/sharing/ImportMediaAuthenticatedState.kt 87.50% <0.00%> (ø)
...kotlin/com/wire/android/ui/MiscViewModelFactory.kt 0.00% <0.00%> (ø)
...ain/kotlin/com/wire/android/ui/debug/LogOptions.kt 0.00% <0.00%> (ø)
.../com/wire/android/ui/sharing/ImportMediaNavArgs.kt 0.00% <0.00%> (ø)
...kotlin/com/wire/android/util/AvatarImageManager.kt 0.00% <0.00%> (ø)
.../com/wire/android/feature/cells/util/FileHelper.kt 31.48% <33.33%> (+31.48%) ⬆️
... and 11 more

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d10673c...cea62e8. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Test Results

2 191 tests  +38   2 191 ✅ +38   1m 47s ⏱️ -20s
  237 suites + 3       0 💤 ± 0 
  237 files   + 3       0 ❌ ± 0 

Results for commit cea62e8. ± Comparison against base commit d10673c.

This pull request removes 1 and adds 39 tests. Note that renamed tests count towards both.
com.wire.android.ui.home.conversations.usecase.HandleUriAssetUseCaseTest ‑ given an invalid url schema, when invoked, then result should not succeed
com.wire.android.feature.cells.util.FileHelperSharingTest ‑ givenCellFileOutsideProviderRoot_whenOpeningExternally_thenSharedCacheUriIsGranted
com.wire.android.feature.cells.util.FileHelperSharingTest ‑ givenCellFileOutsideProviderRoot_whenSharingExternally_thenChooserContainsSharedCacheUri
com.wire.android.ui.WireActivityViewModelTest ‑ given trusted sharing intent with mixed Wire and external provider uris, when handling deep link, then import media screen is shown()
com.wire.android.ui.WireActivityViewModelTest ‑ given untrusted sharing intent with external provider uris, when handling deep link, then import media screen is shown()
com.wire.android.ui.WireActivityViewModelTest ‑ given untrusted sharing intent with mixed Wire and external provider uris, when handling deep link, then show ignored toast()
com.wire.android.ui.WireActivityViewModelTest ‑ given untrusted sharing intent with work-profile Wire provider uri, when handling deep link, then show ignored toast()
com.wire.android.ui.home.conversations.usecase.HandleUriAssetUseCaseTest ‑ given an unsupported URI scheme, when invoked, then result should not succeed
com.wire.android.ui.sharing.ImportMediaAuthenticatedViewModelTest ‑ given Wire provider uri from trusted Wire caller, when checking public share rejection, then allow it()
com.wire.android.ui.sharing.ImportMediaAuthenticatedViewModelTest ‑ given Wire provider uri outside shared files, when checking internal share uri, then reject it()
com.wire.android.ui.sharing.ImportMediaAuthenticatedViewModelTest ‑ given Wire provider uri under shared files, when checking internal share uri, then allow it()
…

♻️ This comment has been updated with latest results.

@github-actions

Copy link
Copy Markdown
Contributor

APKs built during tests are available here. Scroll down to Artifacts!

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants