11plugins {
22 id ' com.android.application'
33 id ' com.google.devtools.ksp'
4- // to download blocklists for the headless variant
5- id " de.undercouch.download" version " 5.3.0"
64 id ' kotlin-android'
7- id ' com.google.gms.google-services'
8- id ' com.google.firebase.crashlytics'
95}
106
117def keystorePropertiesFile = rootProject. file(" keystore.properties" )
@@ -48,14 +44,14 @@ try {
4844}
4945
5046android {
51- compileSdk 34
47+ compileSdk 35
5248 // https://developer.android.com/studio/build/configure-app-module
5349 namespace ' com.celzero.bravedns'
5450
5551 defaultConfig {
5652 applicationId " com.celzero.bravedns"
5753 minSdkVersion 23
58- targetSdkVersion 34
54+ targetSdkVersion 35
5955 testInstrumentationRunner " androidx.test.runner.AndroidJUnitRunner"
6056 }
6157
@@ -76,6 +72,47 @@ android {
7672 }
7773 }
7874
75+ // https://developer.android.com/studio/build/configure-apk-splits
76+ splits. abi {
77+ println (' Create separate apks' )
78+ // generates multiple APKs based on the ABIs you define
79+ enable true
80+ reset()
81+ // comma-separated list of ABIs that you want Gradle to generate APKs for
82+ include ' x86' , ' armeabi' , ' armeabi-v7a' , ' arm64-v8a' , ' x86_64'
83+ // generates a universal APK in addition to per-ABI APKs
84+ universalApk true
85+ }
86+ // version codes for each ABI variant
87+ project. ext. versionCodes = [
88+ ' armeabi' : 1 ,
89+ ' armeabi-v7a' : 2 ,
90+ ' arm64-v8a' : 3 ,
91+ ' x86' : 8 ,
92+ ' x86_64' : 9
93+ ]
94+ android. applicationVariants. configureEach { variant ->
95+ println (" variant name: ${ variant.name} " )
96+ variant. outputs. configureEach { output ->
97+ // def abi = output.filters.find { it.filterType.name == "ABI" }?.identifier
98+ def abi = variant. outputs. first(). getFilter(com.android.build.OutputFile . ABI )
99+ def baseAbiVersionCode = project. ext. versionCodes. get(abi)
100+ println (" base version code: $baseAbiVersionCode " )
101+ if (abi != null ) {
102+ println (" variant name: ${ variant.name} , abi: $abi " )
103+ // assign different version code for each output
104+ // eg for arm64-v8a, version code will be 30000000 + variant.versionCode
105+ def v = baseAbiVersionCode * 10000000 + variant. versionCode
106+ // API 'ApkVariantOutput.getVersionCodeOverride()' is obsolete and has been replaced
107+ // with 'VariantOutput.versionCode()'
108+ output. versionCodeOverride = v
109+ println (" version code override: $v " )
110+ } else {
111+ println (" no ABI filter applied for variant: ${ variant.name} " )
112+ }
113+ }
114+ }
115+
79116 buildTypes {
80117 release {
81118 // modified as part of #352, now webview is removed from app, flipping back
@@ -115,15 +152,6 @@ android {
115152 }
116153 }
117154
118- variantFilter { variant ->
119- def releaseChannel = variant. getFlavors(). get(0 ). name
120- def releaseType = variant. getFlavors(). get(1 ). name
121-
122- if (releaseType == ' headless' && releaseChannel != ' fdroid' ) {
123- variant. setIgnore(true )
124- }
125- }
126-
127155 flavorDimensions = [" releaseChannel" , " releaseType" ]
128156 productFlavors {
129157 play {
@@ -135,35 +163,19 @@ android {
135163 website {
136164 dimension " releaseChannel"
137165 }
138- headless {
139- dimension " releaseType"
140- minSdkVersion 31
141- // stackoverflow.com/a/60560178
142- // buildConfigField 'string', 'timestamp', '1662384683026'
143- }
144166 full {
145167 dimension " releaseType"
146168 // getPackageInfo().versionCode not returning the correct value (in prod builds) when
147169 // value is set in AndroidManifest.xml so setting it here
148- // for buildtype alpha, versionCode is set in env overriding gradle.properties
170+ // for build type alpha, versionCode is set in env overriding gradle.properties
149171 versionCode = getVersionCode()
150172 versionName = gitVersion
151173 vectorDrawables. useSupportLibrary = true
152174 }
153175 }
154176 lint {
155- abortOnError false
156- }
157-
158- tasks. configureEach { task ->
159- if (task. name. toLowerCase(). contains(' headless' )) {
160- task. dependsOn downloadBlocklists
161- if (task. name. endsWith(" BuildConfig" )) {
162- task. enabled false
163- }
164- }
177+ abortOnError true
165178 }
166-
167179}
168180
169181configurations {
@@ -172,54 +184,69 @@ configurations {
172184 }
173185}
174186
187+ def firestackRepo = project. findProperty(" firestackRepo" ) ?: " github"
188+ def firestackCommit = project. findProperty(" firestackCommit" ) ?: " main"
189+
190+ def firestackDependency = { suffix = " " ->
191+ switch (firestackRepo) {
192+ case " jitpack" :
193+ return " com.github.celzero:firestack:$firestackCommit ${ suffix} @aar"
194+ case " github" :
195+ return " com.github.celzero:firestack:$firestackCommit ${ suffix} "
196+ case " ossrh" :
197+ return " com.celzero:firestack:$firestackCommit ${ suffix} @aar"
198+ default :
199+ throw new GradleException (" Unknown firestackRepo: $firestackRepo " )
200+ }
201+ }
202+
175203dependencies {
176- androidTestImplementation ' androidx.test:rules:1.5.0'
177204 def room_version = " 2.6.1"
178- def paging_version = " 3.2.1 "
205+ def paging_version = " 3.3.6 "
179206
180- implementation ' com.google.guava:guava:32.1.1 -android'
207+ implementation ' com.google.guava:guava:33.4.8 -android'
181208
182209 // https://developer.android.com/studio/write/java8-support
183210 // included to fix issues with Android 6 support, issue#563
184211 coreLibraryDesugaring(" com.android.tools:desugar_jdk_libs:2.0.4" )
185212
186- fullImplementation ' org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.21 '
187- fullImplementation ' androidx.appcompat:appcompat:1.6 .1'
188- fullImplementation ' androidx.core:core-ktx:1.12 .0'
213+ fullImplementation ' org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.1.0 '
214+ fullImplementation ' androidx.appcompat:appcompat:1.7 .1'
215+ fullImplementation ' androidx.core:core-ktx:1.16 .0'
189216 implementation ' androidx.preference:preference-ktx:1.2.1'
190- fullImplementation ' androidx.constraintlayout:constraintlayout:2.1.4 '
217+ fullImplementation ' androidx.constraintlayout:constraintlayout:2.2.1 '
191218 fullImplementation ' androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
192219
193- fullImplementation ' org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3 '
194- fullImplementation ' org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3 '
220+ fullImplementation ' org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2 '
221+ fullImplementation ' org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2 '
195222
196223 // LiveData
197- implementation ' androidx.lifecycle:lifecycle-livedata-ktx:2.7.0 '
224+ implementation ' androidx.lifecycle:lifecycle-livedata-ktx:2.9.1 '
198225
199- implementation ' com.google.code.gson:gson:2.10 .1'
226+ implementation ' com.google.code.gson:gson:2.13 .1'
200227
201228 implementation " androidx.room:room-runtime:$room_version "
202229 ksp " androidx.room:room-compiler:$room_version "
203230 implementation " androidx.room:room-ktx:$room_version "
204231 implementation " androidx.room:room-paging:$room_version "
205232
206233 fullImplementation ' androidx.lifecycle:lifecycle-extensions:2.2.0'
207- fullImplementation ' androidx.lifecycle:lifecycle-viewmodel-ktx:2.7.0 '
208- fullImplementation ' androidx.lifecycle:lifecycle-runtime-ktx:2.7.0 '
234+ fullImplementation ' androidx.lifecycle:lifecycle-viewmodel-ktx:2.9.1 '
235+ fullImplementation ' androidx.lifecycle:lifecycle-runtime-ktx:2.9.1 '
209236
210237 // Pagers Views
211238 implementation " androidx.paging:paging-runtime-ktx:$paging_version "
212- fullImplementation ' androidx.fragment:fragment-ktx:1.6.2 '
213- implementation ' com.google.android.material:material:1.11 .0'
214- fullImplementation ' androidx.viewpager2:viewpager2:1.0 .0'
239+ fullImplementation ' androidx.fragment:fragment-ktx:1.8.8 '
240+ implementation ' com.google.android.material:material:1.12 .0'
241+ fullImplementation ' androidx.viewpager2:viewpager2:1.1 .0'
215242
216- fullImplementation ' com.squareup.okhttp3:okhttp:4.12 .0'
217- fullImplementation ' com.squareup.okhttp3:okhttp-dnsoverhttps:4.12 .0'
243+ fullImplementation ' com.squareup.okhttp3:okhttp:5.1 .0'
244+ fullImplementation ' com.squareup.okhttp3:okhttp-dnsoverhttps:5.1 .0'
218245
219- fullImplementation ' com.squareup.retrofit2:retrofit:2.9 .0'
220- fullImplementation ' com.squareup.retrofit2:converter-gson:2.9 .0'
246+ fullImplementation ' com.squareup.retrofit2:retrofit:3.0 .0'
247+ fullImplementation ' com.squareup.retrofit2:converter-gson:3.0 .0'
221248
222- implementation ' com.squareup.okio:okio-jvm:3.9 .0'
249+ implementation ' com.squareup.okio:okio-jvm:3.15 .0'
223250 // Glide
224251 fullImplementation(' com.github.bumptech.glide:glide:4.16.0' ) {
225252 exclude group : ' glide-parent'
@@ -235,11 +262,11 @@ dependencies {
235262 fullImplementation ' com.facebook.shimmer:shimmer:0.5.0'
236263
237264 // Koin core
238- download ' io.insert-koin:koin-core:3.5.6 '
239- implementation ' io.insert-koin:koin-core:3.5.6 '
265+ download ' io.insert-koin:koin-core:4.1.0 '
266+ implementation ' io.insert-koin:koin-core:4.1.0 '
240267 // Koin main (Scope, ViewModel ...)
241- download ' io.insert-koin:koin-android:3.5.6 '
242- implementation ' io.insert-koin:koin-android:3.5.6 '
268+ download ' io.insert-koin:koin-android:4.1.0 '
269+ implementation ' io.insert-koin:koin-android:4.1.0 '
243270
244271 download ' hu.autsoft:krate:2.0.0'
245272 implementation ' hu.autsoft:krate:2.0.0'
@@ -248,15 +275,14 @@ dependencies {
248275 fullImplementation ' com.github.kirich1409:viewbindingpropertydelegate:1.5.9'
249276 fullImplementation ' com.github.kirich1409:viewbindingpropertydelegate-noreflection:1.5.9'
250277
251- // from: https://jitpack.io/#celzero/firestack
252- download ' com.github.celzero:firestack:ee0a5ac71f@aar'
253- websiteImplementation ' com.github.celzero:firestack:ee0a5ac71f@aar'
254- fdroidImplementation ' com.github.celzero:firestack:ee0a5ac71f@aar'
255- // debug symbols for crashlytics
256- playImplementation ' com.github.celzero:firestack:ee0a5ac71f:debug@aar'
278+ // add ":debug" suffix to the dependency to include debug symbols
279+ download firestackDependency()
280+ websiteImplementation firestackDependency()
281+ fdroidImplementation firestackDependency()
282+ playImplementation firestackDependency()
257283
258284 // Work manager
259- implementation(' androidx.work:work-runtime-ktx:2.9.0 ' ) {
285+ implementation(' androidx.work:work-runtime-ktx:2.10.2 ' ) {
260286 modules {
261287 module(" com.google.guava:listenablefuture" ) {
262288 replacedBy(" com.google.guava:guava" , " listenablefuture is part of guava" )
@@ -265,66 +291,42 @@ dependencies {
265291 }
266292
267293 // for handling IP addresses and subnets, both IPv4 and IPv6
268- // https:// seancfoley.github.io/IPAddress/ipaddress.html
269- download ' com.github.seancfoley:ipaddress:5.4.0 '
270- implementation ' com.github.seancfoley:ipaddress:5.4.0 '
294+ // seancfoley.github.io/IPAddress/ipaddress.html
295+ download ' com.github.seancfoley:ipaddress:5.5.1 '
296+ implementation ' com.github.seancfoley:ipaddress:5.5.1 '
271297
272298 testImplementation ' junit:junit:4.13.2'
273- androidTestImplementation ' androidx.test.ext:junit:1.1.5'
274- androidTestImplementation ' androidx.test.espresso:espresso-core:3.5.1'
299+ androidTestImplementation ' androidx.test.ext:junit:1.2.1'
300+ androidTestImplementation ' androidx.test.espresso:espresso-core:3.6.1'
301+ androidTestImplementation ' androidx.test:rules:1.6.1'
275302
276303 leakCanaryImplementation ' com.squareup.leakcanary:leakcanary-android:2.14'
277304
278- fullImplementation ' androidx.navigation:navigation-fragment-ktx:2.7.7 '
279- fullImplementation ' androidx.navigation:navigation-ui-ktx:2.7.7 '
305+ fullImplementation ' androidx.navigation:navigation-fragment-ktx:2.9.1 '
306+ fullImplementation ' androidx.navigation:navigation-ui-ktx:2.9.1 '
280307
281308 fullImplementation ' androidx.biometric:biometric:1.1.0'
282309
283310 playImplementation ' com.google.android.play:app-update:2.1.0'
284311 playImplementation ' com.google.android.play:app-update-ktx:2.1.0'
285312
286313 // for encrypting wireguard configuration files
287- implementation(" androidx.security:security-crypto:1.1.0-alpha06 " )
288- implementation(" androidx.security:security-app-authenticator:1.0.0-alpha03 " )
289- androidTestImplementation(" androidx.security:security-app-authenticator:1.0.0-alpha03 " )
314+ implementation(" androidx.security:security-crypto:1.1.0-beta01 " )
315+ implementation(" androidx.security:security-app-authenticator:1.0.0-rc01 " )
316+ androidTestImplementation(" androidx.security:security-app-authenticator:1.0.0-rc01 " )
290317
291318 // barcode scanner for wireguard
292319 fullImplementation ' com.journeyapps:zxing-android-embedded:4.3.0'
293-
294- // only using firebase crashlytics experimentally for stability tracking, only in play variant
295- // not in fdroid or website
296- playImplementation ' com.google.firebase:firebase-crashlytics:19.0.0'
297- playImplementation ' com.google.firebase:firebase-crashlytics-ndk:19.0.0'
298- }
299-
300- // github.com/michel-kraemer/gradle-download-task/issues/131#issuecomment-464476903
301- tasks. register(' downloadBlocklists' , Download ) {
302- // def assetsDir = new File(projectDir, 'src/main/assets'
303- def assetsDir = android. sourceSets. headless. assets. srcDirs[0 ]
304- // the filenames are ignored by dl, but acts as a hint for the output
305- // filename for the download-plugin, which does not respect the
306- // content-disposition http header, but rather guesses dest file names
307- // from the final segment of url's path
308- // github.com/michel-kraemer/gradle-download-task/blob/64d1ce32/src/main/java/de/undercouch/gradle/tasks/download/DownloadAction.java#L731
309- def sources = [
310- ' https://dl.rethinkdns.com/blocklists/filetag.json' ,
311- ' https://dl.rethinkdns.com/basicconfig/basicconfig.json' ,
312- ' https://dl.rethinkdns.com/rank/rd.txt' ,
313- ' https://dl.rethinkdns.com/trie/td.txt' ,
314- ]
315- src(sources)
316- dest assetsDir
317- // download files only if last-modified of the local file is less than
318- // the last-modified http header returned by the server
319- onlyIfModified true
320- // or if etag mismatches
321- useETag true
322- // overwrite older files as determined by last-modified, always
323- overwrite true
324- }
325-
326- tasks. register(' downloadDependencies' , Copy ) {
327- dependsOn downloadBlocklists
328- from configurations. download
329- into " libs"
320+ fullImplementation ' com.simplecityapps:recyclerview-fastscroll:2.0.1'
321+
322+ // for confetti animation
323+ fullImplementation ' nl.dionsegijn:konfetti-xml:2.0.5'
324+ // for in-app purchases
325+ // playImplementation 'com.android.billingclient:billing:8.0.0'
326+ // websiteImplementation 'com.android.billingclient:billing:8.0.0'
327+ // for stripe payment gateway
328+ // websiteImplementation 'com.stripe:stripe-android:21.21.0'
329+ // fdroidImplementation 'com.stripe:stripe-android:21.21.0'
330+
331+ lintChecks ' com.android.security.lint:lint:1.0.3'
330332}
0 commit comments