mvysny / aedict

Original Aedict 2 source codes
http://www.aedict.eu
GNU General Public License v3.0
40 stars 7 forks source link

Custom storage path and/or history backup and restore feature request #980

Closed ImprovingRigmarole closed 7 months ago

ImprovingRigmarole commented 10 months ago

Hi,

thanks a lot for this app

Here's my specific use case : I changed phone on which I had an old version of which I have access to aedict's recentlyviewed.bin and I'd like to import those in the last version I've (finally) installed on the new device, and eventually be able to back it up again if needed...

Until now I've been able to set a custom folder in internal storage where aedict was both storing dictionaries and writing the recentlyviewed.bin file, but on the dictionary manager I haven't been able to change the folder, there was a popup, but it didn't show the whole text...

Both old and new Android phones run Android 13, and the old aedict version I had never seemed to have any problem to access the global storage folder, so I was wondering why it wasn't possible anymore when the OS versions are the same.

Thanks forward

mvysny commented 10 months ago

Hi, thanks a lot for using the app :)

What you write is unfortunately intentional, and I am forced to do so by Google. The explanation is as follows.

Until recent Aedict release, Aedict was running in a "compatibility mode", or more precisely, targeting Android SDK 31. When an app targets Android SDK 31, it is allowed to read/write an "external SD Card" (which translates to almost anywhere on the filesystem).

However, since 1. august 2023, all apps on Google Play must target Android SDK 33: https://developer.android.com/google/play/requirements/target-sdk . When the app targets SDK 33, the compatibility mode is disabled and the app is no longer allowed to read/write to an "external SD Card" just anything anywhere, but the access is far more limited. Please read more here: https://developer.android.com/about/versions/13/behavior-changes-13#granular-media-permissions

In other words, Aedict in the SDK 33 mode can no longer ask for READ_EXTERNAL_STORAGE/WRITE_EXTERNAL_STORAGE but is only allowed to ask for read-only access for images, audio or video. Unfortunately the bin files are neither of that; and even if they were, Aedict would need to have write permissions, which it doesn't.

To sum it up: even though your app still runs Android 13, the problem is that Aedict is no longer allowed to run in the "compatibility mode", and hence doesn't have write access just anywhere, except for its own private folders.

The only way forward could be to have an import/export functionality, where the bin file may be exported to, say, Google Drive. Alternatively, upgrade to the UMN file system, activate Aedict Ultimate and have your data automatically synced between all devices and stored on Aedict-Online.

ImprovingRigmarole commented 10 months ago

Hi,

Thanks a lot for this detailed insight in the problem (and thanks Google for more privacy but less functionality 😬) !

I just thought about the fact that what'sapp messenger still has a Document file send thing which can access a (system?) file picker, I wonder which authorization gives it this power... so either they still haven't switched to SDK 33 (and still use the compatibility mode), or there's a shady unclear authorization they're able to exploit 🤔.

The only way forward could be to have an import/export functionality, where the bin file may be exported to, say, Google Drive. Alternatively, upgrade to the UMN file system, activate Aedict Ultimate and have your data automatically synced between all devices and stored on Aedict-Online.

The latest version actually crashes when accessing any entry (probably when it tries to write the bin file where it can't) if I try to set the Storage Type to File-based in the latest Aedict version so I can only use the UMN file system apparently !

I've activated Aedict Ultimate when I installed the newest version, so either the GoogleDrive (or anything else) import/export or the Aedict-Online sync feature would work for me, but in this last case I'd still need a way to have a recentlyviewed.bin file import/export in Aedict-Online (probably easier since browser can request any file ig) so it overwrites its db with it.

Thanks a lot for the feedback !

ImprovingRigmarole commented 7 months ago

Closing this, as the requested feature probably won't benefit much people, and I realized I don't actually need it anymore.