-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Support SAF properly #3777
Support SAF properly #3777
Conversation
app/src/main/java/org/schabi/newpipe/settings/ContentSettingsFragment.java
Outdated
Show resolved
Hide resolved
if (startPath != null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { | ||
i.putExtra(DocumentsContract.EXTRA_INITIAL_URI, Uri.parse(startPath)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently we're not using this
@imcmjha, @domiuns, @opusforlife2: Would you mind testing this? You should test whether all file pickers (import/export DB, import/export subscription, download) show the correct file picker (SAF or NoNonsense-FilePicker) and whether saving or reading that file works correctly. On Android 4.4-, SAF should be disabled and impossible to enable. On Android 5-9, SAF should be enabled by default. On Android 10+, SAF should be enabled and impossible to disable. |
I have Android 9:
|
No, as different storage providers will start with a different thing.
You mean when you open the downloads activity where you could see all the things you downloaded? Hmm… that setting shouldn't be changed unless the user changes it (or you upgrade to Android 10+, as then only SAF will be possible).
I'm pretty sure I fixed that bug, though maybe only for Android 10 or maybe I forgot to update the APK in this issue.
That can't be done with SAF, because you don't know what that path would be and you have to acquire permission to be able to use that (only possible by opening the directory picker for that).
What do you mean? |
Some questions that came up while bug testing:
|
No, I mean the download settings menu. Sorry, that was ambiguous.
Leave it. It's just a precaution. I'll test it once the above bug is fixed. |
Export/Import DB also seems to work fine with both SAF and NNFP. Question: Does export/import DB work like a complete app backup, or does it leave something out? |
@opusforlife2: It should be a complete app backup, other than the download history. |
Alright. Then everything works. 👍 |
I tested in Android 9 and it is working perfectly. Bug 3465 resolved. Thanks a lot. |
@opusforlife2: I fixed the bug regarding SAF looking like it was enabled again when opening the download settings. Could you try the new APK (it also includes #3781, which shouldn't change anything for users)? Also, did you notice how the download dialog now shows a directory picker when you haven't set a download folder yet? Btw the only thing that I haven't tested yet is an upgrade from Android 5-9 to Android 10+ and an upgrade from previous NewPipe to NewPipe with this PR. |
Confirmed fixed.
I didn't know that it didn't before. This is the first time I'm using SAF. Good, though. Adds to the seamlessness. |
Everything seems to work correctly on Android 10 |
With SAF it works fine on android 10 … but the import / export will pick the last used folder, both import or download Let's say you export in NewPipe/Save, download musics in NewPipe/Music, videos in NewPipe/Videos. Music will always be downloaded in NewPipe/Music, and videos in NewPipe/Videos. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, though I haven't worked much with the downloader so far, so I don't know if my opinion is really useful. Could you provide a decryption-fix-updated apk, please? Also for the other PRs of yours
app/src/main/java/org/schabi/newpipe/settings/ContentSettingsFragment.java
Outdated
Show resolved
Hide resolved
app/src/main/java/org/schabi/newpipe/settings/ContentSettingsFragment.java
Outdated
Show resolved
Hide resolved
app/src/main/java/org/schabi/newpipe/settings/DownloadSettingsFragment.java
Outdated
Show resolved
Hide resolved
app/src/main/java/org/schabi/newpipe/settings/NewPipeSettings.java
Outdated
Show resolved
Hide resolved
@wb9688 when try to import all setting as zip app crash. |
@domiuns: On 4.4? What error are you getting? |
@Srypox this apk work #3777 (comment) |
After merging this we should add a setting migration that enables SAF on every device possible, and then let the user disable it if they want, otherwise almost nobody would know the switch exists |
Is there any downside to only allowing SAF on Android 5+ instead of 10+? |
@opusforlife2 I think the "only" is misplaced there. What he means is that users with Android 10+ will only see saf, and users with <5 will only see nononsense, while all versions in between will see both. |
I know what he meant. What I'm asking is if there is any downside of having SAF only for Android 5+. It will remove a setting and make things more consistent and code easier to maintain: NNFP only for Kitkat, SAF only for 5+. |
Oh ok |
What is it?
Description of the changes in your PR
requestLegacyExternalStorage
anymore in the manifest.SharpInputStream
into NewPipe and addSharpOutputStream
.I probably need to clean up some code and we should definitely do some more testing.
Fixes the following issue(s)
Fixes #3465 and perhaps some others.
Testing apk
app-debug.apk.zip
Agreement