View Single Post
Old 09-24-2020, 05:35 AM   #6
pazos
cosiņeiro
pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.
 
Posts: 1,406
Karma: 2451781
Join Date: Apr 2014
Device: BQ Cervantes 4
Quote:
Originally Posted by Norbi24 View Post
I have just tried to start KOReader from Filemanager+ - and there it works fine !
But on the other hand, if I do the same from CC but set it up to open a book with ALReader or with Neoreader then it works there also ... I mean if ALreader is already open I am still able to open a new book in it from CC.
Thanks for the feedback and the logs. The behaviour of KOReader differs from all the other programs.

When a program receives an intent with a content uri it is expected to copy the stream and save it into its own file (thus making a copy). That's how all programs work (including MoonReader, Readera, Pocketbook, AlReader?)


KOReader tries to resolve the absolute path of the file without making a copy. From the log attached:

Code:
09-24 10:05:10.137  3224  3239 V KOReader: [FileUtils] trying to resolve a file path from content delivered by com.alphainventor.filemanager.fileprovider
09-24 10:05:10.151  3224  3239 I KOReader: intent file path /storage/emulated/0/Calibre_Companion/Conversaci├│n en La Catedral - Mario Vargas Llosa.epub
This is intended as android is BS from the POV of KOReader (or KOReader is BS from the POV of android :P). Sadly there isn't any API for doing that and we're relying on procfs tricks.

The trick works fine with most file providers and, since KOReader is not in the play store, will continue to work as is, as we're not forced to bump target API each few months to publish updates.



Quote:
Originally Posted by Norbi24 View Post
I did a logcat from my attempts with Filemanager+ - at the first glance, it looks like that the command is almost the same - except for the flg property ... with Filemanager+ it is flg=0x10000003, and CC sets it to flg=0x10008001, not sure whether this can make the difference ?
These are activity flags and shouldn't affect the behaviour. KOReader works as a singleInstance app so most of the flags won't affect it. If you're interested you can read these excellent medium post about activity flags and launch modes


TL;DR: If you manage to reproduce the same bug on a different (non onyx) device we can discard fw quirks and point fingers to CC.
OTOH if you reproduce the bug on other apps while opening books in KO we can discard CC bugs and see if we can find a -non hackish - workaround.

If the issue just affects CC I won't try to fix it. Use a chaley version of it, which will start the activity with a file uri scheme and won't require the "guess-the-path" workaround.
pazos is offline   Reply With Quote