Clover icon indicating copy to clipboard operation
Clover copied to clipboard

Use FileProvider to open videos in external apps

Open RaynebowDeathtrap opened this issue 8 years ago • 5 comments

I cannot use MX Player or any other external player for viewing WEBMs

I go to open a WEBM file and Clover crashes. I have the external player setting on and I've tried switching that feature on and off multiple times.

Android version: Android 7.0 (literally updated to this not two days ago) Phone model: SM-920T (Samsung Galaxy Note5) Clover version: v2.3.0 F-Droid

RaynebowDeathtrap avatar Apr 28 '17 03:04 RaynebowDeathtrap

I cannot reproduce this, on various players. Android 7.1.2. Is there anyone else experiencing this bug?

floens avatar Jun 13 '17 17:06 floens

I do. Here is logcat:

06-17 22:18:22.112 18616 18616 D AndroidRuntime: Shutting down VM
06-17 22:18:22.115 18616 18616 E AndroidRuntime: FATAL EXCEPTION: main
06-17 22:18:22.115 18616 18616 E AndroidRuntime: Process: org.floens.chan, PID: 18616
06-17 22:18:22.115 18616 18616 E AndroidRuntime: android.os.FileUriExposedException: file:///storage/emulated/0/Android/data/org.floens.chan/cache/filecache/-1048508615 exposed beyond app through Intent.getData()
06-17 22:18:22.115 18616 18616 E AndroidRuntime: 	at android.os.StrictMode.onFileUriExposed(StrictMode.java:1796)
06-17 22:18:22.115 18616 18616 E AndroidRuntime: 	at android.net.Uri.checkFileUriExposed(Uri.java:2347)
06-17 22:18:22.115 18616 18616 E AndroidRuntime: 	at android.content.Intent.prepareToLeaveProcess(Intent.java:9030)
06-17 22:18:22.115 18616 18616 E AndroidRuntime: 	at android.content.Intent.prepareToLeaveProcess(Intent.java:8991)
06-17 22:18:22.115 18616 18616 E AndroidRuntime: 	at android.app.Instrumentation.execStartActivity(Instrumentation.java:1519)
06-17 22:18:22.115 18616 18616 E AndroidRuntime: 	at android.app.ContextImpl.startActivity(ContextImpl.java:791)
06-17 22:18:22.115 18616 18616 E AndroidRuntime: 	at android.app.ContextImpl.startActivity(ContextImpl.java:768)
06-17 22:18:22.115 18616 18616 E AndroidRuntime: 	at android.content.ContextWrapper.startActivity(ContextWrapper.java:356)
06-17 22:18:22.115 18616 18616 E AndroidRuntime: 	at org.floens.chan.b.a.a(AndroidUtils.java:178)
06-17 22:18:22.115 18616 18616 E AndroidRuntime: 	at org.floens.chan.ui.view.o.setVideoFile(MultiImageView.java:357)
06-17 22:18:22.115 18616 18616 E AndroidRuntime: 	at org.floens.chan.ui.view.o.c(MultiImageView.java:53)
06-17 22:18:22.115 18616 18616 E AndroidRuntime: 	at org.floens.chan.ui.view.t.a(MultiImageView.java:336)
06-17 22:18:22.115 18616 18616 E AndroidRuntime: 	at org.floens.chan.core.a.a.a(FileCache.java:136)
06-17 22:18:22.115 18616 18616 E AndroidRuntime: 	at org.floens.chan.ui.view.o.setVideo(MultiImageView.java:323)
06-17 22:18:22.115 18616 18616 E AndroidRuntime: 	at org.floens.chan.ui.view.o.d(MultiImageView.java:53)
06-17 22:18:22.115 18616 18616 E AndroidRuntime: 	at org.floens.chan.ui.view.p.a(MultiImageView.java:130)
06-17 22:18:22.115 18616 18616 E AndroidRuntime: 	at org.floens.chan.b.a.a(AndroidUtils.java:325)
06-17 22:18:22.115 18616 18616 E AndroidRuntime: 	at org.floens.chan.b.a.a(AndroidUtils.java:297)
06-17 22:18:22.115 18616 18616 E AndroidRuntime: 	at org.floens.chan.ui.view.o.setMode(MultiImageView.java:116)
06-17 22:18:22.115 18616 18616 E AndroidRuntime: 	at org.floens.chan.ui.a.d.a(ImageViewerAdapter.java:90)
06-17 22:18:22.115 18616 18616 E AndroidRuntime: 	at org.floens.chan.ui.b.at.a(ImageViewerController.java:275)
06-17 22:18:22.115 18616 18616 E AndroidRuntime: 	at org.floens.chan.core.h.a.g(ImageViewerPresenter.java:196)
06-17 22:18:22.115 18616 18616 E AndroidRuntime: 	at org.floens.chan.core.h.a.a(ImageViewerPresenter.java:153)
06-17 22:18:22.115 18616 18616 E AndroidRuntime: 	at org.floens.chan.ui.view.o.a(MultiImageView.java:491)
06-17 22:18:22.115 18616 18616 E AndroidRuntime: 	at org.floens.chan.ui.view.o.a(MultiImageView.java:53)
06-17 22:18:22.115 18616 18616 E AndroidRuntime: 	at org.floens.chan.ui.view.q.a(MultiImageView.java:193)
06-17 22:18:22.115 18616 18616 E AndroidRuntime: 	at com.a.a.b.q.run(ImageLoader.java:451)
06-17 22:18:22.115 18616 18616 E AndroidRuntime: 	at android.os.Handler.handleCallback(Handler.java:751)
06-17 22:18:22.115 18616 18616 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:95)
06-17 22:18:22.115 18616 18616 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:154)
06-17 22:18:22.115 18616 18616 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:6236)
06-17 22:18:22.115 18616 18616 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
06-17 22:18:22.115 18616 18616 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:891)
06-17 22:18:22.115 18616 18616 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:781)
06-17 22:18:22.121 28029 28701 W ActivityManager:   Force finishing activity org.floens.chan/.ui.activity.BoardActivity
06-17 22:18:22.143 28029 28701 W ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:877 com.android.server.am.AppErrors.crashApplicationInner:375 com.android.server.am.AppErrors.crashApplication:309 com.android.server.am.ActivityManagerService.handleApplicationCrashInner:13750 com.android.server.am.ActivityManagerService.handleApplicationCrash:13732 
06-17 22:18:22.146 31447 31447 E AppCrashReceiver: org.floens.chan stopped unexpectedly...

Android 7.1.2 HTC One M9 Clover v2.3.0 F-Droid

niririke avatar Jun 17 '17 13:06 niririke

Relevant stackoverflow question @Floens It's strange you don't have any problem with it.

niririke avatar Jun 17 '17 13:06 niririke

Yeah I figured that exposing a file like that would be the issue, but strictmode didn't trigger the exception for me. As a workaround, we can disable strictmode when starting the intent for the external player. For a proper fix we need to properly integrate with the "new" Android storage framework, as you liked above and talked about in #178.

floens avatar Jun 17 '17 14:06 floens

For me it crashes only on release builds. On debug builds it just prints error in logcat. It seems that's expected though. Maybe you are running a debug build?

niririke avatar Jun 17 '17 20:06 niririke