From 22ed045ea70658038f0c2b65ce5bc68f56660f26 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Thu, 28 Oct 2021 07:04:29 +0530 Subject: Upgrade dependencies (#1526) * gradle: upgrade all dependencies * github: replace gradle-cache-action with official gradle-build-action * github: update wrapper-validation-action --- .github/workflows/deploy_github_releases.yml | 2 +- .github/workflows/deploy_library_releases.yml | 4 +-- .github/workflows/deploy_snapshot.yml | 2 +- .github/workflows/pull_request.yml | 4 +-- .github/workflows/update_publicsuffix_data.yml | 2 +- .github/workflows/validate_gradle_wrapper.yml | 2 +- .../aps/util/git/sshj/SshjSessionFactory.kt | 30 ++++++++++++++-------- gradle/libs.versions.toml | 20 +++++++-------- 8 files changed, 37 insertions(+), 29 deletions(-) diff --git a/.github/workflows/deploy_github_releases.yml b/.github/workflows/deploy_github_releases.yml index 26e946e5..05b90e2c 100644 --- a/.github/workflows/deploy_github_releases.yml +++ b/.github/workflows/deploy_github_releases.yml @@ -25,7 +25,7 @@ jobs: run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties - name: Build release binaries - uses: burrunan/gradle-cache-action@03c71a8ba93d670980695505f48f49daf43704a6 + uses: gradle/gradle-build-action@cba1833ddecbbee649950c284416981928631008 with: arguments: :app:assembleFreeRelease :app:assembleNonFreeRelease :app:bundleNonFreeRelease diff --git a/.github/workflows/deploy_library_releases.yml b/.github/workflows/deploy_library_releases.yml index f5b7d861..d3c27a91 100644 --- a/.github/workflows/deploy_library_releases.yml +++ b/.github/workflows/deploy_library_releases.yml @@ -28,7 +28,7 @@ jobs: fi - name: Upload binaries - uses: burrunan/gradle-cache-action@03c71a8ba93d670980695505f48f49daf43704a6 + uses: gradle/gradle-build-action@cba1833ddecbbee649950c284416981928631008 with: arguments: :${{ steps.task-select.outputs.PROJECT }}:publishAllPublicationsToMavenCentralRepository env: @@ -38,7 +38,7 @@ jobs: ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.NEXUS_PUBLISH_GPG_KEY_PASSWORD }} - name: Close and release repository - uses: burrunan/gradle-cache-action@03c71a8ba93d670980695505f48f49daf43704a6 + uses: gradle/gradle-build-action@cba1833ddecbbee649950c284416981928631008 with: arguments: closeAndReleaseRepository env: diff --git a/.github/workflows/deploy_snapshot.yml b/.github/workflows/deploy_snapshot.yml index 1c7cdb67..cc5e6b26 100644 --- a/.github/workflows/deploy_snapshot.yml +++ b/.github/workflows/deploy_snapshot.yml @@ -25,7 +25,7 @@ jobs: run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties - name: Build release app - uses: burrunan/gradle-cache-action@03c71a8ba93d670980695505f48f49daf43704a6 + uses: gradle/gradle-build-action@cba1833ddecbbee649950c284416981928631008 env: SNAPSHOT: "true" with: diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 7ecceb49..964bf9ce 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -35,13 +35,13 @@ jobs: - name: Build debug APKs if: ${{ steps.service-changed.outputs.result == 'true' }} - uses: burrunan/gradle-cache-action@03c71a8ba93d670980695505f48f49daf43704a6 + uses: gradle/gradle-build-action@cba1833ddecbbee649950c284416981928631008 with: arguments: assembleFreeDebug assembleNonFreeDebug - name: Run unit tests if: ${{ steps.service-changed.outputs.result == 'true' }} - uses: burrunan/gradle-cache-action@03c71a8ba93d670980695505f48f49daf43704a6 + uses: gradle/gradle-build-action@cba1833ddecbbee649950c284416981928631008 with: arguments: apiCheck test lintFreeDebug spotlessCheck -PslimTests diff --git a/.github/workflows/update_publicsuffix_data.yml b/.github/workflows/update_publicsuffix_data.yml index 7c84aecf..2bfb51f8 100644 --- a/.github/workflows/update_publicsuffix_data.yml +++ b/.github/workflows/update_publicsuffix_data.yml @@ -14,7 +14,7 @@ jobs: fetch-depth: 0 - name: Download new publicsuffix data - uses: burrunan/gradle-cache-action@03c71a8ba93d670980695505f48f49daf43704a6 + uses: gradle/gradle-build-action@cba1833ddecbbee649950c284416981928631008 with: arguments: updatePSL diff --git a/.github/workflows/validate_gradle_wrapper.yml b/.github/workflows/validate_gradle_wrapper.yml index 52fc9eea..8d83d5f0 100644 --- a/.github/workflows/validate_gradle_wrapper.yml +++ b/.github/workflows/validate_gradle_wrapper.yml @@ -13,4 +13,4 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f - - uses: gradle/wrapper-validation-action@e2c57acffb2c9aa5a8dc6eda2bbae0b6e495bd4c + - uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b diff --git a/app/src/main/java/dev/msfjarvis/aps/util/git/sshj/SshjSessionFactory.kt b/app/src/main/java/dev/msfjarvis/aps/util/git/sshj/SshjSessionFactory.kt index 79438bcc..50c146cc 100644 --- a/app/src/main/java/dev/msfjarvis/aps/util/git/sshj/SshjSessionFactory.kt +++ b/app/src/main/java/dev/msfjarvis/aps/util/git/sshj/SshjSessionFactory.kt @@ -13,6 +13,8 @@ import java.io.File import java.io.IOException import java.io.InputStream import java.io.OutputStream +import java.security.PublicKey +import java.util.Collections import java.util.concurrent.TimeUnit import kotlin.coroutines.Continuation import kotlin.coroutines.suspendCoroutine @@ -88,19 +90,25 @@ class SshjSessionFactory(private val authMethod: SshAuthMethod, private val host private fun makeTofuHostKeyVerifier(hostKeyFile: File): HostKeyVerifier { if (!hostKeyFile.exists()) { - return HostKeyVerifier { _, _, key -> - val digest = - runCatching { SecurityUtils.getMessageDigest("SHA-256") }.getOrElse { e -> - throw SSHRuntimeException(e) + return object : HostKeyVerifier { + override fun verify(hostname: String?, port: Int, key: PublicKey?): Boolean { + val digest = + runCatching { SecurityUtils.getMessageDigest("SHA-256") }.getOrElse { e -> + throw SSHRuntimeException(e) + } + digest.update(PlainBuffer().putPublicKey(key).compactData) + val digestData = digest.digest() + val hostKeyEntry = "SHA256:${Base64.encodeToString(digestData, Base64.NO_WRAP)}" + logcat(SshjSessionFactory::class.java.simpleName) { + "Trusting host key on first use: $hostKeyEntry" } - digest.update(PlainBuffer().putPublicKey(key).compactData) - val digestData = digest.digest() - val hostKeyEntry = "SHA256:${Base64.encodeToString(digestData, Base64.NO_WRAP)}" - logcat(SshjSessionFactory::class.java.simpleName) { - "Trusting host key on first use: $hostKeyEntry" + hostKeyFile.writeText(hostKeyEntry) + return true + } + + override fun findExistingAlgorithms(hostname: String?, port: Int): MutableList { + return Collections.emptyList() } - hostKeyFile.writeText(hostKeyEntry) - true } } else { val hostKeyEntry = hostKeyFile.readText() diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 8e22f4d2..f4f227fc 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,14 +1,14 @@ # Centralized versions for dependencies that share versions [versions] -androidx_activity = "1.4.0-beta01" +androidx_activity = "1.4.0" androidx_test = "1.4.1-alpha03" -compose = "1.1.0-alpha05" +compose = "1.1.0-beta01" composeSnapshot = "-" coroutines = "1.5.2" flowbinding = "1.2.0" hilt = "2.39.1" kotlin = "1.5.31" -lifecycle = "2.4.0-rc01" +lifecycle = "2.4.0" [libraries] # Kotlin dependencies @@ -20,19 +20,19 @@ androidx-activity-ktx = { module = "androidx.activity:activity-ktx", version.ref androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx_activity" } androidx-annotation = "androidx.annotation:annotation:1.2.0" androidx-autofill = "androidx.autofill:autofill:1.2.0-beta01" -androidx-appcompat = "androidx.appcompat:appcompat:1.4.0-beta01" +androidx-appcompat = "androidx.appcompat:appcompat:1.4.0-rc01" androidx-biometricKtx = "androidx.biometric:biometric-ktx:1.2.0-alpha03" androidx-constraintlayout = "androidx.constraintlayout:constraintlayout:2.1.1" -androidx-core-ktx = "androidx.core:core-ktx:1.7.0-beta02" +androidx-core-ktx = "androidx.core:core-ktx:1.7.0" androidx-documentfile = "androidx.documentfile:documentfile:1.1.0-alpha01" -androidx-fragment-ktx = "androidx.fragment:fragment-ktx:1.4.0-alpha10" +androidx-fragment-ktx = "androidx.fragment:fragment-ktx:1.4.0-beta01" androidx-hilt-compose = "androidx.hilt:hilt-navigation-compose:1.0.0-alpha03" androidx-lifecycle-common = { module = "androidx.lifecycle:lifecycle-common", version.ref="lifecycle" } androidx-lifecycle-livedataKtx = { module = "androidx.lifecycle:lifecycle-livedata-ktx", version.ref="lifecycle" } androidx-lifecycle-viewmodelKtx = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref="lifecycle" } androidx-lifecycle-viewmodel-compose = "androidx.lifecycle:lifecycle-viewmodel-compose:1.0.0-alpha07" -androidx-material = "com.google.android.material:material:1.5.0-alpha04" -androidx-preference = "androidx.preference:preference:1.1.1" +androidx-material = "com.google.android.material:material:1.5.0-alpha05" +androidx-preference = "androidx.preference:preference:1.2.0-alpha01" androidx-recyclerview = "androidx.recyclerview:recyclerview:1.3.0-alpha01" androidx-recyclerviewSelection = "androidx.recyclerview:recyclerview-selection:1.2.0-alpha01" androidx-security = "androidx.security:security-crypto:1.1.0-alpha03" @@ -75,9 +75,9 @@ thirdparty-kotlinResult = "com.michael-bull.kotlin-result:kotlin-result:1.1.12" thirdparty-leakcanary = "com.squareup.leakcanary:leakcanary-android:2.7" thirdparty-logcat = "com.squareup.logcat:logcat:0.1" thirdparty-modernAndroidPrefs = "de.maxr1998:modernandroidpreferences:2.1.0" -thirdparty-pgpainless = "org.pgpainless:pgpainless-core:0.2.17" +thirdparty-pgpainless = "org.pgpainless:pgpainless-core:0.2.18" thirdparty-plumber = "com.squareup.leakcanary:plumber-android:2.7" -thirdparty-sshj = "com.hierynomus:sshj:0.31.0" +thirdparty-sshj = "com.hierynomus:sshj:0.32.0" thirdparty-sshauth = "com.github.open-keychain.open-keychain:sshauthentication-api:5.7.5" thirdparty-whatthestack = "com.github.haroldadmin:WhatTheStack:0.3.1" thirdparty-nonfree-googlePlayAuthApiPhone = "com.google.android.gms:play-services-auth-api-phone:17.5.1" -- cgit v1.2.3