Skip to content

Commit

Permalink
Merge branch 'release/1.6.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
SailReal committed Nov 11, 2021
2 parents fd7ff7b + 1457eb5 commit 7a2ccf8
Show file tree
Hide file tree
Showing 98 changed files with 1,456 additions and 807 deletions.
13 changes: 0 additions & 13 deletions .idea/runConfigurations.xml

This file was deleted.

38 changes: 19 additions & 19 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ GEM
artifactory (3.0.15)
atomos (0.1.3)
aws-eventstream (1.2.0)
aws-partitions (1.509.0)
aws-sdk-core (3.121.1)
aws-partitions (1.525.0)
aws-sdk-core (3.122.0)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.239.0)
aws-partitions (~> 1, >= 1.525.0)
aws-sigv4 (~> 1.1)
jmespath (~> 1.0)
aws-sdk-kms (1.48.0)
aws-sdk-core (~> 3, >= 3.120.0)
aws-sdk-kms (1.51.0)
aws-sdk-core (~> 3, >= 3.122.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.103.0)
aws-sdk-core (~> 3, >= 3.120.0)
aws-sdk-s3 (1.105.0)
aws-sdk-core (~> 3, >= 3.122.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.4)
aws-sigv4 (1.4.0)
Expand All @@ -40,7 +40,7 @@ GEM
dotenv (2.7.6)
ed25519 (1.2.4)
emoji_regex (3.2.3)
excon (0.86.0)
excon (0.88.0)
faraday (1.8.0)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
Expand All @@ -63,10 +63,10 @@ GEM
faraday-net_http_persistent (1.2.0)
faraday-patron (1.0.0)
faraday-rack (1.0.0)
faraday_middleware (1.1.0)
faraday_middleware (1.2.0)
faraday (~> 1.0)
fastimage (2.2.5)
fastlane (2.195.0)
fastlane (2.197.0)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.8, < 3.0.0)
artifactory (~> 3.0)
Expand Down Expand Up @@ -111,7 +111,7 @@ GEM
mime-types (~> 3.3)
fastlane-plugin-get_version_name (0.2.2)
gh_inspector (1.1.3)
google-apis-androidpublisher_v3 (0.11.0)
google-apis-androidpublisher_v3 (0.13.0)
google-apis-core (>= 0.4, < 2.a)
google-apis-core (0.4.1)
addressable (~> 2.5, >= 2.5.1)
Expand All @@ -122,11 +122,11 @@ GEM
retriable (>= 2.0, < 4.a)
rexml
webrick
google-apis-iamcredentials_v1 (0.7.0)
google-apis-iamcredentials_v1 (0.8.0)
google-apis-core (>= 0.4, < 2.a)
google-apis-playcustomapp_v1 (0.5.0)
google-apis-playcustomapp_v1 (0.6.0)
google-apis-core (>= 0.4, < 2.a)
google-apis-storage_v1 (0.8.0)
google-apis-storage_v1 (0.9.0)
google-apis-core (>= 0.4, < 2.a)
google-cloud-core (1.6.0)
google-cloud-env (~> 1.0)
Expand All @@ -142,7 +142,7 @@ GEM
google-cloud-core (~> 1.6)
googleauth (>= 0.16.2, < 2.a)
mini_mime (~> 1.0)
googleauth (1.0.0)
googleauth (1.1.0)
faraday (>= 0.17.3, < 2.0)
jwt (>= 1.4, < 3.0)
memoist (~> 0.16)
Expand All @@ -154,14 +154,14 @@ GEM
domain_name (~> 0.5)
httpclient (2.8.3)
jmespath (1.4.0)
json (2.5.1)
jwt (2.2.3)
json (2.6.1)
jwt (2.3.0)
memoist (0.16.2)
mime-types (3.3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2021.0704)
mime-types-data (3.2021.0901)
mini_magick (4.11.0)
mini_mime (1.1.1)
mini_mime (1.1.2)
multi_json (1.15.0)
multipart-post (2.0.0)
nanaimo (0.3.0)
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.2'
classpath 'com.android.tools.build:gradle:7.0.3'
classpath 'org.greenrobot:greendao-gradle-plugin:3.3.0'
classpath 'com.vanniktech:gradle-android-junit-jacoco-plugin:0.16.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
Expand Down Expand Up @@ -39,7 +39,7 @@ allprojects {
ext {
androidApplicationId = 'org.cryptomator'
androidVersionCode = getVersionCode()
androidVersionName = '1.6.2'
androidVersionName = '1.6.3'
}
repositories {
mavenCentral()
Expand Down
14 changes: 7 additions & 7 deletions buildsystem/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ allprojects {
ext {
androidBuildToolsVersion = "30.0.2"
androidMinSdkVersion = 24
androidTargetSdkVersion = 29
androidCompileSdkVersion = 29
androidTargetSdkVersion = 30
androidCompileSdkVersion = 30

// android and java libs
androidVersion = '4.1.1.4'
Expand All @@ -29,7 +29,7 @@ ext {
rxAndroidVersion = '2.1.1'
rxBindingVersion = '2.2.0'

daggerVersion = '2.39'
daggerVersion = '2.40'

gsonVersion = '2.8.8'

Expand All @@ -52,7 +52,7 @@ ext {
// cloud provider libs
cryptolibVersion = '2.0.2'

dropboxVersion = '4.0.1'
dropboxVersion = '5.0.0'

googleApiServicesVersion = 'v3-rev20210919-1.32.1'
googlePlayServicesVersion = '19.2.0'
Expand All @@ -65,7 +65,7 @@ ext {

msgraphVersion = '2.10.0'

minIoVersion = '8.3.0'
minIoVersion = '8.3.3'
staxVersion = '1.2.0' // needed for minIO

commonsCodecVersion = '1.15'
Expand All @@ -76,8 +76,8 @@ ext {

jUnitVersion = '5.8.1'
assertJVersion = '1.7.1'
mockitoVersion = '3.12.4'
mockitoKotlinVersion = '3.2.0'
mockitoVersion = '4.0.0'
mockitoKotlinVersion = '4.0.0'
hamcrestVersion = '1.3'
dexmakerVersion = '1.0'
espressoVersion = '3.4.0'
Expand Down
2 changes: 1 addition & 1 deletion data/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ android {
}

greendao {
schemaVersion 9
schemaVersion 10
}

configurations.all {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class UpgradeDatabaseTest {
Upgrade6To7().applyTo(db, 6)
Upgrade7To8().applyTo(db, 7)
Upgrade8To9(sharedPreferencesHandler).applyTo(db, 8)
Upgrade9To10(sharedPreferencesHandler).applyTo(db, 9)

CloudEntityDao(DaoConfig(db, CloudEntityDao::class.java)).loadAll()
VaultEntityDao(DaoConfig(db, VaultEntityDao::class.java)).loadAll()
Expand Down Expand Up @@ -407,4 +408,66 @@ class UpgradeDatabaseTest {

Assert.assertThat(sharedPreferencesHandler.isBetaModeAlreadyShown(), CoreMatchers.`is`(false))
}

@Test
fun upgrade9To10() {
Upgrade0To1().applyTo(db, 0)
Upgrade1To2().applyTo(db, 1)
Upgrade2To3(context).applyTo(db, 2)
Upgrade3To4().applyTo(db, 3)
Upgrade4To5().applyTo(db, 4)
Upgrade5To6().applyTo(db, 5)
Upgrade6To7().applyTo(db, 6)
Upgrade7To8().applyTo(db, 7)
Upgrade8To9(sharedPreferencesHandler).applyTo(db, 8)

Sql.insertInto("CLOUD_ENTITY") //
.integer("_id", 15) //
.text("TYPE", CloudType.LOCAL.name) //
.text("URL", "url") //
.text("USERNAME", "username") //
.text("WEBDAV_CERTIFICATE", "certificate") //
.text("ACCESS_TOKEN", "accessToken")
.text("S3_BUCKET", "s3Bucket") //
.text("S3_REGION", "s3Region") //
.text("S3_SECRET_KEY", "s3SecretKey") //
.executeOn(db)

Sql.insertInto("VAULT_ENTITY") //
.integer("_id", 25) //
.integer("FOLDER_CLOUD_ID", 15) //
.text("FOLDER_PATH", "path") //
.text("FOLDER_NAME", "name") //
.text("CLOUD_TYPE", CloudType.LOCAL.name) //
.text("PASSWORD", "password") //
.integer("POSITION", 10) //
.executeOn(db)

Sql.insertInto("VAULT_ENTITY") //
.integer("_id", 26) //
.integer("FOLDER_CLOUD_ID", 4) //
.text("FOLDER_PATH", "pathOfVault26") //
.text("FOLDER_NAME", "name") //
.text("CLOUD_TYPE", CloudType.LOCAL.name) //
.text("PASSWORD", "password") //
.integer("POSITION", 11) //
.executeOn(db)

Sql.query("CLOUD_ENTITY").executeOn(db).use {
Assert.assertThat(it.count, CoreMatchers.`is`(5))
}

Upgrade9To10(sharedPreferencesHandler).applyTo(db, 9)

Sql.query("VAULT_ENTITY").executeOn(db).use {
Assert.assertThat(it.count, CoreMatchers.`is`(1))
}

Sql.query("CLOUD_ENTITY").executeOn(db).use {
Assert.assertThat(it.count, CoreMatchers.`is`(4))
}

Assert.assertThat(sharedPreferencesHandler.vaultsRemovedDuringMigration(), CoreMatchers.`is`(Pair("LOCAL", arrayListOf("pathOfVault26"))))
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ private boolean configurationMatches(CryptoCloud cloud) {
return vault.equals(cloud.vault);
}

@Override
public boolean predefined() {
return false;
}

@Override
public boolean persistent() {
return false;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.cryptomator.data.cloud.local.storageaccessframework
package org.cryptomator.data.cloud.local

import android.util.LruCache
import org.cryptomator.domain.CloudFolder
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.cryptomator.data.cloud.local.storageaccessframework
package org.cryptomator.data.cloud.local

import android.net.Uri
import org.cryptomator.domain.Cloud
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.cryptomator.data.cloud.local.storageaccessframework
package org.cryptomator.data.cloud.local

import android.net.Uri
import org.cryptomator.domain.Cloud
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.cryptomator.data.cloud.local.storageaccessframework
package org.cryptomator.data.cloud.local

import android.content.Context
import org.cryptomator.domain.LocalStorageCloud
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.cryptomator.data.cloud.local.storageaccessframework
package org.cryptomator.data.cloud.local

import android.content.ContentResolver
import android.content.Context
Expand All @@ -7,10 +7,10 @@ import android.net.Uri
import android.os.Build
import android.provider.DocumentsContract
import androidx.documentfile.provider.DocumentFile
import org.cryptomator.data.cloud.local.storageaccessframework.LocalStorageAccessFrameworkNodeFactory.file
import org.cryptomator.data.cloud.local.storageaccessframework.LocalStorageAccessFrameworkNodeFactory.folder
import org.cryptomator.data.cloud.local.storageaccessframework.LocalStorageAccessFrameworkNodeFactory.from
import org.cryptomator.data.cloud.local.storageaccessframework.LocalStorageAccessFrameworkNodeFactory.getNodePath
import org.cryptomator.data.cloud.local.LocalStorageAccessFrameworkNodeFactory.file
import org.cryptomator.data.cloud.local.LocalStorageAccessFrameworkNodeFactory.folder
import org.cryptomator.data.cloud.local.LocalStorageAccessFrameworkNodeFactory.from
import org.cryptomator.data.cloud.local.LocalStorageAccessFrameworkNodeFactory.getNodePath
import org.cryptomator.data.util.CopyStream
import org.cryptomator.data.util.TransferredBytesAwareInputStream
import org.cryptomator.data.util.TransferredBytesAwareOutputStream
Expand Down Expand Up @@ -243,7 +243,8 @@ internal class LocalStorageAccessFrameworkImpl(context: Context, private val mim
private fun rename(source: LocalStorageAccessNode, name: String): LocalStorageAccessNode {
source.parent?.let { parent ->
var newUri = try {
DocumentsContract.renameDocument(contentResolver(), source.uri, name)
requireNotNull(source.uri)
DocumentsContract.renameDocument(contentResolver(), source.uri!!, name)
} catch (e: FileNotFoundException) {
/* Bug in Android 9 see #460 TLDR; In this renameDocument-method, Android 9 throws
a `FileNotFoundException` although the file exists and is also renamed. */
Expand Down Expand Up @@ -336,11 +337,13 @@ internal class LocalStorageAccessFrameworkImpl(context: Context, private val mim

private fun createNewDocumentSupplier(file: LocalStorageAccessFile): Supplier<Uri?> {
return Supplier {
val mimeType = if (mimeTypes.fromFilename(file.name) == null) MimeType.APPLICATION_OCTET_STREAM else mimeTypes.fromFilename(file.name)
try {
DocumentsContract.createDocument(contentResolver(), file.parent.uri, mimeType.toString(), file.name) // FIXME
} catch (e: FileNotFoundException) {
null
file.parent.uri?.let {
val mimeType = if (mimeTypes.fromFilename(file.name) == null) MimeType.APPLICATION_OCTET_STREAM else mimeTypes.fromFilename(file.name)
try {
DocumentsContract.createDocument(contentResolver(), it, mimeType.toString(), file.name)
} catch (e: FileNotFoundException) {
null
}
}
}
}
Expand Down Expand Up @@ -372,7 +375,7 @@ internal class LocalStorageAccessFrameworkImpl(context: Context, private val mim
fun delete(node: LocalStorageAccessNode) {
requireNotNull(node.uri)
try {
DocumentsContract.deleteDocument(contentResolver(), node.uri)
DocumentsContract.deleteDocument(contentResolver(), node.uri!!)
} catch (e: FileNotFoundException) {
throw NoSuchCloudFileException(node.name)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.cryptomator.data.cloud.local.storageaccessframework
package org.cryptomator.data.cloud.local

import android.database.Cursor
import android.provider.DocumentsContract
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.cryptomator.data.cloud.local.storageaccessframework
package org.cryptomator.data.cloud.local

import android.net.Uri
import org.cryptomator.domain.CloudNode
Expand Down
Loading

0 comments on commit 7a2ccf8

Please sign in to comment.