Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StrictMode: java.lang.Throwable: file:// Uri exposed through ClipData.Item.getUri() #96

Open
Malachiasz opened this issue Apr 8, 2019 · 0 comments

Comments

@Malachiasz
Copy link

Malachiasz commented Apr 8, 2019

In version 0.8.0, timber module, clicking Show logs, clicking share, causes strict mode exception:

04-08 14:49:15.571  6476  6476 E StrictMode: null
04-08 14:49:15.571  6476  6476 E StrictMode: java.lang.Throwable: file:// Uri exposed through ClipData.Item.getUri()
04-08 14:49:15.571  6476  6476 E StrictMode: 	at android.os.StrictMode.onFileUriExposed(StrictMode.java:1757)
04-08 14:49:15.571  6476  6476 E StrictMode: 	at android.net.Uri.checkFileUriExposed(Uri.java:2346)
04-08 14:49:15.571  6476  6476 E StrictMode: 	at android.content.ClipData.prepareToLeaveProcess(ClipData.java:825)
04-08 14:49:15.571  6476  6476 E StrictMode: 	at android.content.Intent.prepareToLeaveProcess(Intent.java:8036)
04-08 14:49:15.571  6476  6476 E StrictMode: 	at android.app.Instrumentation.execStartActivity(Instrumentation.java:1506)
04-08 14:49:15.571  6476  6476 E StrictMode: 	at android.app.Activity.startActivityForResult(Activity.java:3917)
04-08 14:49:15.571  6476  6476 E StrictMode: 	at androidx.fragment.app.FragmentActivity.startActivityForResult(FragmentActivity.java:767)
04-08 14:49:15.571  6476  6476 E StrictMode: 	at android.app.Activity.startActivityForResult(Activity.java:3877)
04-08 14:49:15.571  6476  6476 E StrictMode: 	at androidx.fragment.app.FragmentActivity.startActivityForResult(FragmentActivity.java:754)
04-08 14:49:15.571  6476  6476 E StrictMode: 	at android.app.Activity.startActivity(Activity.java:4200)
04-08 14:49:15.571  6476  6476 E StrictMode: 	at android.app.Activity.startActivity(Activity.java:4168)
04-08 14:49:15.571  6476  6476 E StrictMode: 	at android.content.ContextWrapper.startActivity(ContextWrapper.java:331)
04-08 14:49:15.571  6476  6476 E StrictMode: 	at io.palaima.debugdrawer.timber.util.Intents.maybeStartActivity(Intents.java:17)
04-08 14:49:15.571  6476  6476 E StrictMode: 	at io.palaima.debugdrawer.timber.ui.LogDialog$5.onSave(LogDialog.java:92)
04-08 14:49:15.571  6476  6476 E StrictMode: 	at io.palaima.debugdrawer.timber.data.LumberYard.save(LumberYard.java:118)
04-08 14:49:15.571  6476  6476 E StrictMode: 	at io.palaima.debugdrawer.timber.ui.LogDialog.share(LogDialog.java:86)
04-08 14:49:15.571  6476  6476 E StrictMode: 	at io.palaima.debugdrawer.timber.ui.LogDialog.access$000(LogDialog.java:21)
04-08 14:49:15.571  6476  6476 E StrictMode: 	at io.palaima.debugdrawer.timber.ui.LogDialog$2.onClick(LogDialog.java:47)
04-08 14:49:15.571  6476  6476 E StrictMode: 	at androidx.appcompat.app.AlertController$ButtonHandler.handleMessage(AlertController.java:167)
04-08 14:49:15.571  6476  6476 E StrictMode: 	at android.os.Handler.dispatchMessage(Handler.java:102)
04-08 14:49:15.571  6476  6476 E StrictMode: 	at android.os.Looper.loop(Looper.java:148)
04-08 14:49:15.571  6476  6476 E StrictMode: 	at android.app.ActivityThread.main(ActivityThread.java:5417)
04-08 14:49:15.571  6476  6476 E StrictMode: 	at java.lang.reflect.Method.invoke(Native Method)
04-08 14:49:15.571  6476  6476 E StrictMode: 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
04-08 14:49:15.571  6476  6476 E StrictMode: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

Basically file sharing is not allowed since Android N
https://commonsware.com/blog/2016/03/14/psa-file-scheme-ban-n-developer-preview.html

https://stackoverflow.com/questions/32623304/when-take-photo-get-java-lang-throwable-file-uri-exposed-through-clipdata

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant