Skip to content

fix(upload-list-adapter): FileUriExposedException - #17418

Merged
alperozturk96 merged 2 commits into
masterfrom
fix/fuee-upload-list-adapter
Aug 6, 2026
Merged

fix(upload-list-adapter): FileUriExposedException#17418
alperozturk96 merged 2 commits into
masterfrom
fix/fuee-upload-list-adapter

Conversation

@alperozturk96

Copy link
Copy Markdown
Collaborator

Issue

Exception android.os.FileUriExposedException:
  at android.os.StrictMode.onFileUriExposed (StrictMode.java:2436)
  at android.net.Uri.checkFileUriExposed (Uri.java:2402)
  at android.content.Intent.prepareToLeaveProcess (Intent.java:14038)
  at android.content.Intent.prepareToLeaveProcess (Intent.java:13989)
  at android.content.Intent.prepareToLeaveProcess (Intent.java:13979)
  at android.app.Instrumentation.execStartActivity (Instrumentation.java:2029)
  at android.app.Activity.startActivityForResult (Activity.java:6322)
  at androidx.activity.ComponentActivity.startActivityForResult (ComponentActivity.kt:675)
  at android.app.Activity.startActivityForResult (Activity.java:6279)
  at androidx.activity.ComponentActivity.startActivityForResult (ComponentActivity.kt:660)
  at android.app.Activity.startActivity (Activity.java:6782)
  at android.app.Activity.startActivity (Activity.java:6749)
  at com.owncloud.android.ui.adapter.uploadList.helper.UploadListAdapterHelper.openFileWithDefault (UploadListAdapterHelper.kt:83)
  at com.owncloud.android.ui.adapter.uploadList.helper.UploadListAdapterHelper.onUploadingItemClick (UploadListAdapterHelper.kt:51)
  at com.owncloud.android.ui.adapter.uploadList.UploadListAdapter.bindItemActions$lambda$0$3 (UploadListAdapter.kt:448)
  at com.owncloud.android.ui.adapter.uploadList.UploadListAdapter.$r8$lambda$nJlUXENXnHvpqLr9ID18AOx-kSs (UploadListAdapter.kt)
  at com.owncloud.android.ui.adapter.uploadList.UploadListAdapter$$ExternalSyntheticLambda13.onClick (D8$$SyntheticClass)
  at android.view.View.performClick (View.java:8812)
  at android.view.View.performClickInternal (View.java:8789)
  at android.view.View.-$$Nest$mperformClickInternal (View.java)
  at android.view.View$PerformClick.run (View.java:33811)
  at android.os.Handler.handleCallback (Handler.java:1070)
  at android.os.Handler.dispatchMessage (Handler.java:125)
  at android.os.Looper.dispatchMessage (Looper.java:358)
  at android.os.Looper.loopOnce (Looper.java:288)
  at android.os.Looper.loop (Looper.java:392)
  at android.app.ActivityThread.main (ActivityThread.java:10346)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:638)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:972)

Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
@alperozturk96

Copy link
Copy Markdown
Collaborator Author

/backport to stable-34.1.x

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

This PR addresses FileUriExposedException when opening local upload items by switching from file:// URIs to content:// URIs via FileProvider.

Changes:

  • Use FileProvider.getUriForFile(...) and grant read permission when launching ACTION_VIEW.
  • Refactor upload-item click handling to exit early when the local file exists.
  • Centralize unknown MIME-type fallback to */*.

馃挕 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

APK file: https://github.com/nextcloud/android/actions/runs/30886239130/artifacts/8883988716
To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.
qrcode (please click on link to get QR code displayed)

Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
@alperozturk96
alperozturk96 merged commit 87ac140 into master Aug 6, 2026
18 of 21 checks passed
@alperozturk96
alperozturk96 deleted the fix/fuee-upload-list-adapter branch August 6, 2026 06:59
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

blue-Light-Screenshot test failed, but no output was generated. Maybe a preliminary stage failed.

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codacy

SpotBugs

CategoryBaseNew
Bad practice3232
Correctness6464
Dodgy code216217
Experimental11
Malicious code vulnerability22
Multithreaded correctness2525
Performance4040
Security1919
Total399400

SpotBugs increased!

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

APK file: https://github.com/nextcloud/android/actions/runs/31079227786/artifacts/8959104693
To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.
qrcode (please click on link to get QR code displayed)

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants