EBookDroid revoked permission

Support for Android version of Total Commander

Moderators: white, Hacker, petermad, Stefan2

Post Reply
qx87
Junior Member
Junior Member
Posts: 23
Joined: 2011-11-17, 20:51 UTC
Location: Russia

EBookDroid revoked permission

Post by *qx87 »

In the EBookDroid application, for some time now, when opening a book, a message appears
"This book has been deleted or the Total Commander application has revoked reading permissions. Please open the book again through the Total Commander app. Don't worry, the settings, notes and bookmarks for this file are saved" (translated from Russian).

Previously, everything worked fine – it was possible to open a book that had not been opened for years, and now it has become impossible to read books comfortly.

Yes, I can open books with the built-in EBookDroid opener, but I want to use favorite TotalCmd.

Is there any way to fix the situation?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48012
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: EBookDroid revoked permission

Post by *ghisler(Author) »

This happens because Total Commander now sends files to other apps as content: URLs. To make such a link permanent, the target app needs to call a specific function. If it doesn't do that, then Android (not Total Commander!) makes the connection expire.
Author of Total Commander
https://www.ghisler.com
Bvo
Junior Member
Junior Member
Posts: 10
Joined: 2021-10-19, 17:27 UTC

Re: EBookDroid revoked permission

Post by *Bvo »

ghisler(Author) wrote: 2022-04-17, 16:48 UTC This happens because Total Commander now sends files to other apps as content: URLs. To make such a link permanent, the target app needs to call a specific function. If it doesn't do that, then Android (not Total Commander!) makes the connection expire.
The developers said that it's partially true - if the app asks for a file than it's responsible to make the link permanent, if the app's receiving the link than sender responsible for the flag.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48012
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: EBookDroid revoked permission

Post by *ghisler(Author) »

The sending app needs to include the flag "FLAG_GRANT_PERSISTABLE_URI_PERMISSION". Total Commander does that. However, the receiving app also needs to call resolver.takePersistableUriPermission(), otherwise the URL will become invalid after restarting the receiving app.
Author of Total Commander
https://www.ghisler.com
Bvo
Junior Member
Junior Member
Posts: 10
Joined: 2021-10-19, 17:27 UTC

Re: EBookDroid revoked permission

Post by *Bvo »

The dev's answer:
_
The flag must be set when you send an answer to requesting app and only if the app requested permanent link. So the flag is permission to make a link permanent.
But if external app (ex. TC) is initiator of sending a document the flag will be not processed by the system at all.
_
So actually I don't know what is correct implementation to resolve the problem :-(
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48012
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: EBookDroid revoked permission

Post by *ghisler(Author) »

The dev seems to mix up some things here. He is on the receiving end of the intent, so if the intent has the flag FLAG_GRANT_PERSISTABLE_URI_PERMISSION set, he just needs to call resolver.takePersistableUriPermission() with the url he received, that's all.
Author of Total Commander
https://www.ghisler.com
Post Reply