diff --git a/app/build.gradle b/app/build.gradle index c4dced2..adff3dc 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -29,12 +29,12 @@ def getGitBranch = { -> return getCmdOutput(["git", "rev-parse", "--abbrev-ref", android { namespace packageName - compileSdk 34 + compileSdk 35 defaultConfig { applicationId packageName minSdkVersion 27 - targetSdkVersion 34 + targetSdkVersion 35 versionCode 3 versionName "0.1.2" @@ -104,12 +104,12 @@ android { } kotlinOptions { - jvmTarget = '1.8' + jvmTarget = JavaVersion.VERSION_1_8 } lint { abortOnError true - disable 'MissingTranslation' + checkDependencies true } aboutLibraries { @@ -125,16 +125,16 @@ android { dependencies { def roomVersion = "2.6.1" - def espressoVersion = "3.5.1" + def espressoVersion = '3.5.1' - implementation 'androidx.appcompat:appcompat:1.6.1' + implementation 'androidx.appcompat:appcompat:1.7.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' - implementation 'androidx.core:core-ktx:1.12.0' - implementation "androidx.fragment:fragment-ktx:1.6.2" - implementation 'androidx.navigation:navigation-fragment-ktx:2.7.7' - implementation 'androidx.navigation:navigation-ui-ktx:2.7.7' + implementation 'androidx.core:core-ktx:1.13.1' + implementation 'androidx.fragment:fragment-ktx:1.8.4' + implementation 'androidx.navigation:navigation-fragment-ktx:2.8.3' + implementation 'androidx.navigation:navigation-ui-ktx:2.8.3' implementation "androidx.room:room-runtime:$roomVersion" - implementation 'com.google.android.material:material:1.11.0' + implementation 'com.google.android.material:material:1.12.0' implementation "com.google.dagger:hilt-android:$hiltVersion" implementation "com.mikepenz:aboutlibraries:$aboutLibrariesVersion" implementation "com.mikepenz:aboutlibraries-core:$aboutLibrariesVersion" @@ -144,20 +144,21 @@ dependencies { implementation 'com.squareup.retrofit2:converter-simplexml:2.11.0' implementation 'com.github.thegrizzlylabs:sardine-android:0.9' implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion" - implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.0' + implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.9.0' kapt "androidx.room:room-compiler:$roomVersion" kapt "com.google.dagger:hilt-android-compiler:$hiltVersion" + // NOTE: Don't update test/espresso libraries until this is resolved: https://github.com/android/android-test/issues/2273 testImplementation 'junit:junit:4.13.2' - androidTestImplementation "androidx.test:core:1.5.0" - androidTestImplementation "androidx.test:runner:1.5.2" - androidTestImplementation "androidx.test:rules:1.5.0" + androidTestImplementation 'androidx.test:core:1.5.0' + androidTestImplementation 'androidx.test:runner:1.5.2' + androidTestImplementation 'androidx.test:rules:1.5.0' androidTestImplementation 'androidx.test.ext:junit:1.1.5' androidTestImplementation "androidx.test.espresso:espresso-contrib:$espressoVersion" androidTestImplementation "androidx.test.espresso:espresso-core:$espressoVersion" androidTestImplementation "androidx.test.espresso:espresso-intents:$espressoVersion" androidTestImplementation "androidx.test.uiautomator:uiautomator:2.3.0" androidTestImplementation "com.google.dagger:hilt-android-testing:$hiltVersion" - androidTestUtil "androidx.test:orchestrator:1.4.2" + androidTestUtil 'androidx.test:orchestrator:1.4.2' kaptAndroidTest "com.google.dagger:hilt-android-compiler:$hiltVersion" } diff --git a/app/lint.xml b/app/lint.xml new file mode 100644 index 0000000..9425588 --- /dev/null +++ b/app/lint.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/app/src/androidTest/java/dev/rocli/android/webdav/ScreenshotTest.kt b/app/src/androidTest/java/dev/rocli/android/webdav/ScreenshotTest.kt index 7c2409b..b5691d1 100644 --- a/app/src/androidTest/java/dev/rocli/android/webdav/ScreenshotTest.kt +++ b/app/src/androidTest/java/dev/rocli/android/webdav/ScreenshotTest.kt @@ -73,7 +73,7 @@ class ScreenshotTest { scenario.close() } - @Test + @Test(timeout = 5000) fun takeShowcaseScreenshots() { onView(withId(R.id.rvAccounts)) .check(matches(hasDescendant(withText("Nextcloud")))) diff --git a/app/src/main/java/dev/rocli/android/webdav/activities/MainActivity.kt b/app/src/main/java/dev/rocli/android/webdav/activities/MainActivity.kt index c64a158..bd39fac 100644 --- a/app/src/main/java/dev/rocli/android/webdav/activities/MainActivity.kt +++ b/app/src/main/java/dev/rocli/android/webdav/activities/MainActivity.kt @@ -1,12 +1,12 @@ package dev.rocli.android.webdav.activities +import android.graphics.drawable.Drawable import android.os.Bundle import android.view.Menu import android.view.MenuItem import android.view.View.GONE import android.view.View.VISIBLE import android.view.ViewGroup -import androidx.annotation.ColorInt import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.view.ActionMode import androidx.core.view.ViewPropertyAnimatorCompat @@ -14,6 +14,7 @@ import androidx.navigation.NavController import androidx.navigation.NavGraph.Companion.findStartDestination import androidx.navigation.findNavController import androidx.navigation.ui.NavigationUI.setupActionBarWithNavController +import com.google.android.material.appbar.AppBarLayout import com.google.android.material.color.DynamicColors import com.google.android.material.color.MaterialColors import dagger.hilt.android.AndroidEntryPoint @@ -99,9 +100,7 @@ class MainActivity : AppCompatActivity() { private inner class ActionModeStatusGuardHack { private var fadeAnimField: Field? = null private var actionModeViewField: Field? = null - - @ColorInt - private val statusBarColor: Int = window.statusBarColor + private var appBarBackground: Drawable? = null init { try { @@ -115,7 +114,7 @@ class MainActivity : AppCompatActivity() { } } - public fun apply(visibility: Int) { + fun apply(visibility: Int) { if (fadeAnimField == null || actionModeViewField == null) { return } @@ -123,27 +122,34 @@ class MainActivity : AppCompatActivity() { val fadeAnim: ViewPropertyAnimatorCompat? val actionModeView: ViewGroup? try { - fadeAnim = fadeAnimField?.get(getDelegate()) as ViewPropertyAnimatorCompat? - actionModeView = actionModeViewField?.get(getDelegate()) as ViewGroup? + fadeAnim = fadeAnimField?.get(delegate) as ViewPropertyAnimatorCompat? + actionModeView = actionModeViewField?.get(delegate) as ViewGroup? } catch (e: IllegalAccessException) { return } - if (fadeAnim == null || actionModeView == null) { - return + val appBarLayout = findViewById(R.id.app_bar_layout) + if (appBarLayout != null && appBarBackground == null) { + appBarBackground = appBarLayout.background } + if (fadeAnim == null || actionModeView == null || appBarLayout == null || appBarBackground == null) { + return + } fadeAnim.cancel() - actionModeView.visibility = visibility - actionModeView.setAlpha(if (visibility == VISIBLE) 1f else 0f) - window.statusBarColor = if (visibility == VISIBLE) { - MaterialColors.getColor( - actionModeView, + if (visibility == VISIBLE) { + actionModeView.visibility = VISIBLE + actionModeView.alpha = 1f + val color = MaterialColors.getColor( + appBarLayout, com.google.android.material.R.attr.colorSurfaceContainer ) + appBarLayout.setBackgroundColor(color) } else { - statusBarColor + actionModeView.visibility = GONE + actionModeView.alpha = 0f + appBarLayout.background = appBarBackground } } } diff --git a/app/src/main/java/dev/rocli/android/webdav/provider/WebDavClient.kt b/app/src/main/java/dev/rocli/android/webdav/provider/WebDavClient.kt index 7f02c6f..a642cd2 100644 --- a/app/src/main/java/dev/rocli/android/webdav/provider/WebDavClient.kt +++ b/app/src/main/java/dev/rocli/android/webdav/provider/WebDavClient.kt @@ -305,12 +305,14 @@ class WebDavClient( trustManagerFactory.trustManagers } else { hostnameVerifier { _, _ -> true } - arrayOf(@SuppressLint("CustomX509TrustManager") - object : X509TrustManager { - override fun getAcceptedIssuers(): Array = arrayOf() - override fun checkClientTrusted(certs: Array, authType: String) = Unit - override fun checkServerTrusted(certs: Array, authType: String) = Unit - }) + arrayOf( + @SuppressLint("CustomX509TrustManager") + object : X509TrustManager { + override fun getAcceptedIssuers(): Array = arrayOf() + override fun checkClientTrusted(certs: Array, authType: String) = Unit + override fun checkServerTrusted(certs: Array, authType: String) = Unit + } + ) } sslContext.init(keyManager, trustManager, SecureRandom()) sslSocketFactory(sslContext.socketFactory, trustManager.first() as X509TrustManager) diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index b9f5690..6290e15 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -1,5 +1,5 @@ - + #29638A #29638A #FFFFFF diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 3140292..60274fa 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,7 +1,7 @@ - + WebDAV WebDAV Provider - WebDAV Provider (Debug) + WebDAV Provider (Debug) About Save Edit diff --git a/build.gradle b/build.gradle index 4cd32a5..30028c9 100644 --- a/build.gradle +++ b/build.gradle @@ -1,8 +1,8 @@ buildscript { ext { - aboutLibrariesVersion = '11.1.1' - hiltVersion = '2.51.1' - kotlinVersion = '1.9.23' + aboutLibrariesVersion = '11.2.3' + hiltVersion = '2.52' + kotlinVersion = '2.0.21' } repositories { @@ -12,8 +12,8 @@ buildscript { } dependencies { - classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.7.7" - classpath 'com.android.tools.build:gradle:8.3.1' + classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.8.3" + classpath 'com.android.tools.build:gradle:8.7.1' classpath "com.google.dagger:hilt-android-gradle-plugin:$hiltVersion" classpath "com.mikepenz.aboutlibraries.plugin:aboutlibraries-plugin:$aboutLibrariesVersion" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml index c2de17c..158b8d2 100644 --- a/gradle/verification-metadata.xml +++ b/gradle/verification-metadata.xml @@ -1,13 +1,8 @@ - + true false - - - - - @@ -18,36 +13,30 @@ - - - + + + - - - - - - - - - + + + - - - - + + - - + + + + - - + + @@ -80,8 +69,13 @@ - - + + + + + + + @@ -106,19 +100,31 @@ - - + + + + - - - + + + + + + + + - - + + + + + + + @@ -134,15 +140,12 @@ - - - - - - + + + - - + + @@ -158,15 +161,12 @@ - - - + + + - - - - - + + @@ -184,9 +184,6 @@ - - - @@ -211,9 +208,6 @@ - - - @@ -236,6 +230,19 @@ + + + + + + + + + + + + + @@ -244,9 +251,12 @@ - - - + + + + + + @@ -256,9 +266,6 @@ - - - @@ -275,9 +282,6 @@ - - - @@ -286,9 +290,6 @@ - - - @@ -306,15 +307,17 @@ - - - + + + - - + + + + - - + + @@ -330,20 +333,12 @@ - - - + + + - - - - - - - - - - + + @@ -382,76 +377,61 @@ - - - - - - - - - + + + - - + + - - + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - - - - + + - - - - - - + + + - - + + - - - + + + - - - - - + + @@ -483,31 +463,25 @@ - - - - - - + + + - - + + - - - - - - - - - + + + + + + @@ -518,26 +492,25 @@ - - - + + + - - + + + + - - + + - - - - - - + + + - - + + @@ -590,15 +563,17 @@ - - - + + + - - + + + + - - + + @@ -625,15 +600,12 @@ - - - - - - + + + - - + + @@ -660,15 +632,12 @@ - - - + + + - - - - - + + @@ -684,26 +653,20 @@ - - - - - - + + + - - + + - - - + + + - - - - - + + @@ -722,15 +685,12 @@ - - - - - - + + + - - + + @@ -762,15 +722,17 @@ - - - + + + - - + + + + - - + + @@ -789,15 +751,17 @@ - - - + + + - - + + + + - - + + @@ -816,15 +780,12 @@ - - - - - - + + + - - + + @@ -851,15 +812,20 @@ - - - + + + - - + + - - + + + + + + + @@ -875,15 +841,12 @@ - - - + + + - - - - - + + @@ -907,15 +870,12 @@ - - - - - - + + + - - + + @@ -942,108 +902,84 @@ - - - + + + - - - - - + + - - - - - - + + + - - + + - - - - - - + + + - - + + - - - + + + - - - - - + + - - - - - - + + + - - + + - - - + + + - - - - - + + - - - + + + - - + + - - - + + + - - + + - - - - - - + + + - - + + - - - + + + - - - - - + + @@ -1054,15 +990,12 @@ - - - - - - + + + - - + + @@ -1093,9 +1026,6 @@ - - - @@ -1104,9 +1034,6 @@ - - - @@ -1115,9 +1042,6 @@ - - - @@ -1150,9 +1074,6 @@ - - - @@ -1169,9 +1090,6 @@ - - - @@ -1180,9 +1098,6 @@ - - - @@ -1191,9 +1106,6 @@ - - - @@ -1202,9 +1114,6 @@ - - - @@ -1213,14 +1122,6 @@ - - - - - - - - @@ -1229,9 +1130,6 @@ - - - @@ -1349,9 +1247,6 @@ - - - @@ -1360,9 +1255,6 @@ - - - @@ -1372,20 +1264,12 @@ - - - - - - - - - - - + + + - - + + @@ -1435,9 +1319,6 @@ - - - @@ -1446,230 +1327,221 @@ - - - - - + + - - + + - - + + - - + + - - + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - - - - + + + - - - - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + @@ -1696,268 +1568,284 @@ - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - + + - - + + - - - + + + - - + + - - + + - - + + - - - + + + - - + + - - + + - - + + - - - + + + - - + + - - + + + + + + + + + + + + + + + + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - + + - - + + - - - + + + - - + + - - + + - - + + - - - + + + - - + + - - + + - - + + - - - + + + - - + + - - + + - - + + - - - + + + - - + + - - + + - - + + - - - + + + - - + + - - + + - - + + - - - + + + - - + + @@ -1967,9 +1855,6 @@ - - - @@ -1992,15 +1877,12 @@ - - - - - - + + + - - + + @@ -2020,9 +1902,6 @@ - - - @@ -2123,84 +2002,84 @@ - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + @@ -2208,12 +2087,12 @@ - - - + + + - - + + @@ -2512,45 +2391,28 @@ - - - - - - + + + - - + + - - - + + + - - + + - - - - - - + + + - - - - - - - - - - - - + @@ -2560,22 +2422,16 @@ - - - - - - + + + - - + + - - - @@ -2627,9 +2483,6 @@ - - - @@ -2638,9 +2491,6 @@ - - - @@ -2657,9 +2507,6 @@ - - - @@ -2668,9 +2515,6 @@ - - - @@ -2679,9 +2523,6 @@ - - - @@ -2952,6 +2793,14 @@ + + + + + + + + @@ -3172,28 +3021,36 @@ - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + + + + + + + + + @@ -3233,12 +3090,12 @@ - - - + + + - - + + @@ -3269,6 +3126,11 @@ + + + + + @@ -3375,28 +3237,20 @@ - - - - - - - - - - - + + + - - + + - - - + + + - - + + @@ -3404,169 +3258,169 @@ - - - + + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + @@ -3593,44 +3447,44 @@ - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + @@ -3652,9 +3506,6 @@ - - - @@ -3662,18 +3513,34 @@ - - + + - - + + - - + + - - + + + + + + + + + + + + + + + + + + @@ -3699,14 +3566,19 @@ - - - + + + + + + + + - - - + + + @@ -3749,12 +3621,12 @@ - - - + + + - - + + @@ -3802,36 +3674,36 @@ - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + @@ -3873,9 +3745,6 @@ - - - @@ -3898,15 +3767,12 @@ - - - - - - + + + - - + + @@ -3919,9 +3785,14 @@ - - - + + + + + + + + @@ -3945,20 +3816,17 @@ - - - - - - + + + - - - + + + - - + + @@ -3969,15 +3837,12 @@ - - - - - - + + + - - + + @@ -3985,42 +3850,51 @@ + + + + + - - + + + + + + + - - - - - - - - - + + + - - + + - - - + + + - - + + + + + + + - - + + diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ad78386..3f66b4e 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,7 @@ #Fri Mar 01 15:45:22 GMT 2024 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=f2b9ed0faf8472cbe469255ae6c86eddb77076c75191741b4a462f33128dd419 -distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip +distributionSha256Sum=258e722ec21e955201e31447b0aed14201765a3bfbae296a46cf60b70e66db70 +distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/tests/docker-compose.yml b/tests/docker-compose.yml index a0dc6eb..a660599 100644 --- a/tests/docker-compose.yml +++ b/tests/docker-compose.yml @@ -17,7 +17,7 @@ services: healthcheck: test: "curl -v -L --fail-with-body http://127.0.0.1/health || exit 1" start_period: 5s - start_interval: 1s + #start_interval: 1s webdav-hacdias: build: ./servers/hacdias volumes: @@ -27,7 +27,7 @@ services: healthcheck: test: "curl -v --fail-with-body -u test:test -X PROPFIND http://127.0.0.1 || exit 1" start_period: 5s - start_interval: 1s + #start_interval: 1s webdav-nginx: build: ./servers/nginx volumes: @@ -39,7 +39,7 @@ services: healthcheck: test: "curl -v --fail-with-body -X PROPFIND http://127.0.0.1 || exit 1" start_period: 5s - start_interval: 1s + #start_interval: 1s webdav-nginx-apache-subpath: build: ./servers/nginx volumes: @@ -56,7 +56,7 @@ services: healthcheck: test: "curl -v --fail-with-body -L -X PROPFIND -H 'Depth: 1' http://127.0.0.1/webdav || exit 1" start_period: 5s - start_interval: 1s + #start_interval: 1s webdav-nextcloud: build: ./servers/nextcloud volumes: @@ -73,7 +73,7 @@ services: healthcheck: test: "curl -v -L --fail-with-body -u admin:admin -X PROPFIND http://127.0.0.1/remote.php/dav/files/admin || exit 1" start_period: 20s - start_interval: 1s + #start_interval: 1s webdav-apache: build: ./servers/apache volumes: @@ -83,7 +83,7 @@ services: healthcheck: test: "curl -v --fail-with-body -X PROPFIND -H 'Depth: 1' http://127.0.0.1 || exit 1" start_period: 5s - start_interval: 1s + #start_interval: 1s webdav-apache-subpath: build: ./servers/apache environment: @@ -98,4 +98,4 @@ services: healthcheck: test: "curl -v --fail-with-body -X PROPFIND -H 'Depth: 1' http://127.0.0.1/webdav || exit 1" start_period: 5s - start_interval: 1s + #start_interval: 1s