diff --git a/app/build.gradle b/app/build.gradle deleted file mode 100644 index 3145d8a2af6..00000000000 --- a/app/build.gradle +++ /dev/null @@ -1,426 +0,0 @@ -/* - * Nextcloud Talk - Android Client - * - * SPDX-FileCopyrightText: 2017-2024 Nextcloud GmbH and Nextcloud contributors - * SPDX-FileCopyrightText: 2021-2023 Marcel Hibbe - * SPDX-FileCopyrightText: 2022 Tim Krüger - * SPDX-FileCopyrightText: 2021 Andy Scherzinger - * SPDX-FileCopyrightText: 2017-2019 Mario Danic - * SPDX-License-Identifier: GPL-3.0-or-later - */ -import com.github.spotbugs.snom.Confidence -import com.github.spotbugs.snom.Effort -import com.github.spotbugs.snom.SpotBugsTask - -plugins { - id "org.jetbrains.kotlin.plugin.compose" version "2.3.10" - id "org.jetbrains.kotlin.kapt" - id 'com.google.devtools.ksp' version '2.3.6' -} - -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-kapt' -apply plugin: 'kotlin-parcelize' -apply plugin: 'com.github.spotbugs' -apply plugin: 'io.gitlab.arturbosch.detekt' -apply plugin: "org.jlleitschuh.gradle.ktlint" -apply plugin: 'kotlinx-serialization' - -android { - compileSdkVersion 36 - - namespace = 'com.nextcloud.talk' - - defaultConfig { - minSdkVersion 26 - targetSdkVersion 36 - testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" - - // mayor.minor.hotfix.increment (for increment: 01-50=Alpha / 51-89=RC / 90-99=stable) - // xx .xxx .xx .xx - versionCode 230010009 - versionName "23.1.0 Alpha 09" - - flavorDimensions "default" - renderscriptTargetApi = 19 - renderscriptSupportModeEnabled true - - productFlavors { - // used for f-droid - generic { - applicationId 'com.nextcloud.talk2' - dimension "default" - } - gplay { - applicationId 'com.nextcloud.talk2' - dimension "default" - } - qa { - applicationId "com.nextcloud.talk2.qa" - dimension "default" - versionCode 1 - versionName "1" - } - } - - // Enabling multidex support. - multiDexEnabled = true - - vectorDrawables.useSupportLibrary = true - - lintOptions { - disable 'InvalidPackage' - disable 'MissingTranslation' - disable 'VectorPath' - disable 'UnusedQuantity' - } - - javaCompileOptions { - annotationProcessorOptions { - arguments += ["room.schemaLocation": "$projectDir/schemas".toString()] - } - } - - sourceSets { - // Adds exported schema location as test app assets. - getByName("androidTest").assets.srcDir("$projectDir/schemas") - } - - testInstrumentationRunnerArgument "TEST_SERVER_URL", "${NC_TEST_SERVER_BASEURL}" - testInstrumentationRunnerArgument "TEST_SERVER_USERNAME", "${NC_TEST_SERVER_USERNAME}" - testInstrumentationRunnerArgument "TEST_SERVER_PASSWORD", "${NC_TEST_SERVER_PASSWORD}" - - def localBroadcastPermission = "PRIVATE_BROADCAST" - manifestPlaceholders.broadcastPermission = localBroadcastPermission - buildConfigField "String", "PERMISSION_LOCAL_BROADCAST", "\"${localBroadcastPermission}\"" - } - - testOptions { - unitTests.all { - useJUnitPlatform() - } - unitTests.returnDefaultValues = true - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } - - packagingOptions { - resources { - excludes += [ - 'META-INF/LICENSE.txt', - 'META-INF/LICENSE', - 'META-INF/NOTICE.txt', - 'META-INF/NOTICE', - 'META-INF/DEPENDENCIES', - 'META-INF/rxjava.properties' - ] - } - } - - check.dependsOn 'spotbugsGplayDebug', 'lint', 'ktlintCheck', 'detekt' - - compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 - } - - kotlinOptions { - jvmTarget = '17' - } - - buildFeatures { - viewBinding = true - buildConfig = true - compose = true - } - - composeOptions { - kotlinCompilerExtensionVersion = "1.5.15" - } - - lint { - abortOnError = false - disable 'MissingTranslation','PrivateResource' - htmlOutput = layout.buildDirectory.file("reports/lint/lint.html").get().asFile - htmlReport = true - } -} -kapt { - correctErrorTypes = true -} - -ext { - androidxCameraVersion = "1.5.3" - coilKtVersion = "2.7.0" - daggerVersion = "2.59.2" - emojiVersion = "1.6.0" - fidoVersion = "4.1.0-patch2" - lifecycleVersion = '2.10.0' - okhttpVersion = "4.12.0" - markwonVersion = "4.6.2" - materialDialogsVersion = "3.3.0" - parcelerVersion = "1.1.13" - prismVersion = "2.0.0" - retrofit2Version = "3.0.0" - roomVersion = "2.8.4" - workVersion = "2.11.1" - espressoVersion = "3.7.0" - androidxTestVersion = "1.5.0" - media3_version = "1.9.2" - coroutines_version = "1.10.2" - mockitoKotlinVersion = "6.2.3" -} - -configurations.configureEach { - exclude group: 'com.google.firebase', module: 'firebase-core' - exclude group: 'com.google.firebase', module: 'firebase-analytics' - exclude group: 'com.google.firebase', module: 'firebase-measurement-connector' - exclude group: 'org.jetbrains', module: 'annotations-java5' // via prism4j, already using annotations explicitly -} - -dependencies { - - kapt "org.jetbrains.kotlin:kotlin-metadata-jvm:${kotlinVersion}" - implementation "androidx.room:room-testing-android:${roomVersion}" - implementation 'androidx.compose.foundation:foundation-layout:1.10.5' - spotbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.14.0' - spotbugsPlugins 'com.mebigfatguy.fb-contrib:fb-contrib:7.7.4' - detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.23.8") - - implementation("androidx.compose.runtime:runtime:1.10.5") - implementation 'androidx.preference:preference-ktx:1.2.1' - implementation 'androidx.datastore:datastore-core:1.2.1' - implementation 'androidx.datastore:datastore-preferences:1.2.1' - implementation 'androidx.test.ext:junit-ktx:1.3.0' - - implementation fileTree(include: ['*'], dir: 'libs') - - implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.10.0" - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-rx2:$coroutines_version" - - implementation 'androidx.appcompat:appcompat:1.7.1' - implementation 'com.google.android.material:material:1.13.0' - implementation 'androidx.constraintlayout:constraintlayout:2.2.1' - implementation "com.vanniktech:emoji-google:0.23.0" - implementation "androidx.emoji2:emoji2:${emojiVersion}" - implementation "androidx.emoji2:emoji2-bundled:${emojiVersion}" - implementation "androidx.emoji2:emoji2-views:${emojiVersion}" - implementation "androidx.emoji2:emoji2-views-helper:${emojiVersion}" - implementation 'org.michaelevans.colorart:library:0.0.3' - implementation "androidx.work:work-runtime:${workVersion}" - implementation "androidx.work:work-rxjava2:${workVersion}" - implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.2.0' - implementation 'com.google.android.flexbox:flexbox:3.0.0' - implementation ('com.github.bitfireAT:dav4jvm:2.1.3', { - exclude group: 'org.ogce', module: 'xpp3' // Android comes with its own XmlPullParser - }) - implementation 'org.conscrypt:conscrypt-android:2.5.3' - implementation "com.github.nextcloud-deps:qrcodescanner:0.1.2.4" // "com.github.blikoon:QRCodeScanner:0.1.2" - - implementation "androidx.camera:camera-core:${androidxCameraVersion}" - implementation "androidx.camera:camera-camera2:${androidxCameraVersion}" - implementation "androidx.camera:camera-lifecycle:${androidxCameraVersion}" - implementation "androidx.camera:camera-view:${androidxCameraVersion}" - implementation "androidx.exifinterface:exifinterface:1.4.2" - - implementation "androidx.lifecycle:lifecycle-runtime-ktx:${lifecycleVersion}" - implementation "androidx.lifecycle:lifecycle-livedata-ktx:${lifecycleVersion}" - implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:${lifecycleVersion}" - implementation "androidx.lifecycle:lifecycle-process:${lifecycleVersion}" - implementation "androidx.lifecycle:lifecycle-common:${lifecycleVersion}" - implementation("androidx.lifecycle:lifecycle-viewmodel-compose:${lifecycleVersion}") - - implementation 'androidx.biometric:biometric:1.1.0' - - implementation 'androidx.multidex:multidex:2.0.1' - - implementation 'io.reactivex.rxjava2:rxandroid:2.1.1' - implementation "io.reactivex.rxjava2:rxjava:2.2.21" - - implementation "com.squareup.okhttp3:okhttp:${okhttpVersion}" - implementation "com.squareup.okhttp3:okhttp-urlconnection:${okhttpVersion}" - implementation "com.squareup.okhttp3:logging-interceptor:${okhttpVersion}" - - implementation 'com.bluelinelabs:logansquare:1.3.7' - implementation 'com.fasterxml.jackson.core:jackson-core:2.20.1' - kapt 'com.bluelinelabs:logansquare-compiler:1.3.7' - - implementation "com.squareup.retrofit2:retrofit:${retrofit2Version}" - implementation "com.squareup.retrofit2:adapter-rxjava2:${retrofit2Version}" - implementation "com.squareup.retrofit2:converter-gson:${retrofit2Version}" - implementation 'de.mannodermaus.retrofit2:converter-logansquare:1.4.1' - - implementation "com.google.dagger:dagger:${daggerVersion}" - kapt "com.google.dagger:dagger-compiler:${daggerVersion}" - implementation 'com.github.lukaspili.autodagger2:autodagger2:1.1' - kapt 'com.github.lukaspili.autodagger2:autodagger2-compiler:1.1' - compileOnly 'javax.annotation:javax.annotation-api:1.3.2' - - implementation 'org.greenrobot:eventbus:3.3.1' - implementation 'net.zetetic:sqlcipher-android:4.13.0' - - implementation "androidx.room:room-runtime:${roomVersion}" - implementation "androidx.room:room-rxjava2:${roomVersion}" - ksp "androidx.room:room-compiler:${roomVersion}" - implementation "androidx.room:room-ktx:${roomVersion}" - - implementation "org.parceler:parceler-api:$parcelerVersion" - implementation 'com.github.ddB0515.FlexibleAdapter:flexible-adapter:5.1.1' - implementation 'com.github.ddB0515.FlexibleAdapter:flexible-adapter-ui:5.1.1' - implementation 'org.apache.commons:commons-lang3:3.20.0' - implementation 'com.google.code.findbugs:jsr305:3.0.2' - implementation 'com.github.nextcloud-deps:ChatKit:0.4.2' - implementation 'joda-time:joda-time:2.14.1' - implementation "io.coil-kt:coil:${coilKtVersion}" - implementation "io.coil-kt:coil-gif:${coilKtVersion}" - implementation "io.coil-kt:coil-svg:${coilKtVersion}" - implementation "io.coil-kt:coil-compose:${coilKtVersion}" - implementation 'com.github.natario1:Autocomplete:1.1.0' - - implementation "com.github.nextcloud-deps.hwsecurity:hwsecurity-fido:${fidoVersion}" - implementation "com.github.nextcloud-deps.hwsecurity:hwsecurity-fido2:${fidoVersion}" - - implementation "com.afollestad.material-dialogs:core:${materialDialogsVersion}" - implementation "com.afollestad.material-dialogs:datetime:${materialDialogsVersion}" - implementation "com.afollestad.material-dialogs:bottomsheets:${materialDialogsVersion}" - implementation "com.afollestad.material-dialogs:lifecycle:${materialDialogsVersion}" - - implementation 'com.google.code.gson:gson:2.13.2' - - implementation "androidx.media3:media3-exoplayer:$media3_version" - implementation "androidx.media3:media3-ui:$media3_version" - - implementation 'com.github.chrisbanes:PhotoView:2.3.0' - implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.31' - - implementation "io.noties.markwon:core:$markwonVersion" - implementation "io.noties.markwon:ext-strikethrough:$markwonVersion" - implementation "io.noties.markwon:ext-tasklist:$markwonVersion" - implementation "io.noties.markwon:ext-tables:$markwonVersion" - - // Avatar picker - implementation 'com.github.nextcloud-deps:ImagePicker:2.1.0.2' - // Override avatar picker's internal crop lib for better dge-to-edge support - implementation 'com.github.yalantis:ucrop:2.2.11' - - implementation 'io.github.elye:loaderviewlibrary:3.0.0' - implementation 'org.osmdroid:osmdroid-android:6.1.20' - implementation ('fr.dudie:nominatim-api:3.4', { - //noinspection DuplicatePlatformClasses - exclude group: 'org.apache.httpcomponents', module: 'httpclient' - }) - - implementation 'androidx.core:core-ktx:1.18.0' - implementation 'androidx.activity:activity-ktx:1.13.0' - implementation 'com.github.nextcloud.android-common:ui:0.33.2' - implementation 'com.github.nextcloud.android-common:core:0.33.2' - implementation 'com.github.nextcloud-deps:android-talk-webrtc:132.6834.0' - - gplayImplementation 'com.google.android.gms:play-services-base:18.10.0' - gplayImplementation "com.google.firebase:firebase-messaging:25.0.1" - - //compose - implementation(platform("androidx.compose:compose-bom:2026.03.00")) - implementation("androidx.compose.ui:ui") - implementation 'androidx.compose.material3:material3:1.4.0' - implementation("androidx.compose.material:material-icons-extended") - implementation("androidx.compose.ui:ui-tooling-preview") - implementation 'androidx.activity:activity-compose:1.13.0' - debugImplementation("androidx.compose.ui:ui-tooling") - - //tests - testRuntimeOnly 'org.junit.platform:junit-platform-launcher:6.0.3' - androidTestImplementation("androidx.compose.ui:ui-test-junit4:1.10.5") - debugImplementation("androidx.compose.ui:ui-test-manifest") - - testImplementation 'junit:junit:4.13.2' - testImplementation 'org.mockito:mockito-core:5.22.0' - testImplementation 'androidx.arch.core:core-testing:2.2.0' - - androidTestImplementation "androidx.test:core:1.7.0" - - androidTestImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:1.10.2" - androidTestImplementation 'androidx.test:core-ktx:1.7.0' - androidTestImplementation 'org.mockito:mockito-android:5.22.0' - androidTestImplementation "androidx.work:work-testing:${workVersion}" - // Espresso core - androidTestImplementation ("androidx.test.espresso:espresso-core:$espressoVersion", { - exclude group: 'com.android.support', module: 'support-annotations' - }) - androidTestImplementation "androidx.test.espresso:espresso-contrib:$espressoVersion" - androidTestImplementation "androidx.test.espresso:espresso-web:$espressoVersion" - androidTestImplementation "androidx.test.espresso:espresso-accessibility:$espressoVersion" - - androidTestImplementation "androidx.test.espresso:espresso-intents:$espressoVersion" - - androidTestImplementation('com.android.support.test.espresso:espresso-intents:3.0.2') - - androidTestImplementation(platform("androidx.compose:compose-bom:2026.03.00")) - testImplementation "org.mockito.kotlin:mockito-kotlin:$mockitoKotlinVersion" - testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutines_version" - - testImplementation 'org.junit.vintage:junit-vintage-engine:6.0.3' // DO NOT REMOVE - testImplementation "androidx.room:room-testing:${roomVersion}" - testImplementation("com.squareup.okhttp3:mockwebserver:$okhttpVersion") - testImplementation("com.google.dagger:hilt-android-testing:2.59.2") - testImplementation("org.robolectric:robolectric:4.16.1") -} - -tasks.register('installGitHooks', Copy) { - description = "Install git hooks" - from("../scripts/hooks") { - include '*' - } - into '../.git/hooks' -} - -spotbugs { - ignoreFailures = true // should continue checking - effort = Effort.MAX - reportLevel = Confidence.valueOf('MEDIUM') -} - -tasks.withType(SpotBugsTask).configureEach { task -> - String variantNameCap = task.name.replace("spotbugs", "") - String variantName = variantNameCap.substring(0, 1).toLowerCase() + variantNameCap.substring(1) - - dependsOn "compile${variantNameCap}Sources" - - excludeFilter = file("${project.rootDir}/spotbugs-filter.xml") - classes = fileTree(layout.buildDirectory.get().asFile.toString()+"/intermediates/javac/${variantName}/compile${variantNameCap}JavaWithJavac/classes/") - reports { - xml { - required = true - } - html { - required = true - outputLocation = layout.buildDirectory.file("reports/spotbugs/spotbugs.html") - stylesheet = 'fancy.xsl' - } - } -} - -tasks.named("detekt").configure { - reports { - html.required.set(true) - txt.required.set(true) - xml.required.set(false) - sarif.required.set(false) - md.required.set(false) - } -} - -detekt { - config.setFrom("../detekt.yml") - source.setFrom("src/") -} - -ksp { - arg('room.schemaLocation', "$projectDir/schemas") -} \ No newline at end of file diff --git a/app/build.gradle.kts b/app/build.gradle.kts new file mode 100644 index 00000000000..bd734048bbc --- /dev/null +++ b/app/build.gradle.kts @@ -0,0 +1,415 @@ +/* + * Nextcloud Talk - Android Client + * + * SPDX-FileCopyrightText: 2017-2026 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: GPL-3.0-or-later + */ +import com.github.spotbugs.snom.Confidence +import com.github.spotbugs.snom.Effort +import com.github.spotbugs.snom.SpotBugsTask +import io.gitlab.arturbosch.detekt.Detekt + +plugins { + id("org.jetbrains.kotlin.plugin.compose") version "2.3.10" + id("com.android.built-in-kotlin") + id("com.android.legacy-kapt") + id("com.google.devtools.ksp") version "2.3.6" + id("com.android.application") + id("kotlin-parcelize") + id("com.github.spotbugs") + id("io.gitlab.arturbosch.detekt") + id("org.jlleitschuh.gradle.ktlint") + id("kotlinx-serialization") +} + +val kotlinVersion: String by rootProject.extra + +val androidxCameraVersion = "1.5.3" +val coilKtVersion = "2.7.0" +val daggerVersion = "2.59.2" +val emojiVersion = "1.6.0" +val fidoVersion = "4.1.0-patch2" +val lifecycleVersion = "2.10.0" +val okhttpVersion = "4.12.0" +val markwonVersion = "4.6.2" +val materialDialogsVersion = "3.3.0" +val parcelerVersion = "1.1.13" +val retrofit2Version = "3.0.0" +val roomVersion = "2.8.4" +val workVersion = "2.11.1" +val espressoVersion = "3.7.0" +val androidxTestVersion = "1.5.0" +val media3Version = "1.9.2" +val coroutinesVersion = "1.10.2" +val mockitoKotlinVersion = "6.2.3" + +android { + compileSdk = 36 + + namespace = "com.nextcloud.talk" + + defaultConfig { + testInstrumentationRunnerArguments["TEST_SERVER_URL"] = + providers.gradleProperty("NC_TEST_SERVER_BASEURL").getOrElse("") + testInstrumentationRunnerArguments["TEST_SERVER_USERNAME"] = + providers.gradleProperty("NC_TEST_SERVER_USERNAME").getOrElse("") + testInstrumentationRunnerArguments["TEST_SERVER_PASSWORD"] = + providers.gradleProperty("NC_TEST_SERVER_PASSWORD").getOrElse("") + + minSdk = 26 + targetSdk = 36 + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + + // mayor.minor.hotfix.increment (for increment: 01-50=Alpha / 51-89=RC / 90-99=stable) + // xx .xxx .xx .xx + versionCode = 230010009 + versionName = "23.1.0 Alpha 09" + + vectorDrawables.useSupportLibrary = true + + javaCompileOptions { + annotationProcessorOptions { + arguments["room.schemaLocation"] = "$projectDir/schemas" + } + } + + val localBroadcastPermission = "PRIVATE_BROADCAST" + manifestPlaceholders["broadcastPermission"] = localBroadcastPermission + buildConfigField("String", "PERMISSION_LOCAL_BROADCAST", "\"$localBroadcastPermission\"") + } + + flavorDimensions += "default" + + productFlavors { + // used for f-droid + create("generic") { + applicationId = "com.nextcloud.talk2" + dimension = "default" + } + create("gplay") { + applicationId = "com.nextcloud.talk2" + dimension = "default" + } + create("qa") { + applicationId = "com.nextcloud.talk2.qa" + dimension = "default" + versionCode = 1 + versionName = "1" + } + } + + sourceSets { + // Adds exported schema location as test app assets. + getByName("androidTest").assets.srcDir("$projectDir/schemas") + } + + testOptions { + unitTests.all { + it.useJUnitPlatform() + } + unitTests.isReturnDefaultValues = true + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + + packaging { + resources { + excludes += setOf( + "META-INF/LICENSE.txt", + "META-INF/LICENSE", + "META-INF/NOTICE.txt", + "META-INF/NOTICE", + "META-INF/DEPENDENCIES", + "META-INF/rxjava.properties" + ) + } + } + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + + buildFeatures { + viewBinding = true + buildConfig = true + compose = true + } + + lint { + abortOnError = false + warningsAsErrors = false + disable.addAll( + listOf( + "GradleDependency", + "InvalidPackage", + "MissingTranslation", + "PrivateResource", + "UnusedQuantity", + "VectorPath" + ) + ) + htmlOutput = layout.buildDirectory.file("reports/lint/lint.html").get().asFile + htmlReport = true + } +} + +tasks.named("check") { + dependsOn("spotbugsGplayDebug", "lint", "ktlintCheck", "detekt") +} + +kapt { + correctErrorTypes = true +} + +configurations.configureEach { + exclude(group = "com.google.firebase", module = "firebase-core") + exclude(group = "com.google.firebase", module = "firebase-analytics") + exclude(group = "com.google.firebase", module = "firebase-measurement-connector") + exclude(group = "org.jetbrains", module = "annotations-java5") // via prism4j, already using annotations explicitly +} + +dependencies { + kapt("org.jetbrains.kotlin:kotlin-metadata-jvm:$kotlinVersion") + implementation("androidx.room:room-testing-android:$roomVersion") + implementation("androidx.compose.foundation:foundation-layout:1.10.5") + spotbugsPlugins("com.h3xstream.findsecbugs:findsecbugs-plugin:1.14.0") + spotbugsPlugins("com.mebigfatguy.fb-contrib:fb-contrib:7.7.4") + detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.23.8") + + implementation("androidx.compose.runtime:runtime:1.10.5") + implementation("androidx.preference:preference-ktx:1.2.1") + implementation("androidx.datastore:datastore-core:1.2.1") + implementation("androidx.datastore:datastore-preferences:1.2.1") + implementation("androidx.test.ext:junit-ktx:1.3.0") + + implementation(fileTree(mapOf("include" to listOf("*"), "dir" to "libs"))) + + implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.10.0") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-rx2:$coroutinesVersion") + + implementation("androidx.appcompat:appcompat:1.7.1") + implementation("com.google.android.material:material:1.13.0") + implementation("androidx.constraintlayout:constraintlayout:2.2.1") + implementation("com.vanniktech:emoji-google:0.23.0") + implementation("androidx.emoji2:emoji2:$emojiVersion") + implementation("androidx.emoji2:emoji2-bundled:$emojiVersion") + implementation("androidx.emoji2:emoji2-views:$emojiVersion") + implementation("androidx.emoji2:emoji2-views-helper:$emojiVersion") + implementation("org.michaelevans.colorart:library:0.0.3") + implementation("androidx.work:work-runtime:$workVersion") + implementation("androidx.work:work-rxjava2:$workVersion") + implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.2.0") + implementation("com.google.android.flexbox:flexbox:3.0.0") + implementation("com.github.bitfireAT:dav4jvm:2.1.3") { + exclude(group = "org.ogce", module = "xpp3") // Android comes with its own XmlPullParser + } + implementation("org.conscrypt:conscrypt-android:2.5.3") + implementation("com.github.nextcloud-deps:qrcodescanner:0.1.2.4") // "com.github.blikoon:QRCodeScanner:0.1.2" + + implementation("androidx.camera:camera-core:$androidxCameraVersion") + implementation("androidx.camera:camera-camera2:$androidxCameraVersion") + implementation("androidx.camera:camera-lifecycle:$androidxCameraVersion") + implementation("androidx.camera:camera-view:$androidxCameraVersion") + implementation("androidx.exifinterface:exifinterface:1.4.2") + + implementation("androidx.lifecycle:lifecycle-runtime-ktx:$lifecycleVersion") + implementation("androidx.lifecycle:lifecycle-livedata-ktx:$lifecycleVersion") + implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycleVersion") + implementation("androidx.lifecycle:lifecycle-process:$lifecycleVersion") + implementation("androidx.lifecycle:lifecycle-common:$lifecycleVersion") + implementation("androidx.lifecycle:lifecycle-viewmodel-compose:$lifecycleVersion") + + implementation("androidx.biometric:biometric:1.1.0") + + implementation("io.reactivex.rxjava2:rxandroid:2.1.1") + implementation("io.reactivex.rxjava2:rxjava:2.2.21") + + implementation("com.squareup.okhttp3:okhttp:$okhttpVersion") + implementation("com.squareup.okhttp3:okhttp-urlconnection:$okhttpVersion") + implementation("com.squareup.okhttp3:logging-interceptor:$okhttpVersion") + + implementation("com.bluelinelabs:logansquare:1.3.7") + implementation("com.fasterxml.jackson.core:jackson-core:2.20.1") + kapt("com.bluelinelabs:logansquare-compiler:1.3.7") + + implementation("com.squareup.retrofit2:retrofit:$retrofit2Version") + implementation("com.squareup.retrofit2:adapter-rxjava2:$retrofit2Version") + implementation("com.squareup.retrofit2:converter-gson:$retrofit2Version") + implementation("de.mannodermaus.retrofit2:converter-logansquare:1.4.1") + + implementation("com.google.dagger:dagger:$daggerVersion") + kapt("com.google.dagger:dagger-compiler:$daggerVersion") + implementation("com.github.lukaspili.autodagger2:autodagger2:1.1") + kapt("com.github.lukaspili.autodagger2:autodagger2-compiler:1.1") + compileOnly("javax.annotation:javax.annotation-api:1.3.2") + kapt("javax.annotation:javax.annotation-api:1.3.2") + + implementation("org.greenrobot:eventbus:3.3.1") + implementation("net.zetetic:sqlcipher-android:4.13.0") + + implementation("androidx.room:room-runtime:$roomVersion") + implementation("androidx.room:room-rxjava2:$roomVersion") + ksp("androidx.room:room-compiler:$roomVersion") + implementation("androidx.room:room-ktx:$roomVersion") + + implementation("org.parceler:parceler-api:$parcelerVersion") + implementation("com.github.ddB0515.FlexibleAdapter:flexible-adapter:5.1.1") + implementation("com.github.ddB0515.FlexibleAdapter:flexible-adapter-ui:5.1.1") + implementation("org.apache.commons:commons-lang3:3.20.0") + implementation("com.google.code.findbugs:jsr305:3.0.2") + implementation("com.github.nextcloud-deps:ChatKit:0.4.2") + implementation("joda-time:joda-time:2.14.1") + implementation("io.coil-kt:coil:$coilKtVersion") + implementation("io.coil-kt:coil-gif:$coilKtVersion") + implementation("io.coil-kt:coil-svg:$coilKtVersion") + implementation("io.coil-kt:coil-compose:$coilKtVersion") + implementation("com.github.natario1:Autocomplete:1.1.0") + + implementation("com.github.nextcloud-deps.hwsecurity:hwsecurity-fido:$fidoVersion") + implementation("com.github.nextcloud-deps.hwsecurity:hwsecurity-fido2:$fidoVersion") + + implementation("com.afollestad.material-dialogs:core:$materialDialogsVersion") + implementation("com.afollestad.material-dialogs:datetime:$materialDialogsVersion") + implementation("com.afollestad.material-dialogs:bottomsheets:$materialDialogsVersion") + implementation("com.afollestad.material-dialogs:lifecycle:$materialDialogsVersion") + + implementation("com.google.code.gson:gson:2.13.2") + + implementation("androidx.media3:media3-exoplayer:$media3Version") + implementation("androidx.media3:media3-ui:$media3Version") + + implementation("com.github.chrisbanes:PhotoView:2.3.0") + implementation("pl.droidsonroids.gif:android-gif-drawable:1.2.31") + + implementation("io.noties.markwon:core:$markwonVersion") + implementation("io.noties.markwon:ext-strikethrough:$markwonVersion") + implementation("io.noties.markwon:ext-tasklist:$markwonVersion") + implementation("io.noties.markwon:ext-tables:$markwonVersion") + + // Avatar picker + implementation("com.github.nextcloud-deps:ImagePicker:2.1.0.2") + // Override avatar picker's internal crop lib for better edge-to-edge support + implementation("com.github.yalantis:ucrop:2.2.11") + + implementation("io.github.elye:loaderviewlibrary:3.0.0") + implementation("org.osmdroid:osmdroid-android:6.1.20") + implementation("fr.dudie:nominatim-api:3.4") { + //noinspection DuplicatePlatformClasses + exclude(group = "org.apache.httpcomponents", module = "httpclient") + } + + implementation("androidx.core:core-ktx:1.18.0") + implementation("androidx.activity:activity-ktx:1.13.0") + implementation("com.github.nextcloud.android-common:ui:0.33.2") + implementation("com.github.nextcloud.android-common:core:0.33.2") + implementation("com.github.nextcloud-deps:android-talk-webrtc:132.6834.0") + + "gplayImplementation"("com.google.android.gms:play-services-base:18.10.0") + "gplayImplementation"("com.google.firebase:firebase-messaging:25.0.1") + + // compose + implementation(platform("androidx.compose:compose-bom:2026.03.00")) + implementation("androidx.compose.ui:ui") + implementation("androidx.compose.material3:material3:1.4.0") + implementation("androidx.compose.material:material-icons-extended") + implementation("androidx.compose.ui:ui-tooling-preview") + implementation("androidx.activity:activity-compose:1.13.0") + debugImplementation("androidx.compose.ui:ui-tooling") + + // tests + testRuntimeOnly("org.junit.platform:junit-platform-launcher:6.0.3") + androidTestImplementation("androidx.compose.ui:ui-test-junit4:1.10.5") + debugImplementation("androidx.compose.ui:ui-test-manifest") + + testImplementation("junit:junit:4.13.2") + testImplementation("org.mockito:mockito-core:5.22.0") + testImplementation("androidx.arch.core:core-testing:2.2.0") + + androidTestImplementation("androidx.test:core:1.7.0") + + androidTestImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.10.2") + androidTestImplementation("androidx.test:core-ktx:1.7.0") + androidTestImplementation("org.mockito:mockito-android:5.22.0") + androidTestImplementation("androidx.work:work-testing:$workVersion") + androidTestImplementation("androidx.test.espresso:espresso-core:$espressoVersion") { + exclude(group = "com.android.support", module = "support-annotations") + } + androidTestImplementation("androidx.test.espresso:espresso-contrib:$espressoVersion") + androidTestImplementation("androidx.test.espresso:espresso-web:$espressoVersion") + androidTestImplementation("androidx.test.espresso:espresso-accessibility:$espressoVersion") + androidTestImplementation("androidx.test.espresso:espresso-intents:$espressoVersion") + + androidTestImplementation(platform("androidx.compose:compose-bom:2026.03.00")) + testImplementation("org.mockito.kotlin:mockito-kotlin:$mockitoKotlinVersion") + testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutinesVersion") + + testImplementation("org.junit.vintage:junit-vintage-engine:6.0.3") // DO NOT REMOVE + testImplementation("androidx.room:room-testing:$roomVersion") + testImplementation("com.squareup.okhttp3:mockwebserver:$okhttpVersion") + testImplementation("com.google.dagger:hilt-android-testing:2.59.2") + testImplementation("org.robolectric:robolectric:4.16.1") +} + +tasks.register("installGitHooks") { + description = "Install git hooks" + from("../scripts/hooks") { + include("*") + } + into("../.git/hooks") +} + +spotbugs { + ignoreFailures.set(true) + effort.set(Effort.MAX) + reportLevel.set(Confidence.valueOf("MEDIUM")) +} + +tasks.withType().configureEach { + val variantNameCap = name.replace("spotbugs", "") + val variantName = variantNameCap.substring(0, 1).lowercase() + variantNameCap.substring(1) + + dependsOn("compile${variantNameCap}Sources") + + classes = fileTree( + layout.buildDirectory.get().asFile.toString() + + "/intermediates/javac/$variantName/compile${variantNameCap}JavaWithJavac/classes/" + ) + excludeFilter.set(file("${project.rootDir}/spotbugs-filter.xml")) + + reports.create("xml") { + required.set(true) + } + reports.create("html") { + required.set(true) + outputLocation.set(layout.buildDirectory.file("reports/spotbugs/spotbugs.html")) + setStylesheet("fancy.xsl") + } +} + +tasks.named("detekt").configure { + reports { + html.required.set(true) + txt.required.set(true) + xml.required.set(false) + sarif.required.set(false) + md.required.set(false) + } +} + +detekt { + config.setFrom("../detekt.yml") + source.setFrom("src/") +} + +ksp { + arg("room.schemaLocation", "$projectDir/schemas") +} diff --git a/app/src/main/java/com/nextcloud/talk/application/NextcloudTalkApplication.kt b/app/src/main/java/com/nextcloud/talk/application/NextcloudTalkApplication.kt index ea89a7ba66e..8b32fcd32a8 100644 --- a/app/src/main/java/com/nextcloud/talk/application/NextcloudTalkApplication.kt +++ b/app/src/main/java/com/nextcloud/talk/application/NextcloudTalkApplication.kt @@ -1,16 +1,13 @@ /* * Nextcloud Talk - Android Client * - * SPDX-FileCopyrightText: 2022 Andy Scherzinger - * SPDX-FileCopyrightText: 2022 Marcel Hibbe - * SPDX-FileCopyrightText: 2022 Tim Krüger - * SPDX-FileCopyrightText: 2017 Mario Danic + * SPDX-FileCopyrightText: 2017-2026 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: GPL-3.0-or-later */ package com.nextcloud.talk.application import android.app.Activity -import android.content.Context +import android.app.Application import android.content.pm.PackageManager import android.os.Build.VERSION.SDK_INT import android.os.Build.VERSION_CODES.P @@ -19,8 +16,6 @@ import androidx.appcompat.app.AppCompatDelegate import androidx.emoji2.bundled.BundledEmojiCompatConfig import androidx.emoji2.text.EmojiCompat import androidx.lifecycle.LifecycleObserver -import androidx.multidex.MultiDex -import androidx.multidex.MultiDexApplication import androidx.work.ExistingPeriodicWorkPolicy import androidx.work.OneTimeWorkRequest import androidx.work.PeriodicWorkRequest @@ -89,7 +84,7 @@ import javax.inject.Singleton @Singleton @AutoInjector(NextcloudTalkApplication::class) class NextcloudTalkApplication : - MultiDexApplication(), + Application(), LifecycleObserver { //region Fields (components) lateinit var componentApplication: NextcloudTalkApplicationComponent @@ -217,11 +212,6 @@ class NextcloudTalkApplication : .build() } - override fun attachBaseContext(base: Context) { - super.attachBaseContext(base) - MultiDex.install(this) - } - private fun buildDefaultImageLoader(): ImageLoader { val imageLoaderBuilder = ImageLoader.Builder(applicationContext) .memoryCache { diff --git a/build.gradle b/build.gradle index 1842512dba9..86f8c82e87b 100644 --- a/build.gradle +++ b/build.gradle @@ -21,9 +21,10 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:8.13.2' + classpath 'com.android.tools.build:gradle:9.1.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}" classpath "org.jetbrains.kotlin:kotlin-serialization:${kotlinVersion}" + classpath "com.android.legacy-kapt:com.android.legacy-kapt.gradle.plugin:9.1.0" classpath 'com.github.spotbugs.snom:spotbugs-gradle-plugin:6.4.8' classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.23.8" classpath "org.jlleitschuh.gradle:ktlint-gradle:14.2.0" diff --git a/gradle.properties b/gradle.properties index 57906d64c07..94be2c21840 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,9 +1,6 @@ # Nextcloud Talk - Android Client # -# SPDX-FileCopyrightText: 2017-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-FileCopyrightText: 2024-2025 Marcel Hibbe -# SPDX-FileCopyrightText: 2021 Tim Krüger -# SPDX-FileCopyrightText: 2017-2019 Mario Danic +# SPDX-FileCopyrightText: 2017-2026 Nextcloud GmbH and Nextcloud contributors # SPDX-License-Identifier: GPL-3.0-or-later # can be overriden by ~/.gradle/gradle.properties @@ -26,6 +23,12 @@ org.gradle.configureondemand=true kapt.incremental.apt=true org.gradle.daemon=true org.gradle.configuration-cache=true +android.uniquePackageNames=false +android.dependency.useConstraints=true +android.r8.strictFullModeForKeepRules=false +android.generateSyncIssueWhenLibraryConstraintsAreEnabled=false +# TODO: remove once spotbugs-gradle-plugin supports AGP new DSL (blocked until AGP 10.0) +android.newDsl=false # Needed for local libs # org.gradle.dependency.verification=lenient diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml index 988cfd23df5..fb74e62aac3 100644 --- a/gradle/verification-metadata.xml +++ b/gradle/verification-metadata.xml @@ -13,7 +13,11 @@ + + + + @@ -37,8 +41,10 @@ + + @@ -283,7 +289,10 @@ - + + + + @@ -12762,6 +12771,14 @@ + + + + + + + + @@ -18779,6 +18796,14 @@ + + + + + + + + @@ -20409,6 +20434,14 @@ + + + + + + + + @@ -20433,6 +20466,14 @@ + + + + + + + + @@ -20457,6 +20498,14 @@ + + + + + + + + @@ -20481,6 +20530,14 @@ + + + + + + + + @@ -20505,6 +20562,14 @@ + + + + + + + + @@ -20529,6 +20594,14 @@ + + + + + + + +