12-27-2019, 12:06 PM | #16 | |||
cosiñeiro
Posts: 1,271
Karma: 2200049
Join Date: Apr 2014
Device: BQ Cervantes 4
|
Quote:
While it isn't nice to use StrictMode on production we can override VM policies and get rid of the DeathOnFileUriExposure penalty, just by using the following code on a application subclass (or the kotlin equivalent): Code:
StrictMode.setVmPolicy((new StrictMode.VmPolicy.Builder()).build()) Quote:
I help in the android port of koreader, which uses generic filesystem api across all platforms, and the future for us is to stick in the places where fs api still work and import content there using SAF. As ko is a document viewer we don't share files with other activities but we will need to remove intent filters for handling action.VIEW because even when the uri has a file scheme we won't have permissions to read from that path. There's a work in progress Pull Request Quote:
ps: if Sam is reading this: feel free to pick the workaround and apply it in production. You're not alone: Moonreader and most vendor file managers are still doing this. |
|||
12-30-2019, 11:09 AM | #17 |
cosiñeiro
Posts: 1,271
Karma: 2200049
Join Date: Apr 2014
Device: BQ Cervantes 4
|
A quick update: I just uploaded a sample activity that showcases how to workaround the two issues mentioned on this thread. As chaley said this won't work as intended if scoped storage is enforced, but should allow to still use android apps built with latest api level (29) using the good old "everything is a file" paradigm.
The repo: https://github.com/pazos/filesResolver Feel free to use for whatever you want. |
Advert | |
|
Tags |
shortcut, shortcuts |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
M92 screen doesn´t work | juliosoft | Onyx Boox | 3 | 01-18-2013 05:35 AM |
Touch Home button doesn't work after 2.3.1 update. | Ravenesque | Kobo Reader | 3 | 12-21-2012 02:14 PM |
Library doesn't work, eInk side stuck with "Home" screen | andr2k | enTourage eDGe | 4 | 08-04-2012 08:37 AM |
No hibernate option, Home doesn't work | tomsem | enTourage eDGe | 13 | 08-02-2011 05:41 AM |
Adding new format to a book doesn't work | owockadoy | Calibre | 3 | 11-09-2009 11:52 AM |