plugins { id 'com.android.application' id 'project-report' id 'kotlin-android' id 'kotlin-parcelize' id 'com.google.devtools.ksp' id 'dagger.hilt.android.plugin' id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin' id 'androidx.navigation.safeargs.kotlin' id 'org.jetbrains.kotlin.plugin.compose' } ext { archivesBaseName = 'dash-wallet' } repositories { mavenLocal() mavenCentral() maven { url 'https://maven.google.com/' name 'Google' } } dependencies { implementation project(path: ':common') implementation project(path: ":features:exploredash") implementation project(path: ':integrations:uphold') implementation project(path: ":integrations:coinbase") implementation project(path: ":integrations:crowdnode") implementation(project(':integration-android')) { exclude(group: 'com.google.android', module: 'android') } implementation 'com.google.android.libraries.identity.googleid:googleid:1.1.1' implementation 'com.google.android.gms:play-services-auth:21.3.0' coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:$desugaringLibraryVersion" implementation 'com.google.android.material:material:1.3.0' implementation 'androidx.legacy:legacy-support-v4:1.0.0' // Android arch implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation 'androidx.annotation:annotation:1.5.0' implementation "androidx.core:core-ktx:$jetpackVersion" implementation "androidx.fragment:fragment-ktx:1.5.5" implementation('androidx.legacy:legacy-support-v13:1.0.0') { exclude(group: 'com.android.support', module: 'support-fragment') exclude(group: 'com.android.support', module: 'support-media-compat') } implementation 'androidx.legacy:legacy-support-core-utils:1.0.0' implementation "androidx.work:work-runtime-ktx:$workRuntimeVersion" implementation "androidx.biometric:biometric:1.1.0" implementation 'org.bouncycastle:bcprov-jdk15to18:1.74' implementation "org.dashj:dashj-core:$dashjVersion" implementation "org.dashj.platform:dash-sdk-java:$dppVersion" implementation "org.dashj.platform:dash-sdk-kotlin:$dppVersion" implementation "org.dashj.platform:dash-sdk-android:$dppVersion" implementation 'io.grpc:grpc-stub:1.54.0' // CURRENT_GRPC_VERSION implementation "org.dashj.android:dashj-bls-android:1.0.1" implementation "org.dashj.android:dashj-x11-android:1.0.0" implementation "org.dashj.android:dashj-scrypt-android:1.0.0" implementation 'com.google.guava:guava:29.0-android' //noinspection GradleDependency implementation "com.google.zxing:core:$zxingVersion" implementation "org.slf4j:slf4j-api:$slf4jVersion" implementation('com.github.tony19:logback-android:3.0.0') { exclude(group: 'com.google.android', module: 'android') } implementation 'com.google.code.findbugs:jsr305:3.0.2' implementation 'com.tbuonomo:dotsindicator:4.2' implementation 'com.github.amulyakhare:textdrawable:558677ea31' // Network implementation "com.squareup.okhttp3:okhttp:$ok_http_version" implementation "com.squareup.okhttp3:logging-interceptor:$ok_http_version" implementation 'com.squareup.moshi:moshi:1.11.0' implementation 'com.squareup.moshi:moshi-kotlin:1.11.0' implementation 'com.squareup.retrofit2:converter-moshi:2.6.4' implementation 'org.conscrypt:conscrypt-android:2.5.3' // TLS 1.3 support for Android <= 9.0 // Credential Manager implementation "androidx.credentials:credentials:1.3.0" // UI implementation "androidx.appcompat:appcompat:$appCompatVersion" implementation 'androidx.coordinatorlayout:coordinatorlayout:1.2.0' implementation "com.google.android.material:material:$materialVersion" implementation "androidx.recyclerview:recyclerview:$recyclerViewVersion" implementation 'com.google.android.flexbox:flexbox:3.0.0' implementation "androidx.constraintlayout:constraintlayout:$constrainLayoutVersion" implementation "com.github.bumptech.glide:glide:$glideVersion" ksp "com.github.bumptech.glide:compiler:$glideVersion" implementation 'com.github.MikeOrtiz:TouchImageView:3.0.6' implementation "io.coil-kt:coil:$coilVersion" // Compose implementation(platform("androidx.compose:compose-bom:$composeBom")) implementation("androidx.compose.ui:ui") implementation("androidx.compose.ui:ui-tooling") implementation("androidx.compose.material3:material3") implementation("androidx.activity:activity-compose:1.7.2") implementation "androidx.lifecycle:lifecycle-runtime-compose:$lifecycleVersion" implementation "com.airbnb.android:lottie-compose:6.6.7" // Navigation implementation "androidx.navigation:navigation-fragment-ktx:$navigationVersion" implementation "androidx.navigation:navigation-ui-ktx:$navigationVersion" // Database implementation "androidx.room:room-ktx:$roomVersion" implementation "androidx.room:room-runtime:$roomVersion" ksp "androidx.room:room-compiler:$roomVersion" // Prefs implementation "androidx.preference:preference-ktx:$preferenceVersion" implementation 'com.scottyab:secure-preferences-lib:0.1.7' implementation "androidx.datastore:datastore-preferences:$datastoreVersion" implementation 'androidx.multidex:multidex:2.0.1' implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion" // Firebase // Import the BoM for the Firebase platform implementation platform("com.google.firebase:firebase-bom:$firebaseVersion") implementation 'com.google.firebase:firebase-database-ktx:20.0.2' implementation 'com.google.firebase:firebase-auth-ktx' implementation 'com.google.firebase:firebase-analytics' implementation 'com.google.firebase:firebase-inappmessaging-display' implementation 'com.google.firebase:firebase-installations' implementation 'com.google.firebase:firebase-messaging-ktx' implementation 'com.google.firebase:firebase-dynamic-links' // Google Drive Dependencies implementation ('com.google.api-client:google-api-client-android:1.26.0') { exclude group: 'com.google.guava', module: 'guava-jdk5' } implementation('com.google.apis:google-api-services-drive:v3-rev173-1.25.0') { exclude group: 'com.google.guava', module: 'guava-jdk5' } implementation ('com.google.http-client:google-http-client-gson:1.26.0') { // do we need this exclude group: 'com.google.guava', module: 'guava-jdk5' } implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycleVersion" implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycleVersion" implementation "androidx.lifecycle:lifecycle-extensions:2.2.0" // DI implementation "com.google.dagger:hilt-android:$hiltVersion" ksp "com.google.dagger:hilt-compiler:$hiltVersion" implementation "androidx.hilt:hilt-work:$hiltWorkVersion" implementation "androidx.hilt:hilt-navigation-compose:$hiltCompilerVersion" ksp "androidx.hilt:hilt-compiler:$hiltCompilerVersion" // Unit tests testImplementation "junit:junit:$junitVersion" testImplementation "io.mockk:mockk:1.13.8" testImplementation "androidx.arch.core:core-testing:$coreTestingVersion" testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutinesVersion" // Instrumental tests androidTestImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutinesVersion" androidTestImplementation "androidx.room:room-testing:$roomVersion" androidTestImplementation "androidx.test.ext:junit:$junitExtVersion" androidTestImplementation('androidx.test:runner:1.3.0') { exclude group: 'com.android.support', module: 'support-annotations' } androidTestImplementation('androidx.test.espresso:espresso-core:3.3.0') { exclude group: 'com.google.code.findbugs', module: 'jsr305' exclude group: 'com.android.support', module: 'support-annotations' } androidTestImplementation('androidx.test.espresso:espresso-intents:3.3.0') { exclude group: 'com.google.code.findbugs', module: 'jsr305' exclude group: 'com.android.support', module: 'support-annotations' } // DI for instrumentation tests androidTestImplementation "com.google.dagger:hilt-android-testing:$hiltVersion" kspAndroidTest "com.google.dagger:hilt-compiler:$hiltVersion" // DI for local unit tests testImplementation "com.google.dagger:hilt-android-testing:$hiltVersion" kspTest "com.google.dagger:hilt-compiler:$hiltVersion" } hilt { enableAggregatingTask = true } ext { archivesBaseName = 'dash-wallet' } def props = new Properties() if (file("../service.properties").exists()) { file("../service.properties").withInputStream { props.load(it) } } def localProps = new Properties() if (file("../local.properties").exists()) { file("../local.properties").withInputStream { localProps.load(it) } } android { android.ndkVersion '21.3.6528147' namespace "de.schildbach.wallet_test" defaultConfig { compileSdk 35 minSdkVersion 24 targetSdkVersion 35 // version code: MMmmppbb; MM = Major Version, mm = minor version, pp == patch version, bb = build versionCode project.hasProperty('versionCode') ? project.property('versionCode') as int : 11040106 versionName project.hasProperty('versionName') ? project.property('versionName') : "11.4.1" multiDexEnabled true generatedDensities = ['hdpi', 'xhdpi'] vectorDrawables.useSupportLibrary = true testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" ksp { arg("room.schemaLocation", "$projectDir/schemas") } buildConfigField("String", "UPHOLD_CLIENT_ID", "\"UPHOLD_CLIENT_ID\"") buildConfigField("String", "UPHOLD_CLIENT_SECRET", "\"UPHOLD_CLIENT_SECRET\"") buildConfigField("String", "SUPPORT_EMAIL", "\"\"") buildConfigField("String", "COINBASE_CLIENT_ID", "\"COINBASE_CLIENT_ID\"") buildConfigField("String", "COINBASE_CLIENT_SECRET", "\"COINBASE_CLIENT_SECRET\"") def supportEmail = localProps.getProperty("SUPPORT_EMAIL") if (supportEmail != null) { buildConfigField("String", "SUPPORT_EMAIL", "\"$supportEmail\"") } else if(System.getenv("SUPPORT_EMAIL") != null) { buildConfigField("String", "SUPPORT_EMAIL", "\"${System.getenv("SUPPORT_EMAIL")}\"") } buildConfigField("String", "DPP_VERSION", "\"$dppVersion\"") buildConfigField("String", "DASHJ_VERSION", "\"$dashjVersion\"") } buildTypes { all { def imgurClientId = props.getProperty("IMGUR_CLIENT_ID") def imgurClientSecret = props.getProperty("IMGUR_CLIENT_SECRET") if (imgurClientId == null) { imgurClientId = "\"IMGUR_CLIENT_ID\"" } if (imgurClientSecret == null) { imgurClientSecret = "\"IMGUR_CLIENT_SECRET\"" } buildConfigField("String", "IMGUR_CLIENT_ID", imgurClientId) buildConfigField("String", "IMGUR_CLIENT_SECRET", imgurClientSecret) } release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard.cfg' testProguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard.cfg', 'proguardTest-rules.txt' } debug { multiDexEnabled true minifyEnabled false debuggable true def supportEmail = localProps.getProperty("INTERNAL_SUPPORT_EMAIL") if (supportEmail != null) { buildConfigField("String", "SUPPORT_EMAIL", "\"$supportEmail\"") } else if(System.getenv('INTERNAL_SUPPORT_EMAIL') != null) { buildConfigField("String", "SUPPORT_EMAIL", "\"${System.getenv('INTERNAL_SUPPORT_EMAIL')}\"") } } } sourceSets { main { manifest.srcFile 'AndroidManifest.xml' java.srcDirs = ['src'] res.srcDirs = ['res'] assets.srcDirs = ['assets'] } test { java.srcDirs = ['test'] resources.srcDirs = ['test'] } androidTest { assets.srcDirs += "$projectDir/schemas" java.srcDirs = ['androidTest'] resources.srcDirs = ['androidTest/java'] res.srcDirs = ['androidTest/testNet3/res'] } _testNet3 { res.srcDirs = ["testNet3/res"] } staging { res.srcDirs = ["staging/res"] } devnet { res.srcDirs = ["devnet/res"] } } flavorDimensions "default" productFlavors { all { def coinbaseClientId = props.getProperty("COINBASE_CLIENT_ID", "\"COINBASE_CLIENT_ID\"") def coinbaseClientSecret = props.getProperty("COINBASE_CLIENT_SECRET", "\"COINBASE_CLIENT_SECRET\"") buildConfigField("String", "COINBASE_CLIENT_ID", coinbaseClientId) buildConfigField("String", "COINBASE_CLIENT_SECRET", coinbaseClientSecret) } prod { applicationId = "hashengineering.darkcoin.wallet" def upholdClientId = props.getProperty("UPHOLD_CLIENT_ID", "\"UPHOLD_CLIENT_ID\"") def upholdClientSecret = props.getProperty("UPHOLD_CLIENT_SECRET", "\"UPHOLD_CLIENT_SECRET\"") buildConfigField("String", "UPHOLD_CLIENT_ID", upholdClientId) buildConfigField("String", "UPHOLD_CLIENT_SECRET", upholdClientSecret) def topperKeyId = props.getProperty("TOPPER_KEY_ID", "\"TOPPER_KEY_ID\"") def topperWidgetId = props.getProperty("TOPPER_WIDGET_ID", "\"TOPPER_WIDGET_ID\"") def topperPrivateKey = props.getProperty("TOPPER_PRIVATE_KEY", "\"TOPPER_PRIVATE_KEY\"") buildConfigField("String", "TOPPER_KEY_ID", topperKeyId) buildConfigField("String", "TOPPER_WIDGET_ID", topperWidgetId) buildConfigField("String", "TOPPER_PRIVATE_KEY", topperPrivateKey) def zenLedgerClientId = props.getProperty("ZENLEDGER_CLIENT_ID", "\"\"") def zenLedgerClientSecret = props.getProperty("ZENLEDGER_CLIENT_SECRET", "\"\"") buildConfigField("String", "ZENLEDGER_CLIENT_ID", zenLedgerClientId) buildConfigField("String", "ZENLEDGER_CLIENT_SECRET", zenLedgerClientSecret) } _testNet3 { applicationId = "hashengineering.darkcoin.wallet_test" def upholdClientId = props.getProperty("UPHOLD_CLIENT_ID_SANDBOX", "\"UPHOLD_CLIENT_ID\"") def upholdClientSecret = props.getProperty("UPHOLD_CLIENT_SECRET_SANDBOX", "\"UPHOLD_CLIENT_SECRET\"") buildConfigField("String", "UPHOLD_CLIENT_ID", upholdClientId) buildConfigField("String", "UPHOLD_CLIENT_SECRET", upholdClientSecret) def topperKeyId = props.getProperty("TOPPER_KEY_ID_SANDBOX", "\"TOPPER_KEY_ID\"") def topperWidgetId = props.getProperty("TOPPER_WIDGET_ID_SANDBOX", "\"TOPPER_WIDGET_ID\"") def topperPrivateKey = props.getProperty("TOPPER_PRIVATE_KEY_SANDBOX", "\"TOPPER_PRIVATE_KEY\"") buildConfigField("String", "TOPPER_KEY_ID", topperKeyId) buildConfigField("String", "TOPPER_WIDGET_ID", topperWidgetId) buildConfigField("String", "TOPPER_PRIVATE_KEY", topperPrivateKey) buildConfigField("String", "ZENLEDGER_CLIENT_ID", "\"\"") buildConfigField("String", "ZENLEDGER_CLIENT_SECRET", "\"\"") } staging { applicationId = "org.dash.dashpay.testnet" def upholdClientId = props.getProperty("UPHOLD_CLIENT_ID_SANDBOX") def upholdClientSecret = props.getProperty("UPHOLD_CLIENT_SECRET_SANDBOX") if (upholdClientId == null) { upholdClientId = "\"UPHOLD_CLIENT_ID\"" } if (upholdClientSecret == null) { upholdClientSecret = "\"UPHOLD_CLIENT_SECRET\"" } buildConfigField("String", "UPHOLD_CLIENT_ID", upholdClientId) buildConfigField("String", "UPHOLD_CLIENT_SECRET", upholdClientSecret) def topperKeyId = props.getProperty("TOPPER_KEY_ID_SANDBOX", "\"TOPPER_KEY_ID\"") def topperWidgetId = props.getProperty("TOPPER_WIDGET_ID_SANDBOX", "\"TOPPER_WIDGET_ID\"") def topperPrivateKey = props.getProperty("TOPPER_PRIVATE_KEY_SANDBOX", "\"TOPPER_PRIVATE_KEY\"") buildConfigField("String", "TOPPER_KEY_ID", topperKeyId) buildConfigField("String", "TOPPER_WIDGET_ID", topperWidgetId) buildConfigField("String", "TOPPER_PRIVATE_KEY", topperPrivateKey) buildConfigField("String", "ZENLEDGER_CLIENT_ID", "\"\"") buildConfigField("String", "ZENLEDGER_CLIENT_SECRET", "\"\"") } devnet { applicationId = "org.dash.dashpay.devnet" def imgurClientId = props.getProperty("UPHOLD_CLIENT_ID_SANDBOX") def imgurClientSecret = props.getProperty("UPHOLD_CLIENT_SECRET_SANDBOX") if (imgurClientId == null) { imgurClientId = "\"UPHOLD_CLIENT_ID\"" } if (imgurClientSecret == null) { imgurClientSecret = "\"UPHOLD_CLIENT_SECRET\"" } buildConfigField("String", "UPHOLD_CLIENT_ID", "\"UPHOLD_CLIENT_ID\"") buildConfigField("String", "UPHOLD_CLIENT_SECRET", "\"UPHOLD_CLIENT_SECRET\"") def topperKeyId = props.getProperty("TOPPER_KEY_ID_SANDBOX", "\"TOPPER_KEY_ID\"") def topperWidgetId = props.getProperty("TOPPER_WIDGET_ID_SANDBOX", "\"TOPPER_WIDGET_ID\"") def topperPrivateKey = props.getProperty("TOPPER_PRIVATE_KEY_SANDBOX", "\"TOPPER_PRIVATE_KEY\"") buildConfigField("String", "TOPPER_KEY_ID", topperKeyId) buildConfigField("String", "TOPPER_WIDGET_ID", topperWidgetId) buildConfigField("String", "TOPPER_PRIVATE_KEY", topperPrivateKey) buildConfigField("String", "ZENLEDGER_CLIENT_ID", "\"\"") buildConfigField("String", "ZENLEDGER_CLIENT_SECRET", "\"\"") } } packagingOptions { jniLibs { excludes += [ // android libscrypt.so is in dashj-x11-android 'lib/x86_64/freebsd/libscrypt.so', 'lib/x86_64/linux/libscrypt.so', 'lib/x86_64/darwin/libscrypt.dylib', // 32-bit Platform SDK is not supported 'lib/x86/libsdklib.so', 'lib/armeabi-v7a/libsdklib.so' ] } resources { excludes += [ 'com/google/thirdparty/publicsuffix/PublicSuffixPatterns.gwt.xml', 'com/google/thirdparty/publicsuffix/PublicSuffixType.gwt.xml', 'org/bitcoinj/crypto/mnemonic/wordlist/english.txt', 'org/bitcoinj/crypto/cacerts', 'org.bitcoin.production.checkpoints.txt', 'org.bitcoin.test.checkpoints.txt', 'google/protobuf/*.proto', 'META-INF/DEPENDENCIES', 'META-INF/AL2.0', 'META-INF/LGPL2.1' ] } } kotlinOptions { jvmTarget = "17" } compileOptions { coreLibraryDesugaringEnabled true sourceCompatibility JavaVersion.VERSION_17 targetCompatibility JavaVersion.VERSION_17 } buildFeatures { viewBinding true compose true } composeOptions { kotlinCompilerExtensionVersion = "1.5.14" } testOptions { unitTests.includeAndroidResources = true unitTests.returnDefaultValues = true } lint { abortOnError false disable 'MissingTranslation' } tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach { kotlinOptions { freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn" } } } apply from: file("../gradle/google-services.gradle")