-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Enhancement: AnkiDroid should not use Storage permission (Deadline November 2021) #5304
Comments
I don't disagree. Please feel free to propose a PR, it must be backwards compatible with existing installs |
@mikehardy Is this done?Or Can I work on this? |
This is not done - and no one is working on it that I am aware of. I'm unsure of the requirements for acceptance - I mentioned "backwards-compatible with existing installs" but I have not thought through what that means. @timrae was thinking about this before and likely has ideas - Tim do you have any specific thoughts? And @MonikaJethani I will say that since this affects the app very deeply - it is where people have their beloved collections stored :-) - probably best to post your detailed implementation idea here before starting work, or if you use code to flesh out the idea propose a PR but prepared for the whole approach to be questioned at the idea level until we're sure it will work. But hopefully that doesn't sound too discouraging, it would be great for AnkiDroid to use the system directory access APIs and not require special permission, and a PR that did that would be great in my opinion |
@mikehardy I would implement it thusly:
Using the new preference should have the same semantics as changing the "AnkiDroid directory" preference which, as far as I know, just initializes the new directory and doesn't touch the old directory. In the long run, the "AnkiDroid directory" preference will become obsolete because apps targeting Android Q will not be able to access external storage (they will be given a sandboxed view and must use specific APIs which is a huge privacy improvement). |
Solid start - interesting, I try to read the preview API changes but haven't had time for Q as of yet. I have read it now though, and I have a slightly different take on Q's changes though - 2 big things:
as well as:
This makes me think that we could continue to access So I would propose a slightly different idea -
This would get us to a place where we were able to work in either of the three areas - a big step and functional / usable at this point. But it would just initialize the directory, as you say.
This part is vital or if I understand the scoped-storage Q-sandbox we may have to implement DocumentsProvider access and the DOCUMENT_TREE intent thing just to keep accessing /sdcard/AnkiDroid or we will orphan the data of a 1.3 million active user installed base (!) Finally, I note this warning on the Q link, which is I think talking about the year 2020 R platform:
So that gives us around a year to get this done and have it rolled out long enough to migrate people, which leads to the final step:
What do you think? Not especially different for the first step I think, but a little twist there (prefer external), but the 2nd (migration) and 3rd (popup to push migration) are big differences. ? |
We used to have a setting for this, which nobody used. We can't make it the default location as many people have collections on the order of hundreds of megabytes. This is not an approach that I would be willing to take. |
Ideally I'd like to avoid add a preference for this. We should just migrate to the new APIs as needed. Most likely that means increasing the minimum SDK, so we'll need to discuss the best way to handle that. |
From an implementation perspective, I think this issue is the same as #3106. It's not a small job, but if you have the time and patience to see it through to the end then I'd be very happy to start a design discussion. |
No preference - fine by me. I can imagine that being very simplifying As for the API mention, the only necessary API I think is https://developer.android.com/reference/android/content/Context#getExternalFilesDir(java.lang.String) which is API8 If we had to DocumentsProvider for some reason (which we would not, assuming we moved inside of Context#getExternalFilesDir, if I understand correctly), that's API19 / KitKat / 4.4 and represents about 11,000 active users out of about 1,127,000 according to the play store just now. Easily a 2.10 bump and justifiable for 2.9 this moment if it opened things up for this work to proceed cleanly, IMHO |
@timrae All devices that AnkiDroid supports should use the same underlying storage for internal storage and external storage. If users are using a microSD card, that is not the same as the path returned by |
As far as I know, that's incorrect. Most devices have a separate partition on the internal SD card with root only permissions, and this is where the applications and application data (Context#getFilesDir) gets stored. This partition is much smaller than the non-root partition, so you can't store large files there. |
I was thinking the same thing but wanted to back it up with docs or a test and didn't have time - I do believe they have differences though, just wanted proof |
@timrae Most devices that ship with Android 4 and above (which is the minimum API level supported by AnkiDroid) use a single partition, and a FUSE filesystem to emulate the SD card. The only devices that support AnkiDroid and use a separate partition will be devices that shipped with an old version of Android and are running a custom ROM or a few low-end exceptions. |
Hmm, I'm away from my computer ATM, but I found someone's df output which
seems to agree with what you're saying
https://android.stackexchange.com/a/119072
It seems like a dangerous and unnecessary assumption to make though, since
it's entirely up to the manufacturer what limitations they place on the
size of the /data virtual partition.
…On Sat., 25 May 2019, 5:42 pm Saleem Rashid, ***@***.***> wrote:
@timrae <https://github.com/timrae> Most devices that ship with Android 4
and above (which is the minimum API level supported by AnkiDroid) use a
single partition, and a FUSE filesystem to emulate the SD card.
The only devices that support AnkiDroid and use a separate partition will
be devices running a custom ROM or a few low-end exceptions.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5304?email_source=notifications&email_token=AAVQBYX334LKL2MACWYXEITPXD3XXA5CNFSM4HMI2STKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWHKOAA#issuecomment-495888128>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAVQBYU4NONQ5LHUBOIUV5LPXD3XXANCNFSM4HMI2STA>
.
On Sat., 25 May 2019, 5:42 pm Saleem Rashid, ***@***.***> wrote:
@timrae <https://github.com/timrae> Most devices that ship with Android 4
and above (which is the minimum API level supported by AnkiDroid) use a
single partition, and a FUSE filesystem to emulate the SD card.
The only devices that support AnkiDroid and use a separate partition will
be devices running a custom ROM or a few low-end exceptions.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5304?email_source=notifications&email_token=AAVQBYX334LKL2MACWYXEITPXD3XXA5CNFSM4HMI2STKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWHKOAA#issuecomment-495888128>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAVQBYU4NONQ5LHUBOIUV5LPXD3XXANCNFSM4HMI2STA>
.
|
I'm not so familiar with storage and permission management on Android and so I can't say for sure whether I got it all correctly, but from my understanding my issue (which I was hesitant to open a new thread for) is related to the above. I have an Android 6.0.1 and the latest Ankidroid app installed. I have an SD card to which I moved the Anki app via the application manager, since it has more storage capacity than my phone's internal storage. |
Hi sorry I accidentally pressed the close button. Your assessment that Ankidroid does not treat the flashcard and media databases as part of the app is correct. We do not officially support using external SD cards. However there is a workaround available to get this working if you wish to s do it anyway. Please read the FAQ for more info on this. |
Hello 👋, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically |
I had some recent experience with this where if you use the directories provided as getExternalStorage I think you can actually drop the permission. Problem being that we don't use that directory currently. Either way this is a popular request, I'll leave it open |
Hello, can you tell me if the Alpha Version are better than Play Store version? Do you think I should upgrade to an Alpha version or continue using the Google Play version? |
@AndreHero007 it depends. Do you want the V3 scheduler? Alpha is the only way. Are you willing to accept some instability that could disrupt your studies and/or create the need to reinstall AnkiDroid, redownload everything? Then the Alpha is a terrible idea. Need some specific new mathjax thing? Alpha is the only way right now. Are not comfortable with reporting app crashes, helping fix problems? Alpha is a terrible idea. I can't recommend anything to anyone, it depends on use case and person |
For example, this feature "Cloze deletions can now be nested inside other cloze deletions" doesn't seem to work on AnkiDroid. Does it work on Alpha versions? |
@AndreHero007 it may? Try a parallel version and see - that's relatively low risk |
A script to enable/disable scoped storage without the need to uninstall/upgrade from `targetSdkVersion 29` Makes testing of the disable/enable routine quicker Issue ankidroid#5304
A script to enable/disable scoped storage without the need to uninstall/upgrade from `targetSdkVersion 29` Makes testing of the disable/enable routine quicker Issue ankidroid#5304
A script to enable/disable scoped storage without the need to uninstall/upgrade from `targetSdkVersion 29` Makes testing of the disable/enable routine quicker Issue ankidroid#5304
A script to enable/disable scoped storage without the need to uninstall/upgrade from `targetSdkVersion 29` Makes testing of the disable/enable routine quicker Issue ankidroid#5304
A script to enable/disable scoped storage without the need to uninstall/upgrade from `targetSdkVersion 29` Makes testing of the disable/enable routine quicker Issue ankidroid#5304
A script to enable/disable scoped storage without the need to uninstall/upgrade from `targetSdkVersion 29` Makes testing of the disable/enable routine quicker Issue #5304
🥇 |
A script to enable/disable scoped storage without the need to uninstall/upgrade from `targetSdkVersion 29` Makes testing of the disable/enable routine quicker Issue ankidroid#5304
Reproduction Steps
Expected Result
AnkiDroid should default to a directory that doesn't require
WRITE_EXTERNAL_STORAGE
. For example,/data/data/com.ichi2.anki/files/
(Context.getFilesDir()
) or/sdcard/Android/data/com.ichi2.anki/
(Context.getExternalFilesDirs(null)
).Actual Result
AnkiDroid defaults to
/sdcard/AnkiDroid
and exits with "AnkiDroid directory is inaccessible".Research
I have read the support page and am reporting a bug or enhancement request specific to AnkiDroid
I have checked the manual and the FAQ and could not find a solution to my issue
I have searched for similar existing issues here and on the user forum
The text was updated successfully, but these errors were encountered: