Skip to content
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

Merged
merged 200 commits into from
Oct 31, 2019
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
200 commits
Select commit Hold shift + click to select a range
a59c485
Update README.md
K1rakishou Jul 15, 2019
3fb6063
Update README.md
K1rakishou Jul 15, 2019
72270df
Update README.md
K1rakishou Jul 15, 2019
48ca131
Update README.md
K1rakishou Jul 15, 2019
1604d02
Update README.md
K1rakishou Jul 15, 2019
ce880e8
Introduce travis CI
K1rakishou Jul 15, 2019
3ab6b25
Update README.md
K1rakishou Jul 15, 2019
c12c686
CI apk uploading
K1rakishou Jul 16, 2019
568197c
Merge remote-tracking branch 'origin/multi-feature' into multi-feature
K1rakishou Jul 16, 2019
725f752
Trigger CI build
K1rakishou Jul 16, 2019
abbf9ad
Trigger CI build
K1rakishou Jul 16, 2019
40e95ca
Merge branch 'multi-feature' into dev
K1rakishou Jul 19, 2019
a031496
Merge pull request #21 from K1rakishou/dev
K1rakishou Jul 19, 2019
6019ab1
Update README.md
K1rakishou Jul 20, 2019
e42adbd
(#172) SAF base API implementation
K1rakishou Aug 10, 2019
f537fdf
(#172) Couple of little code improvements
K1rakishou Aug 10, 2019
b08d175
(#172) Comments and more File API methods
K1rakishou Aug 11, 2019
d26cdcf
(#172) Settings exporting/importing now works with SAF
K1rakishou Aug 11, 2019
9d61e02
(#172) Image saving now works (with bugs) with SAF
K1rakishou Aug 11, 2019
05606fc
(#172) SAF fixes:
K1rakishou Aug 17, 2019
29cce2a
(#172) Image saving now works with SAF!
K1rakishou Aug 17, 2019
ff93a34
(#172) Remove fileManager.fromAbstractFile() method, add AbstractFile…
K1rakishou Aug 18, 2019
37c3a83
(#172) ImageSaving now works with both RawFiles and ExternalFiles (vi…
K1rakishou Aug 18, 2019
b61d619
(#172) Add comments. Remove duplicate name() method
K1rakishou Aug 18, 2019
2b692ab
(#172) Comments, refactoring and bug fixes. ImageSaving now work with…
K1rakishou Aug 18, 2019
a75df6c
(#172) Fixes and refactoring
K1rakishou Aug 18, 2019
11bde35
(#172) Add comments
K1rakishou Aug 24, 2019
0b5de59
(#172) Add local threads location setting (which is selected by the u…
K1rakishou Aug 24, 2019
9946068
(#172) Threads should now work with SAF (not tested yet)
K1rakishou Aug 24, 2019
b4f288b
(#172) Make most of the methods in AbstractFile immutable because it …
K1rakishou Aug 24, 2019
3e4f8a7
(#172) Tests for write to a SAF file, checking it's length and then r…
K1rakishou Aug 24, 2019
4044b72
(#172) Lots of improvements/fixes etc
K1rakishou Aug 25, 2019
941a3d2
(#172) Fix FileCacheDownloader bug where the output file wouldn't be …
K1rakishou Aug 25, 2019
b2878be
(#172) Return back lost SaveLocationController
K1rakishou Aug 25, 2019
1269cb0
(#172) Merge with dev branch
K1rakishou Aug 25, 2019
478e3a7
(#172) Remove empty files
K1rakishou Aug 25, 2019
6772d78
(#172) Fix grammar mistakes
K1rakishou Aug 25, 2019
a38b337
(#172) Fix media scanner scanning file with disabled setting
K1rakishou Aug 25, 2019
3e79291
(#172) Remove testMethod when choosing local threads location (since …
K1rakishou Aug 25, 2019
c0492b7
(#172) Revert strict mode back
K1rakishou Aug 25, 2019
b297828
(#172) Merge branch 'cheese-multi-feature' into (#172)-storage-access…
K1rakishou Aug 31, 2019
98f45e7
(#172) Attempt to implement migration from one local threads base dir…
K1rakishou Sep 1, 2019
177412e
Update travis.yml
K1rakishou Sep 8, 2019
33e0fa9
Update build script, trigger CI build
K1rakishou Sep 8, 2019
260200b
Make gradlew executable, trigger CI build
K1rakishou Sep 8, 2019
58ba49b
Fix gradle build command, trigger CI build
K1rakishou Sep 8, 2019
ddbee83
Attempt to fix it again, trigger CI build, turn off email notifications
K1rakishou Sep 8, 2019
9200627
Attempt to combine scripts into one, trigger CI build
K1rakishou Sep 8, 2019
974b8b3
Update upload_apk script, trigger CI build
K1rakishou Sep 8, 2019
49cca30
Remove pip install --upgrade pip command, trigger CI build
K1rakishou Sep 8, 2019
525ea3e
Use baseUrl for python scripts that is being passed from the travis.y…
K1rakishou Sep 8, 2019
fdd4de4
Fix lint warning, attempt to stop travis build upon script error
K1rakishou Sep 8, 2019
d9eb1c1
Ok, it works, now it should do everything up until apk uploading
K1rakishou Sep 8, 2019
daf5f8e
Trigger CI build, should finally see a built apk on the apk server
K1rakishou Sep 14, 2019
e2f8ded
Update upload_apk script, trigger CI build
K1rakishou Sep 14, 2019
efcc269
use pip3, trigger CI build
K1rakishou Sep 14, 2019
82b6df6
install python3-pip, trigger CI build
K1rakishou Sep 14, 2019
0fe50d9
add getLastTenCommits gradle task, update upload_apk script, trigger …
K1rakishou Sep 14, 2019
a1830fe
update upload_apk script, trigger CI build
K1rakishou Sep 14, 2019
40dc90b
use python3 to run the script instead of python2, trigger CI build
K1rakishou Sep 14, 2019
b4dad88
trigger CI build
K1rakishou Sep 14, 2019
d6943ef
use python 3.6, trigger CI build
K1rakishou Sep 14, 2019
c51d6f1
trigger CI build
K1rakishou Sep 14, 2019
2a95972
move before_install commands into install commands, trigger CI build
K1rakishou Sep 14, 2019
4ed813d
another attempt to use python 3.6, trigger CI build
K1rakishou Sep 14, 2019
de3fe27
update upload_apk script, trigger CI build
K1rakishou Sep 14, 2019
06e395b
update upload_apk script, trigger CI build
K1rakishou Sep 14, 2019
37393b2
update upload_apk script, trigger CI build
K1rakishou Sep 14, 2019
09cbd94
update upload_apk script, trigger CI build
K1rakishou Sep 14, 2019
c6e8bf9
update upload_apk script, trigger CI build
K1rakishou Sep 14, 2019
90c58d3
update upload_apk script, trigger CI build
K1rakishou Sep 14, 2019
63aa5c9
update upload_apk script, trigger CI build
K1rakishou Sep 14, 2019
ea2c642
update upload_apk script, trigger CI build
K1rakishou Sep 14, 2019
fed21f1
update upload_apk script, trigger CI build
K1rakishou Sep 14, 2019
58eb4ac
update upload_apk script, trigger CI build
K1rakishou Sep 14, 2019
f709fa8
update upload_apk script, trigger CI build
K1rakishou Sep 14, 2019
04e2933
update upload_apk script, trigger CI build
K1rakishou Sep 14, 2019
7ac62ac
update upload_apk script, trigger CI build
K1rakishou Sep 14, 2019
e6b696b
update upload_apk script, trigger CI build
K1rakishou Sep 14, 2019
383d434
update upload_apk script, trigger CI build
K1rakishou Sep 14, 2019
afbab46
update upload_apk script, trigger CI build
K1rakishou Sep 14, 2019
9ca3785
update upload_apk script, trigger CI build
K1rakishou Sep 14, 2019
0f4351f
update upload_apk script, trigger CI build
K1rakishou Sep 14, 2019
8b31959
update upload_apk script, trigger CI build
K1rakishou Sep 14, 2019
a51c9a9
update upload_apk script, trigger CI build
K1rakishou Sep 14, 2019
56de0d2
update upload_apk script, trigger CI build
K1rakishou Sep 14, 2019
7500c01
update upload_apk script, trigger CI build
K1rakishou Sep 14, 2019
07d69e1
update upload_apk script, trigger CI build
K1rakishou Sep 15, 2019
e7c8054
update upload_apk script, trigger CI build
K1rakishou Sep 15, 2019
2eef0be
update upload_apk script, trigger CI build
K1rakishou Sep 15, 2019
89917a6
update upload_apk script, trigger CI build
K1rakishou Sep 15, 2019
e631e08
update upload_apk script, trigger CI build
K1rakishou Sep 15, 2019
d22d436
trigger CI build
K1rakishou Sep 15, 2019
e30da58
Trigger CI build
K1rakishou Sep 15, 2019
da8f651
trigger CI build
K1rakishou Sep 15, 2019
770656a
add getVersionCode gradle task, trigger CI build
K1rakishou Sep 15, 2019
0cff1d3
trigger CI build
K1rakishou Sep 15, 2019
55a43b1
trigger CI build
K1rakishou Sep 15, 2019
27702ec
trigger CI build
K1rakishou Sep 15, 2019
b75531c
trigger CI build
K1rakishou Sep 15, 2019
8bf82ca
trigger CI build
K1rakishou Sep 15, 2019
01cf302
trigger CI build
K1rakishou Sep 15, 2019
e4b0b9f
use getLatestCommit, trigger CI build
K1rakishou Sep 15, 2019
f10fc3e
trigger CI build
K1rakishou Sep 15, 2019
7cb6939
trigger CI build
K1rakishou Sep 15, 2019
3a85370
trigger CI build
K1rakishou Sep 15, 2019
aea3ecd
trigger CI build
K1rakishou Sep 15, 2019
4d5a28b
trigger CI build
K1rakishou Sep 15, 2019
28b6e4a
trigger CI build
K1rakishou Sep 15, 2019
29fcac3
trigger CI build
K1rakishou Sep 15, 2019
8512269
update upload_apk script, trigger CI build
K1rakishou Sep 15, 2019
8c46a0b
trigger CI build
K1rakishou Sep 15, 2019
53558ee
trigger CI build
K1rakishou Sep 15, 2019
fbb99b0
trigger CI build
K1rakishou Sep 15, 2019
5ed0a65
trigger CI build
K1rakishou Sep 15, 2019
c945f7a
trigger CI build
K1rakishou Sep 15, 2019
d5b07fe
trigger CI build
K1rakishou Sep 15, 2019
781b4fc
trigger CI build
K1rakishou Sep 15, 2019
974a9a4
trigger CI build
K1rakishou Sep 15, 2019
f9aeb7a
trigger CI build
K1rakishou Sep 15, 2019
63b13b3
trigger CI build
K1rakishou Sep 15, 2019
10809f3
trigger CI build
K1rakishou Sep 15, 2019
4c97a45
trigger CI build
K1rakishou Sep 15, 2019
f331d42
trigger CI build
K1rakishou Sep 15, 2019
34a1f35
trigger CI build
K1rakishou Sep 15, 2019
a11afb6
test commit 1
K1rakishou Sep 16, 2019
d81e177
test commit 1
K1rakishou Sep 18, 2019
1e4c8bf
test commit 2
K1rakishou Sep 18, 2019
ec29342
test commit 3
K1rakishou Sep 18, 2019
caf2b41
test commit 0
K1rakishou Sep 18, 2019
a89723e
test commit 1
K1rakishou Sep 18, 2019
4e04624
test commit 2
K1rakishou Sep 18, 2019
1e99d9b
test commit 3
K1rakishou Sep 18, 2019
3119f4c
test commit 4
K1rakishou Sep 18, 2019
57bd380
test commit 5
K1rakishou Sep 18, 2019
d8cc0f8
upload_apk scripts fixes
K1rakishou Sep 18, 2019
6dc0265
change branch name
K1rakishou Sep 18, 2019
0a80dc1
update upload_apk script
K1rakishou Sep 18, 2019
c7f815f
Change branch name back to multi-feature
K1rakishou Sep 18, 2019
0b66bd2
upload_apk script fixes
K1rakishou Sep 18, 2019
0f1451a
upload_apk script fixes
K1rakishou Sep 18, 2019
551fe3b
shit works!
K1rakishou Sep 18, 2019
d923fef
test commit 1
K1rakishou Sep 18, 2019
d92492c
test commit 2
K1rakishou Sep 18, 2019
59cce6b
test commit 3
K1rakishou Sep 18, 2019
ee19bef
Fix git log command would include a commit with hash that we are pass…
K1rakishou Sep 18, 2019
1c92139
test commit 1
K1rakishou Sep 18, 2019
15db792
test commit 2
K1rakishou Sep 18, 2019
f31fcd1
Check whether a branch exists before doing the uploading
K1rakishou Sep 18, 2019
0acfc14
Merge pull request #22 from K1rakishou/test-my-multi-feature
K1rakishou Sep 18, 2019
5fb53df
test commit 1
K1rakishou Sep 18, 2019
20be69f
test commit 2
K1rakishou Sep 18, 2019
c6f0fd0
remove --first-parent
K1rakishou Sep 18, 2019
2fcfb9f
remove --first-parent, fix upload_apk script
K1rakishou Sep 18, 2019
98e2315
upload_apk script improvements
K1rakishou Sep 18, 2019
c55a9bc
Merge branch 'my-multi-feature' into test-my-miltifeature-branch
K1rakishou Sep 18, 2019
857bc4b
test commit 3
K1rakishou Sep 18, 2019
56e1406
test commit 4
K1rakishou Sep 18, 2019
ceb1021
update upload_apk script
K1rakishou Sep 18, 2019
1b27db6
Merge branch 'my-multi-feature' into test-my-miltifeature-branch
K1rakishou Sep 18, 2019
fc1bfd3
update upload_apk script
K1rakishou Sep 18, 2019
6db6d0d
Merge pull request #23 from K1rakishou/test-my-miltifeature-branch
K1rakishou Sep 18, 2019
342b7b6
Update gradle to use apk name with versionNameSuffix that depends on …
K1rakishou Sep 19, 2019
31ea72c
Merge remote-tracking branch 'origin/multi-feature' into my-multi-fea…
K1rakishou Sep 19, 2019
425928d
Use ISO datetime for commits
K1rakishou Sep 19, 2019
cd3a908
test commit 1
K1rakishou Sep 19, 2019
ceeb4ec
test commit 2
K1rakishou Sep 19, 2019
06ca9f1
test commit 3
K1rakishou Sep 19, 2019
db134bf
Merge pull request #24 from K1rakishou/test-my-multi-feature
K1rakishou Sep 19, 2019
acf04ae
Pass secret key via travis secure variables
K1rakishou Sep 19, 2019
8bed1ff
Merge remote-tracking branch 'origin/multi-feature' into my-multi-fea…
K1rakishou Sep 19, 2019
d054039
Update upload_apk script
K1rakishou Sep 19, 2019
79fb0d0
test commit 1
K1rakishou Sep 19, 2019
89bcfd9
test commit 2
K1rakishou Sep 19, 2019
6338da8
test commit 3
K1rakishou Sep 19, 2019
ee240fd
Disable ApkUpdater for dev builds for now (it doesn't work with the a…
K1rakishou Sep 19, 2019
8acb726
Merge pull request #25 from K1rakishou/test-my-multi-feature
K1rakishou Sep 19, 2019
9dff30c
Add comments
K1rakishou Sep 20, 2019
3f69a6f
Remove redundant line
K1rakishou Sep 20, 2019
15aa2b1
Add one important comment
K1rakishou Sep 20, 2019
d410a80
Update README.md
K1rakishou Sep 20, 2019
80fe48d
Update README.md
K1rakishou Sep 20, 2019
25262f2
Update upload_apk script, trigger CI build
K1rakishou Sep 21, 2019
bfc8f51
Merge remote-tracking branch 'origin/multi-feature' into travis-ci-in…
K1rakishou Sep 21, 2019
0706523
Remove redundant line in travis script
K1rakishou Sep 21, 2019
4861305
(#172) Migrate to a separate (home made) library that handles SAF bul…
K1rakishou Oct 19, 2019
b2ce0b9
(#172) Significantly improved speed of local threads downloading
K1rakishou Oct 20, 2019
fcde52d
(#172) Fix a bug where the downloading thread won't be marked as stop…
K1rakishou Oct 20, 2019
49b1f69
(#172) SAF integration is completed
K1rakishou Oct 26, 2019
5fac46a
(#172) Move all strings to resources
K1rakishou Oct 26, 2019
1eb7521
(#172) Update Fuck-Storage-Access-Framework to the latest release ver…
K1rakishou Oct 27, 2019
24d792d
(#172) Use generic base newBaseDirectoryFile when calling it from the…
K1rakishou Oct 27, 2019
2b30039
(#172) Merge remote-tracking branch 'remotes/origin/multi-feature' in…
K1rakishou Oct 27, 2019
8c2f6a6
(#172) Merge with develop
K1rakishou Oct 27, 2019
97a7b2b
(#172) Fix compilation error
K1rakishou Oct 27, 2019
0184fab
(#172) Fix image saving related bugs, like file separators filtered i…
K1rakishou Oct 27, 2019
ff2d6c1
(#172) Fix ImageLoaderV2 setting bitmap into a request field (haha)
K1rakishou Oct 27, 2019
5fe98c2
(#172) Add a warning alert dialog that will be shown when the user at…
K1rakishou Oct 27, 2019
4dba625
(#172) Remove merge conflict marker from travis.yml
K1rakishou Oct 27, 2019
8e90850
(#172) Set the CURRENT_EXPORT_SETTINGS_VERSION to what it should be (5)
K1rakishou Oct 27, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Kuroba/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

android {
compileSdkVersion 28
Expand Down Expand Up @@ -154,4 +157,5 @@ dependencies {
implementation 'com.vdurmont:emoji-java:4.0.0'
implementation 'io.reactivex.rxjava2:rxjava:2.2.9'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
import com.github.adamantcheese.chan.core.model.orm.Loadable;
import com.github.adamantcheese.chan.core.model.orm.Pin;
import com.github.adamantcheese.chan.core.repository.SiteRepository;
import com.github.adamantcheese.chan.core.saf.FileManager;
import com.github.adamantcheese.chan.core.saf.callback.StartActivityCallbacks;
import com.github.adamantcheese.chan.core.settings.ChanSettings;
import com.github.adamantcheese.chan.core.site.Site;
import com.github.adamantcheese.chan.core.site.SiteResolver;
Expand All @@ -62,6 +64,8 @@
import com.github.adamantcheese.chan.utils.AndroidUtils;
import com.github.adamantcheese.chan.utils.Logger;

import org.jetbrains.annotations.NotNull;

import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.ArrayList;
Expand All @@ -73,7 +77,10 @@
import static com.github.adamantcheese.chan.Chan.inject;
import static com.github.adamantcheese.chan.utils.AndroidUtils.getApplicationLabel;

public class StartActivity extends AppCompatActivity implements NfcAdapter.CreateNdefMessageCallback {
public class StartActivity
extends AppCompatActivity
implements NfcAdapter.CreateNdefMessageCallback,
StartActivityCallbacks {
private static final String TAG = "StartActivity";

private static final String STATE_KEY = "chan_state";
Expand Down Expand Up @@ -104,6 +111,9 @@ public class StartActivity extends AppCompatActivity implements NfcAdapter.Creat
@Inject
SiteService siteService;

@Inject
FileManager fileManager;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand All @@ -115,6 +125,8 @@ protected void onCreate(Bundle savedInstanceState) {

Chan.injector().instance(ThemeHelper.class).setupContext(this);

fileManager.setCallbacks(this);

imagePickDelegate = new ImagePickDelegate(this);
runtimePermissionsHelper = new RuntimePermissionsHelper(this);
updateManager = new UpdateManager(this);
Expand Down Expand Up @@ -534,6 +546,8 @@ protected void onDestroy() {
return;
}

fileManager.removeCallbacks();

// TODO: clear whole stack?
stackTop().onHide();
stackTop().onDestroy();
Expand All @@ -544,7 +558,13 @@ protected void onDestroy() {
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);

imagePickDelegate.onActivityResult(requestCode, resultCode, data);
if (fileManager.onActivityResult(requestCode, resultCode, data)) {
return;
}

if (imagePickDelegate.onActivityResult(requestCode, resultCode, data)) {
return;
}
}

private Controller stackTop() {
Expand Down Expand Up @@ -581,4 +601,9 @@ public void restartApp() {

Runtime.getRuntime().exit(0);
}

@Override
public void myStartActivityForResult(@NotNull Intent intent, int requestCode) {
startActivityForResult(intent, requestCode);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
package com.github.adamantcheese.chan.core

import android.net.Uri
import android.webkit.MimeTypeMap
import java.io.File

private const val BINARY_FILE_MIME_TYPE = "application/octet-stream"

fun String.extension(): String? {
val index = this.indexOfLast { ch -> ch == '.' }
if (index == -1) {
return null
}

if (index == this.lastIndex) {
// The dot is at the very end of the string, so there is no extension
return null
}

return this.substring(index + 1)
}

fun Uri.Builder.appendManyEncoded(segments: List<String>): Uri.Builder {
for (segment in segments) {
this.appendEncodedPath(segment)
}

return this
}

fun Uri.removeLastSegment(): Uri? {
if (this.pathSegments.size <= 1) {
// I think we shouldn't return "/" directory here since android won't let us access it anyway
return null
}

val newSegments = this.pathSegments
.subList(0, pathSegments.lastIndex)

return Uri.Builder()
.appendManyEncoded(newSegments)
.build()
}

fun MimeTypeMap.getMimeFromFilename(filename: String): String {
val extension = filename.extension()
if (extension == null) {
return BINARY_FILE_MIME_TYPE
}

val mimeType = this.getMimeTypeFromExtension(extension)
if (mimeType == null || mimeType.isEmpty()) {
return BINARY_FILE_MIME_TYPE
}

return mimeType
}

fun File.appendMany(segments: List<String>): File {
var newFile = File(this.absolutePath)

for (segment in segments) {
newFile = File(newFile, segment)
}

return newFile
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import com.android.volley.toolbox.ImageLoader;
import com.github.adamantcheese.chan.core.image.ImageLoaderV2;
import com.github.adamantcheese.chan.core.net.BitmapLruImageCache;
import com.github.adamantcheese.chan.core.saf.FileManager;
import com.github.adamantcheese.chan.core.saver.ImageSaver;
import com.github.adamantcheese.chan.ui.captcha.CaptchaHolder;
import com.github.adamantcheese.chan.ui.theme.ThemeHelper;
Expand Down Expand Up @@ -76,13 +77,19 @@ public ThemeHelper provideThemeHelper() {

@Provides
@Singleton
public ImageSaver provideImageSaver() {
return new ImageSaver();
public CaptchaHolder provideCaptchaHolder() {
return new CaptchaHolder();
}

@Provides
@Singleton
public CaptchaHolder provideCaptchaHolder() {
return new CaptchaHolder();
public FileManager provideFileManager() {
return new FileManager(applicationContext);
}

@Provides
@Singleton
public ImageSaver provideImageSaver(FileManager fileManager) {
return new ImageSaver(fileManager);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
import androidx.annotation.Nullable;

import com.github.adamantcheese.chan.core.repository.ImportExportRepository;

import java.io.File;
import com.github.adamantcheese.chan.core.saf.file.ExternalFile;

import javax.inject.Inject;

Expand All @@ -45,8 +44,8 @@ public void onDestroy() {
this.callbacks = null;
}

public void doExport(File settingsFile) {
importExportRepository.exportTo(settingsFile, new ImportExportRepository.ImportExportCallbacks() {
public void doExport(ExternalFile settingsFile, boolean isNewFile) {
importExportRepository.exportTo(settingsFile, isNewFile, new ImportExportRepository.ImportExportCallbacks() {
@Override
public void onSuccess(ImportExportRepository.ImportExport importExport) {
//called on background thread
Expand Down Expand Up @@ -76,7 +75,7 @@ public void onError(Throwable error, ImportExportRepository.ImportExport importE
});
}

public void doImport(File settingsFile) {
public void doImport(ExternalFile settingsFile) {
importExportRepository.importFrom(settingsFile, new ImportExportRepository.ImportExportCallbacks() {
@Override
public void onSuccess(ImportExportRepository.ImportExport importExport) {
Expand Down
Loading