Skip to content

Commit 0c931d2

Browse files
Merge pull request #2169 from hussainmohd-a/v055n
v055u
2 parents ac8373b + cd62e38 commit 0c931d2

File tree

348 files changed

+20465
-3164
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

348 files changed

+20465
-3164
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ app/src/headless/assets
2727
/platforms
2828
/tools
2929
/.kotlin/sessions
30+
app/google-services.json

app/build.gradle

Lines changed: 107 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,24 @@ plugins {
44
id 'kotlin-android'
55
}
66

7+
// apply Google Services and Firebase Crashlytics plugins conditionally
8+
// strategy: For command-line builds, check task names. For IDE, always apply plugins
9+
// but they'll only process play/website variants (Firebase deps are scoped to those variants)
10+
def taskNames = gradle.startParameter.taskNames.join(',').toLowerCase()
11+
def isFdroidBuild = taskNames.contains("fdroid")
12+
13+
println("app-task names: '$taskNames'")
14+
println("app; is fdroid build? $isFdroidBuild")
15+
16+
// don't apply firebase plugins for fdroid CLI builds
17+
if (!isFdroidBuild) {
18+
apply plugin: 'com.google.gms.google-services'
19+
apply plugin: 'com.google.firebase.crashlytics'
20+
println("app firebase plugins applied")
21+
} else {
22+
println("app firebase plugins SKIPPED")
23+
}
24+
725
def keystorePropertiesFile = rootProject.file("keystore.properties")
826
def keystoreProperties = new Properties()
927

@@ -44,13 +62,13 @@ try {
4462
}
4563

4664
android {
47-
compileSdk 35
65+
compileSdkVersion(36)
4866
// https://developer.android.com/studio/build/configure-app-module
4967
namespace 'com.celzero.bravedns'
5068

5169
defaultConfig {
5270
applicationId "com.celzero.bravedns"
53-
minSdkVersion 23
71+
minSdkVersion(23)
5472
targetSdkVersion 35
5573
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
5674
}
@@ -120,6 +138,19 @@ android {
120138
minifyEnabled true
121139
shrinkResources true
122140
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
141+
ndk {
142+
// Use SYMBOL_TABLE to reduce symbol file size significantly
143+
debugSymbolLevel 'SYMBOL_TABLE'
144+
// Only process symbols for the most common ABIs to avoid Crashlytics index errors
145+
// This reduces the total symbol data Crashlytics needs to process
146+
abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86_64'
147+
}
148+
if (!isFdroidBuild) {
149+
firebaseCrashlytics {
150+
// Enable processing and uploading of native symbols to Firebase servers.
151+
nativeSymbolUploadEnabled true
152+
}
153+
}
123154
}
124155
leakCanary {
125156
matchingFallbacks = ['debug']
@@ -135,6 +166,28 @@ android {
135166
}
136167
}
137168

169+
// fix: injectCrashlyticsBuildIds task has a buffer overflow bug
170+
// apply crashlytics configuration to firebase builds only
171+
if (!isFdroidBuild) {
172+
// workaround for crashlytics gradle plugin bug with large native symbols
173+
afterEvaluate {
174+
tasks.configureEach { task ->
175+
if (task.name.contains("injectCrashlyticsBuildIds")) {
176+
// disable the problematic task - symbols will still be uploaded via uploadCrashlyticsSymbolFile
177+
task.enabled = false
178+
logger.warn("disabled build id injection for: ${task.name} (workaround for IndexOutOfBoundsException)")
179+
logger.warn("native symbols will still be uploaded via uploadCrashlyticsSymbolFile task")
180+
}
181+
182+
if (task.name.contains("uploadCrashlyticsSymbolFile")) {
183+
task.doFirst {
184+
logger.info("uploading crashlytics symbols: ${task.name}")
185+
}
186+
}
187+
}
188+
}
189+
}
190+
138191
buildFeatures {
139192
viewBinding true
140193
buildConfig true
@@ -187,12 +240,12 @@ configurations {
187240
def firestackRepo = project.findProperty("firestackRepo") ?: "github"
188241
def firestackCommit = project.findProperty("firestackCommit") ?: "main"
189242

190-
def firestackDependency = { suffix = "" ->
243+
def firestackDependency = { suffix = ":debug" ->
191244
switch (firestackRepo) {
192245
case "jitpack":
193246
return "com.github.celzero:firestack:$firestackCommit${suffix}@aar"
194247
case "github":
195-
return "com.github.celzero:firestack:$firestackCommit${suffix}"
248+
return "com.github.celzero:firestack:$firestackCommit${suffix}@aar"
196249
case "ossrh":
197250
return "com.celzero:firestack:$firestackCommit${suffix}@aar"
198251
default:
@@ -201,18 +254,18 @@ def firestackDependency = { suffix = "" ->
201254
}
202255

203256
dependencies {
204-
def room_version = "2.7.2"
257+
def room_version = "2.8.1"
205258
def paging_version = "3.3.6"
206259

207-
implementation 'com.google.guava:guava:33.4.8-android'
260+
implementation 'com.google.guava:guava:33.5.0-android'
208261

209262
// https://developer.android.com/studio/write/java8-support
210263
// included to fix issues with Android 6 support, issue#563
211264
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.5")
212265

213266
fullImplementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.1.20'
214267
fullImplementation 'androidx.appcompat:appcompat:1.7.1'
215-
fullImplementation 'androidx.core:core-ktx:1.17.0'
268+
fullImplementation 'androidx.core:core-ktx:1.16.0'
216269
implementation 'androidx.preference:preference-ktx:1.2.1'
217270
fullImplementation 'androidx.constraintlayout:constraintlayout:2.2.1'
218271
fullImplementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
@@ -221,51 +274,51 @@ dependencies {
221274
fullImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2'
222275

223276
// LiveData
224-
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.9.2'
277+
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.9.4'
225278

226-
implementation 'com.google.code.gson:gson:2.13.1'
279+
implementation 'com.google.code.gson:gson:2.13.2'
227280

228281
implementation "androidx.room:room-runtime:$room_version"
229282
ksp "androidx.room:room-compiler:$room_version"
230283
implementation "androidx.room:room-ktx:$room_version"
231284
implementation "androidx.room:room-paging:$room_version"
232285

233-
fullImplementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.9.2'
234-
fullImplementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.9.2'
286+
fullImplementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.9.4'
287+
fullImplementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.9.4'
235288

236289
// Pagers Views
237290
implementation "androidx.paging:paging-runtime-ktx:$paging_version"
238291
fullImplementation 'androidx.fragment:fragment-ktx:1.8.9'
239-
implementation 'com.google.android.material:material:1.12.0'
292+
implementation 'com.google.android.material:material:1.13.0'
240293
fullImplementation 'androidx.viewpager2:viewpager2:1.1.0'
241294

242-
fullImplementation 'com.squareup.okhttp3:okhttp:5.1.0'
243-
fullImplementation 'com.squareup.okhttp3:okhttp-dnsoverhttps:5.1.0'
295+
fullImplementation 'com.squareup.okhttp3:okhttp:5.2.1'
296+
fullImplementation 'com.squareup.okhttp3:okhttp-dnsoverhttps:5.2.1'
244297

245298
fullImplementation 'com.squareup.retrofit2:retrofit:3.0.0'
246299
fullImplementation 'com.squareup.retrofit2:converter-gson:3.0.0'
247300

248-
implementation 'com.squareup.okio:okio-jvm:3.16.0'
301+
implementation 'com.squareup.okio:okio-jvm:3.16.2'
249302
// Glide
250-
fullImplementation('com.github.bumptech.glide:glide:4.16.0') {
303+
fullImplementation('com.github.bumptech.glide:glide:5.0.5') {
251304
exclude group: 'glide-parent'
252305
}
253-
fullImplementation('com.github.bumptech.glide:okhttp3-integration:4.16.0') {
306+
fullImplementation('com.github.bumptech.glide:okhttp3-integration:5.0.5') {
254307
exclude group: 'glide-parent'
255308
}
256309

257310
// Ref: https://stackoverflow.com/a/46638213
258-
kspFull 'com.github.bumptech.glide:compiler:4.16.0'
311+
kspFull 'com.github.bumptech.glide:compiler:5.0.5'
259312

260313
// Swipe button animation
261314
fullImplementation 'com.facebook.shimmer:shimmer:0.5.0'
262315

263316
// Koin core
264-
download 'io.insert-koin:koin-core:4.1.0'
265-
implementation 'io.insert-koin:koin-core:4.1.0'
317+
download 'io.insert-koin:koin-core:4.1.1'
318+
implementation 'io.insert-koin:koin-core:4.1.1'
266319
// Koin main (Scope, ViewModel ...)
267-
download 'io.insert-koin:koin-android:4.1.0'
268-
implementation 'io.insert-koin:koin-android:4.1.0'
320+
download 'io.insert-koin:koin-android:4.1.1'
321+
implementation 'io.insert-koin:koin-android:4.1.1'
269322

270323
download 'hu.autsoft:krate:2.0.0'
271324
implementation 'hu.autsoft:krate:2.0.0'
@@ -281,7 +334,7 @@ dependencies {
281334
playImplementation firestackDependency()
282335

283336
// Work manager
284-
implementation('androidx.work:work-runtime-ktx:2.10.3') {
337+
implementation('androidx.work:work-runtime-ktx:2.10.5') {
285338
modules {
286339
module("com.google.guava:listenablefuture") {
287340
replacedBy("com.google.guava:guava", "listenablefuture is part of guava")
@@ -298,11 +351,23 @@ dependencies {
298351
androidTestImplementation 'androidx.test.ext:junit:1.3.0'
299352
androidTestImplementation 'androidx.test.espresso:espresso-core:3.7.0'
300353
androidTestImplementation 'androidx.test:rules:1.7.0'
354+
testImplementation 'org.robolectric:robolectric:4.16'
355+
testImplementation 'androidx.test:core:1.7.0'
356+
testImplementation 'androidx.test.ext:junit:1.3.0'
357+
testImplementation 'org.mockito:mockito-core:5.20.0'
358+
// Added test dependencies for comprehensive testing
359+
testImplementation 'io.mockk:mockk:1.14.6'
360+
testImplementation 'io.mockk:mockk-android:1.14.6'
361+
testImplementation 'androidx.arch.core:core-testing:2.2.0'
362+
testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.10.2'
363+
testImplementation 'io.insert-koin:koin-test:4.1.1'
364+
testImplementation 'io.insert-koin:koin-test-junit4:4.1.1'
365+
androidTestImplementation 'io.mockk:mockk-android:1.14.6'
301366

302367
leakCanaryImplementation 'com.squareup.leakcanary:leakcanary-android:2.14'
303368

304-
fullImplementation 'androidx.navigation:navigation-fragment-ktx:2.9.3'
305-
fullImplementation 'androidx.navigation:navigation-ui-ktx:2.9.3'
369+
fullImplementation 'androidx.navigation:navigation-fragment-ktx:2.9.5'
370+
fullImplementation 'androidx.navigation:navigation-ui-ktx:2.9.5'
306371

307372
fullImplementation 'androidx.biometric:biometric:1.1.0'
308373

@@ -328,4 +393,21 @@ dependencies {
328393
//fdroidImplementation 'com.stripe:stripe-android:21.21.0'
329394

330395
lintChecks 'com.android.security.lint:lint:1.0.3'
396+
397+
// battery optimization permission helper
398+
implementation 'com.waseemsabir:betterypermissionhelper:1.0.3'
399+
400+
// Facebook battery metrics
401+
implementation 'com.facebook.battery:metrics:1.0.0'
402+
implementation 'com.facebook.battery:reporters:1.0.0'
403+
implementation 'com.facebook.battery:serializers:1.0.0'
404+
405+
// Firebase dependencies for error reporting (website and play variants only)
406+
websiteImplementation platform('com.google.firebase:firebase-bom:34.4.0')
407+
websiteImplementation 'com.google.firebase:firebase-crashlytics'
408+
websiteImplementation 'com.google.firebase:firebase-crashlytics-ndk'
409+
410+
playImplementation platform('com.google.firebase:firebase-bom:34.4.0')
411+
playImplementation 'com.google.firebase:firebase-crashlytics'
412+
playImplementation 'com.google.firebase:firebase-crashlytics-ndk'
331413
}

0 commit comments

Comments
 (0)