diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 6198983ef9..32e5d36946 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -180,7 +180,7 @@ val bitkitAndroidTestAnnotation = bitkitAndroidTestAnnotationName?.let { android { namespace = "to.bitkit" - compileSdk = 36 + compileSdk = 37 requestedNdkVersion?.let { ndkVersion = it } defaultConfig { applicationId = "to.bitkit" @@ -508,7 +508,7 @@ composeCompiler { reportsDestination = layout.buildDirectory.dir("compose_compiler") } -val nativeDebugSymbols by configurations.creating { +val nativeDebugSymbols = configurations.create("nativeDebugSymbols") { isCanBeConsumed = false isCanBeResolved = true } @@ -525,7 +525,7 @@ fun Provider.nativeDebugSymbolsArtifact(): Stri return "${dependency.module.group}:${dependency.module.name}:$version:native-debug-symbols@zip" } -val syncNativeDebugSymbolArtifacts by tasks.registering(Sync::class) { +tasks.register("syncNativeDebugSymbolArtifacts") { group = "build" description = "Downloads native debug symbol archives for release native dependencies." @@ -560,7 +560,7 @@ dependencies { val localBitkitCoreAar = providers.gradleProperty("bitkitCoreAar").orNull if (localBitkitCoreAar != null) { debugImplementation(files(localBitkitCoreAar)) - debugImplementation("org.jetbrains.kotlinx:atomicfu:0.23.1") + debugImplementation("org.jetbrains.kotlinx:atomicfu:0.33.0") releaseImplementation(libs.bitkit.core) } else { implementation(libs.bitkit.core) diff --git a/app/src/androidTest/java/to/bitkit/ui/utils/ScreenDeepLinkDetachmentTest.kt b/app/src/androidTest/java/to/bitkit/ui/utils/ScreenDeepLinkDetachmentTest.kt index 3696743ba5..7f5d0f966d 100644 --- a/app/src/androidTest/java/to/bitkit/ui/utils/ScreenDeepLinkDetachmentTest.kt +++ b/app/src/androidTest/java/to/bitkit/ui/utils/ScreenDeepLinkDetachmentTest.kt @@ -6,15 +6,13 @@ import androidx.activity.ComponentActivity import androidx.activity.compose.setContent import androidx.compose.material3.Text import androidx.compose.runtime.Composable -import androidx.compose.runtime.remember -import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.test.junit4.v2.createEmptyComposeRule import androidx.core.net.toUri import androidx.navigation.NavDestination.Companion.hasRoute -import androidx.navigation.compose.ComposeNavigator +import androidx.navigation.NavHostController import androidx.navigation.compose.NavHost import androidx.navigation.compose.composable -import androidx.navigation.testing.TestNavHostController +import androidx.navigation.compose.rememberNavController import androidx.test.core.app.ActivityScenario import androidx.test.core.app.ApplicationProvider import androidx.test.ext.junit.runners.AndroidJUnit4 @@ -38,7 +36,7 @@ class ScreenDeepLinkDetachmentTest { @get:Rule val composeTestRule = createEmptyComposeRule() - private lateinit var navController: TestNavHostController + private lateinit var navController: NavHostController @Test fun testAttachedScreenUriIsHandledByGraphWithoutGate() { @@ -117,12 +115,7 @@ class ScreenDeepLinkDetachmentTest { @Composable private fun TestGraph() { - val context = LocalContext.current - val controller = remember { - TestNavHostController(context).apply { - navigatorProvider.addNavigator(ComposeNavigator()) - } - } + val controller = rememberNavController() navController = controller NavHost(navController = controller, startDestination = Routes.Home) { diff --git a/app/src/debug/java/to/bitkit/dev/DevToolsProvider.kt b/app/src/debug/java/to/bitkit/dev/DevToolsProvider.kt index 00c57a69a1..6532aa1441 100644 --- a/app/src/debug/java/to/bitkit/dev/DevToolsProvider.kt +++ b/app/src/debug/java/to/bitkit/dev/DevToolsProvider.kt @@ -6,7 +6,6 @@ import android.net.Uri import android.os.Binder import android.os.Bundle import android.os.Process -import androidx.core.os.bundleOf import dagger.hilt.EntryPoint import dagger.hilt.InstallIn import dagger.hilt.android.EntryPointAccessors @@ -273,7 +272,7 @@ private sealed interface DevResult { @Serializable data class Error(val message: String? = null) : DevResult - fun toBundle() = bundleOf(KEY_RESULT to DEV_JSON.encodeToString(this)) + fun toBundle() = Bundle().apply { putString(KEY_RESULT, DEV_JSON.encodeToString(this@DevResult)) } } private fun ProbeOutcome.toDevResult(paymentIds: Set): DevResult = when (this) { diff --git a/app/src/main/java/to/bitkit/ext/Bluetooth.kt b/app/src/main/java/to/bitkit/ext/Bluetooth.kt new file mode 100644 index 0000000000..3c6cb79ba6 --- /dev/null +++ b/app/src/main/java/to/bitkit/ext/Bluetooth.kt @@ -0,0 +1,38 @@ +package to.bitkit.ext + +import android.Manifest +import android.bluetooth.BluetoothDevice +import android.bluetooth.BluetoothGatt +import android.bluetooth.BluetoothGattCallback +import android.bluetooth.BluetoothGattConnectionSettings +import android.content.Context +import android.os.Build +import androidx.annotation.RequiresPermission +import java.util.concurrent.Executor + +private val directExecutor = Executor(Runnable::run) + +/** + * Opens a direct GATT client connection to this device. + * + * From API 37 this uses [BluetoothGattConnectionSettings], with automatic MTU exchange turned off because the + * hardware wallet transports request their own MTU once connected. Older releases have only the legacy + * overload, which already behaves that way. + */ +@RequiresPermission(Manifest.permission.BLUETOOTH_CONNECT) +fun BluetoothDevice.connectGattDirect( + context: Context, + callback: BluetoothGattCallback, + transport: Int, +): BluetoothGatt? { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CINNAMON_BUN) { + val settings = BluetoothGattConnectionSettings.Builder() + .setAutoConnectEnabled(false) + .setAutomaticMtuEnabled(false) + .setTransport(transport) + .build() + return connectGatt(settings, directExecutor, callback) + } + @Suppress("DEPRECATION") // The replacement above does not exist before API 37. + return connectGatt(context, false, callback, transport) +} diff --git a/app/src/main/java/to/bitkit/repositories/PubkyRepo.kt b/app/src/main/java/to/bitkit/repositories/PubkyRepo.kt index 57a3d390dd..19aab37faf 100644 --- a/app/src/main/java/to/bitkit/repositories/PubkyRepo.kt +++ b/app/src/main/java/to/bitkit/repositories/PubkyRepo.kt @@ -303,12 +303,16 @@ class PubkyRepo @Inject constructor( private val labelOnly = contacts.filter { it.showsLabelOnly }.associateBy { it.profile.publicKey } val job = SupervisorJob(scope.coroutineContext.job) + + val refreshScope = CoroutineScope(scope.coroutineContext + job) val pendingResults = mutableMapOf() var scheduledApply: Job? = null private val bulkLookups = contacts.associate { - it.profile.publicKey to scope.launch(job, CoroutineStart.LAZY) { lookUp(this@ContactProfileRefresh, it) } + it.profile.publicKey to refreshScope.launch(start = CoroutineStart.LAZY) { + lookUp(this@ContactProfileRefresh, it) + } } - private val finish = scope.launch(job, CoroutineStart.LAZY) { + private val finish = refreshScope.launch(start = CoroutineStart.LAZY) { bulkLookups.values.joinAll() onFinished(this@ContactProfileRefresh) } @@ -1926,7 +1930,7 @@ class PubkyRepo @Inject constructor( private fun queueRefreshedContact(refresh: ContactProfileRefresh, refreshed: RefreshedContact) { refresh.pendingResults[refreshed.contact.profile.publicKey] = refreshed if (refresh.scheduledApply != null) return - refresh.scheduledApply = scope.launch(refresh.job) { + refresh.scheduledApply = refresh.refreshScope.launch { delay(CONTACT_REFRESH_BATCH_WINDOW) synchronized(contactsLock) { applyRefreshResults(refresh) } } diff --git a/app/src/main/java/to/bitkit/services/JadeTransport.kt b/app/src/main/java/to/bitkit/services/JadeTransport.kt index 63992b3d6d..d515f44573 100644 --- a/app/src/main/java/to/bitkit/services/JadeTransport.kt +++ b/app/src/main/java/to/bitkit/services/JadeTransport.kt @@ -35,6 +35,7 @@ import kotlinx.coroutines.flow.SharedFlow import kotlinx.coroutines.sync.Mutex import kotlinx.coroutines.sync.withLock import to.bitkit.ext.bluetoothManager +import to.bitkit.ext.connectGattDirect import to.bitkit.ext.usbManager import to.bitkit.models.HwWalletVendor import to.bitkit.models.TransportType @@ -661,7 +662,8 @@ class JadeTransport @Inject constructor( waitForBonding(device, address)?.let { return it } val connectionLatch = CountDownLatch(1) - val gatt = device.connectGatt(context, false, gattCallback, BluetoothDevice.TRANSPORT_LE) + val gatt = device.connectGattDirect(context, gattCallback, BluetoothDevice.TRANSPORT_LE) + ?: return fail("BLE connection could not be opened", JadeTransportErrorCode.NOT_CONNECTED) bleConnections[path] = BleConnection(gatt = gatt, connectionLatch = connectionLatch) if (!connectionLatch.await(BLE_CONNECTION_TIMEOUT_MS, TimeUnit.MILLISECONDS)) { diff --git a/app/src/main/java/to/bitkit/services/TrezorTransport.kt b/app/src/main/java/to/bitkit/services/TrezorTransport.kt index 94346e0f32..5aef370689 100644 --- a/app/src/main/java/to/bitkit/services/TrezorTransport.kt +++ b/app/src/main/java/to/bitkit/services/TrezorTransport.kt @@ -38,6 +38,7 @@ import kotlinx.coroutines.flow.update import kotlinx.coroutines.sync.Mutex import kotlinx.coroutines.sync.withLock import to.bitkit.ext.bluetoothManager +import to.bitkit.ext.connectGattDirect import to.bitkit.ext.nowMs import to.bitkit.ext.usbManager import to.bitkit.models.TransportType @@ -927,7 +928,12 @@ class TrezorTransport @Inject constructor( if (bondError != null) return bondError val connectionLatch = CountDownLatch(1) - val gatt = device.connectGatt(context, false, bleGattCallback) + val gatt = device.connectGattDirect(context, bleGattCallback, BluetoothDevice.TRANSPORT_AUTO) + ?: return TrezorTransportWriteResult( + success = false, + error = "BLE connection could not be opened: $path", + errorCode = null, + ) val connection = BleConnection( gatt = gatt, diff --git a/app/src/main/java/to/bitkit/ui/screens/contacts/ContactDetailViewModel.kt b/app/src/main/java/to/bitkit/ui/screens/contacts/ContactDetailViewModel.kt index d0a520144c..249ab16f12 100644 --- a/app/src/main/java/to/bitkit/ui/screens/contacts/ContactDetailViewModel.kt +++ b/app/src/main/java/to/bitkit/ui/screens/contacts/ContactDetailViewModel.kt @@ -152,7 +152,6 @@ class ContactDetailViewModel @Inject constructor( override fun onCleared() { paymentScanJob?.cancel() - super.onCleared() } private fun cancelPendingPayment() { diff --git a/app/src/main/java/to/bitkit/ui/screens/trezor/TrezorViewModel.kt b/app/src/main/java/to/bitkit/ui/screens/trezor/TrezorViewModel.kt index ce4e04cbf7..1c268b70eb 100644 --- a/app/src/main/java/to/bitkit/ui/screens/trezor/TrezorViewModel.kt +++ b/app/src/main/java/to/bitkit/ui/screens/trezor/TrezorViewModel.kt @@ -812,7 +812,6 @@ class TrezorViewModel @Inject constructor( override fun onCleared() { isCleared = true _uiState.value.activeWatcherId?.let { trezorRepo.stopWatcherOnCleared(it) } - super.onCleared() } fun clearError() { diff --git a/app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt b/app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt index 1d6d166319..c70142c321 100644 --- a/app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt +++ b/app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt @@ -7895,7 +7895,6 @@ class AppViewModel @Inject constructor( override fun onCleared() { isSubmittingPaymentRequest = false - super.onCleared() } fun beginHardwarePaymentSubmission(): () -> Unit = beginPaymentSubmission() diff --git a/app/src/main/java/to/bitkit/viewmodels/BackupsViewModel.kt b/app/src/main/java/to/bitkit/viewmodels/BackupsViewModel.kt index 350c2c716b..41548737a7 100644 --- a/app/src/main/java/to/bitkit/viewmodels/BackupsViewModel.kt +++ b/app/src/main/java/to/bitkit/viewmodels/BackupsViewModel.kt @@ -58,7 +58,6 @@ class BackupsViewModel @Inject constructor( } override fun onCleared() { - super.onCleared() backupRepo.stopObservingBackups() } diff --git a/app/src/main/java/to/bitkit/viewmodels/LdkDebugViewModel.kt b/app/src/main/java/to/bitkit/viewmodels/LdkDebugViewModel.kt index e8ae9aa73a..409df6d447 100644 --- a/app/src/main/java/to/bitkit/viewmodels/LdkDebugViewModel.kt +++ b/app/src/main/java/to/bitkit/viewmodels/LdkDebugViewModel.kt @@ -183,7 +183,6 @@ class LdkDebugViewModel @Inject constructor( } override fun onCleared() { - super.onCleared() File(context.cacheDir, DIR_EXPORTS).deleteRecursively() } } diff --git a/app/src/main/java/to/bitkit/viewmodels/QuickPayViewModel.kt b/app/src/main/java/to/bitkit/viewmodels/QuickPayViewModel.kt index 9b2264d1da..df3993bd46 100644 --- a/app/src/main/java/to/bitkit/viewmodels/QuickPayViewModel.kt +++ b/app/src/main/java/to/bitkit/viewmodels/QuickPayViewModel.kt @@ -67,7 +67,6 @@ class QuickPayViewModel @Inject constructor( override fun onCleared() { session?.let { quickPayRepo.detach(it) } - super.onCleared() } private fun QuickPaySessionEvent.toUiResult(): QuickPayResult = when (this) { diff --git a/app/src/main/java/to/bitkit/viewmodels/VssDebugViewModel.kt b/app/src/main/java/to/bitkit/viewmodels/VssDebugViewModel.kt index 4ca4db4902..e874b8205c 100644 --- a/app/src/main/java/to/bitkit/viewmodels/VssDebugViewModel.kt +++ b/app/src/main/java/to/bitkit/viewmodels/VssDebugViewModel.kt @@ -223,7 +223,6 @@ class VssDebugViewModel @Inject constructor( } override fun onCleared() { - super.onCleared() File(context.cacheDir, DIR_EXPORTS).deleteRecursively() } } diff --git a/app/src/test/java/to/bitkit/services/ElectrumProbeServiceTest.kt b/app/src/test/java/to/bitkit/services/ElectrumProbeServiceTest.kt index 60f121ec1b..3236e923a5 100644 --- a/app/src/test/java/to/bitkit/services/ElectrumProbeServiceTest.kt +++ b/app/src/test/java/to/bitkit/services/ElectrumProbeServiceTest.kt @@ -13,6 +13,8 @@ import org.bouncycastle.asn1.x509.GeneralNames import org.bouncycastle.cert.jcajce.JcaX509v3CertificateBuilder import org.bouncycastle.operator.jcajce.JcaContentSignerBuilder import org.junit.After +import org.junit.AfterClass +import org.junit.BeforeClass import org.junit.Test import org.lightningdevkit.ldknode.Network import to.bitkit.ext.nowMillis @@ -29,6 +31,8 @@ import java.net.SocketTimeoutException import java.security.KeyPair import java.security.KeyPairGenerator import java.security.KeyStore +import java.security.Provider +import java.security.Security import java.security.cert.CertPathValidatorException import java.security.cert.Certificate import java.security.cert.CertificateFactory @@ -71,8 +75,37 @@ private val KEY_PASSWORD = "probe".toCharArray() */ private const val JSSE_PROVIDER = "SunJSSE" +private const val CONSCRYPT_PROVIDER = "Conscrypt" + @OptIn(ExperimentalCoroutinesApi::class) class ElectrumProbeServiceTest : BaseUnitTest() { + companion object { + private var detachedConscrypt: Pair? = null + + /** + * Naming SunJSSE is not enough: its first server socket initialises `NamedGroup`, which asks the + * provider list for EC parameters, and Conscrypt 2.6 (Robolectric 4.17) answers and then throws on + * binary-field curves. The class fails to initialise for the rest of the JVM, so Conscrypt is taken + * out of the list while these tests run and put back where it was afterwards. + */ + @JvmStatic + @BeforeClass + fun detachConscrypt() { + val providers = Security.getProviders() + val index = providers.indexOfFirst { it.name == CONSCRYPT_PROVIDER } + if (index < 0) return + detachedConscrypt = providers[index] to index + 1 + Security.removeProvider(CONSCRYPT_PROVIDER) + } + + @JvmStatic + @AfterClass + fun restoreConscrypt() { + detachedConscrypt?.let { (provider, position) -> Security.insertProviderAt(provider, position) } + detachedConscrypt = null + } + } + private var socketFactory: SSLSocketFactory = SSLContext.getInstance("TLS", JSSE_PROVIDER).apply { init(null, null, null) }.socketFactory diff --git a/changelog.d/next/1787.security.md b/changelog.d/next/1787.security.md new file mode 100644 index 0000000000..f98e2b1425 --- /dev/null +++ b/changelog.d/next/1787.security.md @@ -0,0 +1 @@ +Update BouncyCastle to 1.86, which fixes certificate-validation and ASN.1 parsing vulnerabilities in the crypto provider the app installs. diff --git a/flake.nix b/flake.nix index c9e82e4824..a0e05b8388 100644 --- a/flake.nix +++ b/flake.nix @@ -53,7 +53,7 @@ androidSdk = pkgs.androidenv.composeAndroidPackages { cmdLineToolsVersion = "latest"; platformToolsVersion = "latest"; - platformVersions = [ "36" ]; # compileSdk/targetSdk + platformVersions = [ "37.0" ]; # compileSdk buildToolsVersions = [ buildToolsVersion ]; includeNDK = true; ndkVersions = [ ndkVersion ]; @@ -68,7 +68,7 @@ { default = pkgs.mkShell { packages = with pkgs; [ - jdk17 # AGP 9.3 / Gradle 9.5 require JDK 17+ + jdk17 # AGP 9.3 / Gradle 9.8 require JDK 17+ just git ]; diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 9767d1a465..b860617b5c 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,30 +1,30 @@ [versions] agp = "9.3.0" camera = "1.5.2" -coil = "3.2.0" +coil = "3.6.3" detekt = "1.23.8" -glance = "1.2.0-rc01" +glance = "1.2.0" hilt = "2.60.1" -hiltAndroidx = "1.3.0" +hiltAndroidx = "1.4.0" kotlin = "2.3.21" -ktor = "3.3.3" +ktor = "3.6.1" lifecycle = "2.10.0" -navCompose = "2.9.6" -room = "2.8.4" -slf4j = "2.0.17" -haze = "1.7.1" +navCompose = "2.10.2" +room = "2.8.5" +slf4j = "2.0.20" +haze = "1.7.3" [libraries] accompanist-pager-indicators = { module = "com.google.accompanist:accompanist-pager-indicators", version = "0.36.0" } accompanist-permissions = { module = "com.google.accompanist:accompanist-permissions", version = "0.37.3" } activity-compose = { module = "androidx.activity:activity-compose", version = "1.12.2" } -appcompat = { module = "androidx.appcompat:appcompat", version = "1.7.1" } +appcompat = { module = "androidx.appcompat:appcompat", version = "1.8.0" } barcode-scanning = { module = "com.google.mlkit:barcode-scanning", version = "17.3.0" } biometric = { module = "androidx.biometric:biometric", version = "1.4.0-alpha05" } bitkit-core = { module = "com.synonym:bitkit-core-android", version = "0.8.0-rc11" } paykit = { module = "com.synonym:paykit-android", version = "0.1.1-rc2" } -bouncycastle-pkix-jdk = { module = "org.bouncycastle:bcpkix-jdk18on", version = "1.83" } -bouncycastle-provider-jdk = { module = "org.bouncycastle:bcprov-jdk18on", version = "1.83" } +bouncycastle-pkix-jdk = { module = "org.bouncycastle:bcpkix-jdk18on", version = "1.86" } +bouncycastle-provider-jdk = { module = "org.bouncycastle:bcprov-jdk18on", version = "1.86" } camera-camera2 = { module = "androidx.camera:camera-camera2", version.ref = "camera" } camera-lifecycle = { module = "androidx.camera:camera-lifecycle", version.ref = "camera" } camera-view = { module = "androidx.camera:camera-view", version.ref = "camera" } @@ -39,12 +39,12 @@ compose-ui-test-junit4 = { module = "androidx.compose.ui:ui-test-junit4" } compose-ui-test-manifest = { module = "androidx.compose.ui:ui-test-manifest" } compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling" } compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview" } -constraintlayout-compose = { module = "androidx.constraintlayout:constraintlayout-compose", version = "1.1.1" } -core-ktx = { module = "androidx.core:core-ktx", version = "1.17.0" } +constraintlayout-compose = { module = "androidx.constraintlayout:constraintlayout-compose", version = "1.1.2" } +core-ktx = { module = "androidx.core:core-ktx", version = "1.19.1" } core-splashscreen = { group = "androidx.core", name = "core-splashscreen", version = "1.2.0" } -datastore-preferences = { module = "androidx.datastore:datastore-preferences", version = "1.2.1" } +datastore-preferences = { module = "androidx.datastore:datastore-preferences", version = "1.3.0" } detekt-formatting = { module = "io.gitlab.arturbosch.detekt:detekt-formatting", version.ref = "detekt" } -detekt-compose-rules = { module = "io.nlopez.compose.rules:detekt", version = "0.5.3" } +detekt-compose-rules = { module = "io.nlopez.compose.rules:detekt", version = "0.6.8" } firebase-bom = { module = "com.google.firebase:firebase-bom", version = "34.8.0" } glance-appwidget = { module = "androidx.glance:glance-appwidget", version.ref = "glance" } glance-material3 = { module = "androidx.glance:glance-material3", version.ref = "glance" } @@ -55,10 +55,10 @@ hilt-android-testing = { module = "com.google.dagger:hilt-android-testing", vers hilt-compiler = { module = "androidx.hilt:hilt-compiler", version.ref = "hiltAndroidx" } hilt-navigation-compose = { module = "androidx.hilt:hilt-navigation-compose", version.ref = "hiltAndroidx" } hilt-work = { module = "androidx.hilt:hilt-work", version.ref = "hiltAndroidx" } -jna = { module = "net.java.dev.jna:jna", version = "5.18.1" } +jna = { module = "net.java.dev.jna:jna", version = "5.19.1" } kotlin-bom = { module = "org.jetbrains.kotlin:kotlin-bom", version.ref = "kotlin" } -kotlinx-collections-immutable = { module = "org.jetbrains.kotlinx:kotlinx-collections-immutable", version = "0.3.8" } -kotlinx-datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version = "0.7.1" } +kotlinx-collections-immutable = { module = "org.jetbrains.kotlinx:kotlinx-collections-immutable", version = "0.5.2" } +kotlinx-datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version = "0.8.0" } ktor-client-cio = { module = "io.ktor:ktor-client-cio", version.ref = "ktor" } ktor-client-content-negotiation = { module = "io.ktor:ktor-client-content-negotiation", version.ref = "ktor" } ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktor" } @@ -73,7 +73,7 @@ lifecycle-runtime-ktx = { module = "androidx.lifecycle:lifecycle-runtime-ktx", v lifecycle-viewmodel-compose = { module = "androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "lifecycle" } lifecycle-viewmodel-ktx = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "lifecycle" } lifecycle-viewmodel-savedstate = { module = "androidx.lifecycle:lifecycle-viewmodel-savedstate", version.ref = "lifecycle" } -material = { module = "com.google.android.material:material", version = "1.13.0" } +material = { module = "com.google.android.material:material", version = "1.14.0" } navigation-compose = { module = "androidx.navigation:navigation-compose", version.ref = "navCompose" } navigation-testing = { module = "androidx.navigation:navigation-testing", version.ref = "navCompose" } room-compiler = { group = "androidx.room", name = "room-compiler", version.ref = "room" } @@ -89,12 +89,12 @@ test-junit = { group = "junit", name = "junit", version = "4.13.2" } test-kotlin = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlin" } test-kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin" } test-junit-ext = { module = "androidx.test.ext:junit", version = "1.3.0" } -test-mockito-kotlin = { module = "org.mockito.kotlin:mockito-kotlin", version = "6.2.2" } -test-robolectric = { module = "org.robolectric:robolectric", version = "4.16.1" } +test-mockito-kotlin = { module = "org.mockito.kotlin:mockito-kotlin", version = "6.4.0" } +test-robolectric = { module = "org.robolectric:robolectric", version = "4.17" } test-turbine = { group = "app.cash.turbine", name = "turbine", version = "1.2.1" } vss-client = { module = "com.synonym:vss-client-android", version = "0.5.26-rc1" } webkit = { module = "androidx.webkit:webkit", version = "1.16.0" } -work-runtime-ktx = { module = "androidx.work:work-runtime-ktx", version = "2.11.0" } +work-runtime-ktx = { module = "androidx.work:work-runtime-ktx", version = "2.12.0" } zxing = { module = "com.google.zxing:core", version = "3.5.4" } lottie = { module = "com.airbnb.android:lottie-compose", version = "6.7.1" } charts = { module = "io.github.ehsannarmani:compose-charts", version = "1.0.0" } @@ -108,7 +108,7 @@ android-application = { id = "com.android.application", version.ref = "agp" } compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } compose-stability-analyzer = { id = "com.github.skydoves.compose.stability.analyzer", version = "0.7.5" } detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" } -google-services = { id = "com.google.gms.google-services", version = "4.4.4" } +google-services = { id = "com.google.gms.google-services", version = "4.5.0" } hilt-android = { id = "com.google.dagger.hilt.android", version.ref = "hilt" } kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } ksp = { id = "com.google.devtools.ksp", version = "2.3.10" } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index e708b1c023..9fa7f28828 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 309256375d..dea7ee279f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ #Mon Mar 21 13:35:39 GMT 2022 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.8.2-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME +distributionSha256Sum=21bd5da2de49b642904077f38c0efdc7778e92b3ed0889392dca61b97e389607 diff --git a/gradlew b/gradlew index 4f906e0c81..249efbb032 100755 --- a/gradlew +++ b/gradlew @@ -1,7 +1,7 @@ -#!/usr/bin/env sh +#!/bin/sh # -# Copyright 2015 the original author or authors. +# Copyright © 2015 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,81 +15,114 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## -## -## Gradle start up script for UN*X -## +# +# gradlew start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh gradlew +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# ############################################################################## # Attempt to set APP_HOME + # Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" +MAX_FD=maximum warn () { echo "$*" -} +} >&2 die () { echo echo "$*" echo exit 1 -} +} >&2 # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; esac -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD="$JAVA_HOME/bin/java" + JAVACMD=$JAVA_HOME/bin/java fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME @@ -98,88 +131,118 @@ Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac fi -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. # For Cygwin or MSYS, switch paths to Windows format before running java -if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) fi - i=`expr $i + 1` + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg done - case $i in - 0) set -- ;; - 1) set -- "$args0" ;; - 2) set -- "$args0" "$args1" ;; - 3) set -- "$args0" "$args1" "$args2" ;; - 4) set -- "$args0" "$args1" "$args2" "$args3" ;; - 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac fi -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=`save "$@"` -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index 107acd32c4..03754c4c3d 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,89 +1,112 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem gradlew startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables, and ensure extensions are enabled +setlocal EnableExtensions + +@rem Catch executions from older scripts and ensure they exit cleanly. +@rem This can be removed once we can be reasonably confident that few people +@rem will be migrating directly to this new wrapper. +goto afterSafetyNet +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +goto exitWithErrorLevel +:afterSafetyNet + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +1>&2 echo. +1>&2 echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +1>&2 echo. +1>&2 echo Please set the JAVA_HOME variable in your environment to match the +1>&2 echo location of your Java installation. + +"%COMSPEC%" /c exit 1 +goto exitWithErrorLevel + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +1>&2 echo. +1>&2 echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +1>&2 echo. +1>&2 echo Please set the JAVA_HOME variable in your environment to match the +1>&2 echo location of your Java installation. + +"%COMSPEC%" /c exit 1 +goto exitWithErrorLevel + +:execute +@rem Setup the command line + + + +@rem Execute gradlew +@rem endlocal doesn't take effect until after the line is parsed and variables are expanded +@rem which allows us to clear the local environment before executing the java command +endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel & goto exitWithErrorLevel + +@rem This label must not be changed. We rely on old scripts being able to jump to this point. +:exitWithErrorLevel +@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts +"%COMSPEC%" /c exit %ERRORLEVEL%