Skip to content

Commit c8e5654

Browse files
committed
Use different allow-lists for backup and restore
1 parent 824ce97 commit c8e5654

File tree

4 files changed

+31
-9
lines changed

4 files changed

+31
-9
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* Added support for user CA certificates
33
* Fixed issue where many Go server implementations of WebDAV did not work with the WebDAV client in Seedvault
44
* Bumped the app data quota from 1GB to 3GB
5+
* Nextcloud app is no longer allowed for backup (Use built-in WebDAV Cloud support!)
56
* Improved handling of metered networks, if disallowed, the backup process will be aborted
67
* Fixed backup errors with USB when file and app backup are both on
78
* Fixed overdue backups not automatically starting when USB drives are plugged in

app/src/debug/res/values/config.xml

+8-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44
SPDX-License-Identifier: Apache-2.0
55
-->
66
<resources>
7-
<string-array name="storage_authority_whitelist">
7+
<string-array name="storage_authority_backup_allow_list">
8+
<item>com.android.externalstorage.documents</item>
9+
<item>org.nextcloud.documents</item>
10+
<item>org.nextcloud.beta.documents</item>
11+
<item>at.bitfire.davdroid.webdav</item>
12+
<item>de.felixnuesse.extract.vcp</item>
13+
</string-array>
14+
<string-array name="storage_authority_restore_allow_list">
815
<item>com.android.externalstorage.documents</item>
916
<item>org.nextcloud.documents</item>
1017
<item>org.nextcloud.beta.documents</item>

app/src/main/java/com/stevesoltys/seedvault/ui/storage/StorageOptionFetcher.kt

+5-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,11 @@ internal class StorageOptionFetcher(private val context: Context, private val is
4141

4242
private val packageManager = context.packageManager
4343
private val contentResolver = context.contentResolver
44-
private val whitelistedAuthorities =
45-
context.resources.getStringArray(R.array.storage_authority_whitelist)
44+
private val whitelistedAuthorities = if (isRestore) {
45+
context.resources.getStringArray(R.array.storage_authority_restore_allow_list)
46+
} else {
47+
context.resources.getStringArray(R.array.storage_authority_backup_allow_list)
48+
}
4649
private val safStorageOptions = SafStorageOptions(context, isRestore, whitelistedAuthorities)
4750

4851
private var listener: RemovableStorageListener? = null

app/src/main/res/values/config.xml

+17-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,25 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<!--
1+
<?xml version="1.0" encoding="utf-8"?><!--
32
SPDX-FileCopyrightText: 2020 The Calyx Institute
43
SPDX-License-Identifier: Apache-2.0
54
-->
6-
<resources xmlns:tools="http://schemas.android.com/tools">
5+
<resources>
76
<!--
8-
Add only storage here that is also available
9-
when restoring from backup (e.g. initial device setup)
7+
Storage Access Framework authorities listed here are allowed to be used as a backup location.
8+
Add only authorities here that are also listed in storage_authority_restore_allow_list
9+
and available when restoring from backup (e.g. initial device setup).
1010
-->
11-
<string-array name="storage_authority_whitelist" tools:ignore="InconsistentArrays">
11+
<string-array name="storage_authority_backup_allow_list">
12+
<item>com.android.externalstorage.documents</item>
13+
<item>at.bitfire.davdroid.webdav</item>
14+
<item>de.felixnuesse.extract.vcp</item>
15+
</string-array>
16+
17+
<!--
18+
Storage Access Framework authorities listed here are allowed to be used for restore.
19+
These should include all authorities from storage_authority_backup_allow_list
20+
and potentially more.
21+
-->
22+
<string-array name="storage_authority_restore_allow_list">
1223
<item>com.android.externalstorage.documents</item>
1324
<item>org.nextcloud.documents</item>
1425
<item>at.bitfire.davdroid.webdav</item>

0 commit comments

Comments
 (0)