-
Notifications
You must be signed in to change notification settings - Fork 29
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
(#172) Storage Access Framework Integration #292
(#172) Storage Access Framework Integration #292
Conversation
Merge with Adamantcheese/multi-feature
Now ExternalFiles uses DocumentFile().listFiles() to find a file inside a directory. It's implemented this way because, apparently, it's the only way to get a fully working DocumentFile that supports such operations as exists(), getName(), canRead()/canWrite(), delete() etc and which getParent() returns an actual file and not the null. This slow, but I don't know another way to do this so that everything works as expected.
Add more tests for AbstractFile
…a SAF) Bring back SaveLocationController so that people can choose whether they want to use SAF or not (or in case of a bug)
… sub directories (site name/board code/boar AbstractFile.findFile() now returns a new AbstractFile instead of DocumentFile Fix RawFile.createNew() which would create a file when it should create directory Implement RawFile.findFile()
Fix file/directory choosers would not remove the callback from the callback map when we have no activity to handle our intent. Also no message would have been shown in such case. Give the use a choice when exporting settings whether he wants to open an existing settings file to overwrite it or create a new separate file.
Kuroba/app/src/main/java/com/github/adamantcheese/chan/core/saf/file/AbstractFile.kt
Outdated
Show resolved
Hide resolved
Kuroba/app/src/main/java/com/github/adamantcheese/chan/core/saf/file/AbstractFile.kt
Outdated
Show resolved
Hide resolved
Kuroba/app/src/main/java/com/github/adamantcheese/chan/core/saf/file/AbstractFile.kt
Outdated
Show resolved
Hide resolved
Add ability to delete old base directory after moving files into the new one Small fixes for thread album downloading where folder and file names would not be sanitized
… kotlin's functions
…to (#172)-storage-access-framework # Conflicts: # Kuroba/app/build.gradle # README.md
…n the paths thus resulting in losing the sub directories Fix shared_prefs importing/exporting for dev builds (wrong appId was used) Extract MediaSettingsControllerCallbacks into it's own class to avoid compilation errors
Additional active local threads checks before allowing the user to change base dir for local threads Some strings that were forgotten about were moved to resources
…tempts to export a directory path that is located in a directory using SAF
It's done. |
}); | ||
// String[] paths = {destination.getFullPath()}; | ||
|
||
// FIXME: does not work. Who in their right mind even wants their downloaded images |
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.
MediaScanner is a system level service that doesn't necessarily get touched by any Google program, assuming you have a ROM with all the Google stuff removed. It's used for interop between different apps and a computer, assuming you're connected using MTP. Basically, it's not useless and should be reimplemented at some point in time.
Kuroba/app/src/main/java/com/github/adamantcheese/chan/core/saver/ImageSaver.java
Show resolved
Hide resolved
@@ -39,4 +39,20 @@ public static String extractFileExtensionFromImageUrl(String url) { | |||
return url.substring(index + 1); | |||
} | |||
|
|||
public static String dirNameRemoveBadCharacters(String dirName) { |
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.
I couldn't rebase it either (not that I have any fucking clue how rebasing works, but I couldn't even get it to the right commit to rebase from on my end). I don't mind the lack of squashing honestly. Debug APK should be building and ready for testing on your server soon. |
Oh shit, it's in! |
I didn't change the space filtering or the MediaScanner stuff. |
Closes #172
UPDATE:It's pretty much done, but not tested yet.UPDATE 2 (9/7/19):So I thought it was done but then I have found out that this shit is really fucking slow (like dozens of times slower than the regular Java File API) so I decided to try to figure out how to make this shit faster. And I have actually came up with a good idea. So now I'm rewriting some parts of this shit then I'm gonna write tests (I still have to figure out how to test SAF, apparently it's not that easy) and then release it.UPDATE 3 (10/27/19):
It's fucking done!!!!!
I have fucked up and merged a wrong dev branch so now there are 200 commits. Rebase is impossible since it forces me to resolve conflicts for like 30 times in a row. Maybe you can use squash and merge?
This shit is done and tested a little bit on emulator with emulated sd-card. I don't have a real sd-card so I can't test it on a real device. If you want to help then here is a dev apk:
Kuroba-dev.zip
Things that should be tested:
Maybe I forgot something.
And please do not change these files (SavedThreadLoaderManager, ImportExportRepository, SavedThreadLoaderRepository) before this shit is merged otherwise the merge conflicts will be really hard to fix for me because those files were converted into kotlin.
- [x] Settings importing/exporting- [x] Album images downloading- [x] Threads downloading- [x] Optimizing/Refactoring- [x] Merging with dev- [x] Testing