Skip to content

Commit 0e0fa94

Browse files
authored
Merge branch 'master' into issue_3086_Update-SemaphoreCI-to-use-SdkVersion-to-36
2 parents a54d6bf + 060a72c commit 0e0fa94

17 files changed

Lines changed: 497 additions & 242 deletions

.idea/compiler.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.semaphore/semaphore.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ global_job_config:
3939
# print some debug info
4040
- ping fel.localhost -c 1
4141
- ping fel.flowcrypt.test -c 1
42-
# use JAVA 17 by default
43-
- sem-version java 17
42+
# use JAVA 21 by default
43+
- sem-version java 21
4444
# general settings
4545
- export PATH=${ANDROID_HOME}/emulator:${ANDROID_HOME}/cmdline-tools/latest/bin:${ANDROID_HOME}/platform-tools:${PATH}
4646
- sudo rm -rf ~/.rbenv ~/.phpbrew

FlowCrypt/build.gradle.kts

Lines changed: 61 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -184,20 +184,15 @@ android {
184184

185185
compileOptions {
186186
isCoreLibraryDesugaringEnabled = true
187-
sourceCompatibility = JavaVersion.VERSION_17
188-
targetCompatibility = JavaVersion.VERSION_17
187+
sourceCompatibility = JavaVersion.VERSION_21
188+
targetCompatibility = JavaVersion.VERSION_21
189189
}
190190

191191
buildFeatures {
192192
buildConfig = true
193193
viewBinding = true
194194
}
195195

196-
kotlinOptions {
197-
jvmTarget = JavaVersion.VERSION_17.toString()
198-
freeCompilerArgs += listOf("-opt-in=kotlin.RequiresOptIn")
199-
}
200-
201196
packaging {
202197
resources.excludes += setOf(
203198
"META-INF/DEPENDENCIES",
@@ -328,6 +323,20 @@ easylauncher {
328323
}
329324
}
330325

326+
java {
327+
toolchain {
328+
languageVersion.set(JavaLanguageVersion.of(21))
329+
}
330+
}
331+
332+
333+
kotlin {
334+
compilerOptions {
335+
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_21)
336+
freeCompilerArgs.add("-opt-in=kotlin.RequiresOptIn")
337+
}
338+
}
339+
331340
tasks.register("checkCorrectBranch") {
332341
if (!grgit.branch.current().name.equals("master")) {
333342
throw GradleException("Please use 'master' branch to generate a release build")
@@ -400,9 +409,9 @@ val devDebugImplementation: Configuration by configurations.creating
400409
val uiTestsImplementation by configurations.named("uiTestsImplementation")
401410

402411
dependencies {
403-
ksp("com.github.bumptech.glide:ksp:4.16.0")
412+
ksp("com.github.bumptech.glide:ksp:5.0.5")
404413
ksp("androidx.annotation:annotation:1.9.1")
405-
ksp("androidx.room:room-compiler:2.7.2")
414+
ksp("androidx.room:room-compiler:2.8.0")
406415
//ACRA needs the following dependency to use a custom report sender
407416

408417
ksp("dev.zacsweers.autoservice:auto-service-ksp:1.2.0")
@@ -413,34 +422,34 @@ dependencies {
413422
devDebugImplementation("com.squareup.leakcanary:leakcanary-android:2.14")
414423
//uiTests is the build type for testing.
415424
//noinspection FragmentGradleConfiguration
416-
uiTestsImplementation("androidx.fragment:fragment-testing:1.8.7")
417-
uiTestsImplementation("androidx.test:core-ktx:1.6.1")
425+
uiTestsImplementation("androidx.fragment:fragment-testing:1.8.9")
426+
uiTestsImplementation("androidx.test:core-ktx:1.7.0")
418427

419-
androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1")
420-
androidTestImplementation("androidx.test.espresso:espresso-contrib:3.6.1")
421-
androidTestImplementation("androidx.test.espresso:espresso-intents:3.6.1")
422-
androidTestImplementation("androidx.test.espresso:espresso-web:3.6.1")
428+
androidTestImplementation("androidx.test.espresso:espresso-core:3.7.0")
429+
androidTestImplementation("androidx.test.espresso:espresso-contrib:3.7.0")
430+
androidTestImplementation("androidx.test.espresso:espresso-intents:3.7.0")
431+
androidTestImplementation("androidx.test.espresso:espresso-web:3.7.0")
423432
androidTestImplementation("androidx.test.ext:junit:1.3.0")
424433
androidTestImplementation("androidx.test:runner:1.7.0")
425-
androidTestImplementation("androidx.test:rules:1.6.1")
434+
androidTestImplementation("androidx.test:rules:1.7.0")
426435
androidTestImplementation("androidx.test.ext:junit-ktx:1.3.0")
427436
androidTestImplementation("androidx.test.uiautomator:uiautomator:2.3.0")
428-
androidTestImplementation("androidx.room:room-testing:2.7.2")
437+
androidTestImplementation("androidx.room:room-testing:2.8.0")
429438
androidTestImplementation("androidx.arch.core:core-testing:2.2.0")
430-
androidTestImplementation("androidx.work:work-testing:2.10.3")
431-
androidTestImplementation("com.squareup.okhttp3:mockwebserver:4.12.0")
432-
androidTestImplementation("com.squareup.okhttp3:okhttp-tls:4.12.0")
439+
androidTestImplementation("androidx.work:work-testing:2.10.4")
440+
androidTestImplementation("com.squareup.okhttp3:mockwebserver:5.1.0")
441+
androidTestImplementation("com.squareup.okhttp3:okhttp-tls:5.1.0")
433442
androidTestImplementation("com.athaydes.rawhttp:rawhttp-core:2.6.0")
434443
androidTestUtil("androidx.test:orchestrator:1.6.1")
435444

436-
testImplementation("com.squareup.okhttp3:mockwebserver:4.12.0")
445+
testImplementation("com.squareup.okhttp3:mockwebserver:5.1.0")
437446
testImplementation("com.flextrade.jfixture:jfixture:2.7.2")
438447
testImplementation("com.shazam:shazamcrest:0.11")
439-
testImplementation("org.robolectric:robolectric:4.14.1")
448+
testImplementation("org.robolectric:robolectric:4.16")
440449
//we need it to test Parcelable implementation
441-
testImplementation("org.jetbrains.kotlin:kotlin-reflect:2.2.10")
450+
testImplementation("org.jetbrains.kotlin:kotlin-reflect:2.2.20")
442451
testImplementation("junit:junit:4.13.2")
443-
testImplementation("androidx.room:room-testing:2.7.2")
452+
testImplementation("androidx.room:room-testing:2.8.0")
444453
testImplementation("io.github.classgraph:classgraph:4.8.181")
445454

446455
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
@@ -449,39 +458,39 @@ dependencies {
449458
implementation("androidx.appcompat:appcompat:1.7.1")
450459
implementation("androidx.legacy:legacy-preference-v14:1.0.0")
451460
implementation("androidx.cardview:cardview:1.0.0")
452-
implementation("androidx.browser:browser:1.8.0")
461+
implementation("androidx.browser:browser:1.9.0")
453462
implementation("androidx.recyclerview:recyclerview:1.4.0")
454463
implementation("androidx.recyclerview:recyclerview-selection:1.2.0")
455464
implementation("androidx.constraintlayout:constraintlayout:2.2.1")
456-
implementation("androidx.test.espresso:espresso-idling-resource:3.6.1")
465+
implementation("androidx.test.espresso:espresso-idling-resource:3.7.0")
457466
implementation("androidx.lifecycle:lifecycle-extensions:2.2.0")
458-
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.9.2")
459-
implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.9.2")
460-
implementation("androidx.lifecycle:lifecycle-process:2.9.2")
461-
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.9.2")
462-
implementation("androidx.lifecycle:lifecycle-service:2.9.2")
463-
implementation("androidx.room:room-runtime:2.7.2")
464-
implementation("androidx.room:room-ktx:2.7.2")
467+
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.9.4")
468+
implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.9.4")
469+
implementation("androidx.lifecycle:lifecycle-process:2.9.4")
470+
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.9.4")
471+
implementation("androidx.lifecycle:lifecycle-service:2.9.4")
472+
implementation("androidx.room:room-runtime:2.8.0")
473+
implementation("androidx.room:room-ktx:2.8.0")
465474
//we disabled warnings about paging-runtime-ktx because a newer version doesn't fit our needs
466475
//noinspection GradleDependency
467476
implementation("androidx.paging:paging-runtime-ktx:2.1.2")
468477
implementation("androidx.preference:preference-ktx:1.2.1")
469478
implementation("androidx.core:core-ktx:1.17.0")
470479
implementation("androidx.core:core-splashscreen:1.0.1")
471-
implementation("androidx.activity:activity-ktx:1.10.1")
480+
implementation("androidx.activity:activity-ktx:1.11.0")
472481
implementation("androidx.fragment:fragment-ktx:1.8.9")
473-
implementation("androidx.work:work-runtime-ktx:2.10.3")
474-
implementation("androidx.navigation:navigation-fragment-ktx:2.9.3")
475-
implementation("androidx.navigation:navigation-ui-ktx:2.9.3")
476-
implementation("androidx.navigation:navigation-runtime-ktx:2.9.3")
477-
implementation("androidx.webkit:webkit:1.13.0")
478-
479-
implementation("com.google.android.gms:play-services-base:18.7.0")
480-
implementation("com.google.android.gms:play-services-auth:21.3.0")
481-
implementation("com.google.android.material:material:1.12.0")
482+
implementation("androidx.work:work-runtime-ktx:2.10.4")
483+
implementation("androidx.navigation:navigation-fragment-ktx:2.9.4")
484+
implementation("androidx.navigation:navigation-ui-ktx:2.9.4")
485+
implementation("androidx.navigation:navigation-runtime-ktx:2.9.4")
486+
implementation("androidx.webkit:webkit:1.14.0")
487+
488+
implementation("com.google.android.gms:play-services-base:18.8.0")
489+
implementation("com.google.android.gms:play-services-auth:21.4.0")
490+
implementation("com.google.android.material:material:1.13.0")
482491
implementation("com.google.android.flexbox:flexbox:3.0.0")
483-
implementation("com.google.code.gson:gson:2.13.1")
484-
implementation("com.google.api-client:google-api-client-android:2.8.0")
492+
implementation("com.google.code.gson:gson:2.13.2")
493+
implementation("com.google.api-client:google-api-client-android:2.8.1")
485494
implementation("com.google.apis:google-api-services-gmail:v1-rev20250630-2.0.0")
486495
//ACRA needs the following dependency to use a custom report sender
487496
implementation("com.google.auto.service:auto-service-annotations:1.1.1")
@@ -490,20 +499,23 @@ dependencies {
490499
implementation("com.squareup.retrofit2:converter-gson:3.0.0")
491500
implementation("com.squareup.retrofit2:converter-scalars:3.0.0")
492501
implementation("com.squareup.okio:okio:3.16.0")
493-
implementation("com.squareup.okhttp3:logging-interceptor:4.12.0")
502+
implementation("com.squareup.okhttp3:logging-interceptor:5.1.0")
494503

495-
implementation("com.github.bumptech.glide:glide:4.16.0")
504+
implementation("com.github.bumptech.glide:glide:5.0.5")
496505
implementation("com.nulab-inc:zxcvbn:1.9.0")
497506
implementation("com.burhanrashid52:photoeditor:3.0.2")
498507
implementation("com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer:20240325.1")
499508
implementation("com.sandinh:zbase32-commons-codec_2.12:1.0.0")
500509
implementation("org.bitbucket.b_c:jose4j:0.9.6")
501-
implementation("org.jsoup:jsoup:1.21.1")
510+
implementation("org.jsoup:jsoup:1.21.2")
502511
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2")
512+
//kotlinx-serialization-core added to fix runtime issue with dependencies conflict.
513+
//Maybe it will be removed in future.
514+
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.9.0")
503515
implementation("org.pgpainless:pgpainless-core:1.7.6")
504516
implementation("org.eclipse.angus:angus-mail:2.0.4")
505517
implementation("org.eclipse.angus:gimap:2.0.4")
506-
implementation("commons-io:commons-io:2.19.0")
518+
implementation("commons-io:commons-io:2.20.0")
507519
implementation("net.openid:appauth:0.11.1")
508520
implementation("ch.acra:acra-http:5.12.0")
509521
implementation("io.github.everythingme:overscroll-decor-android:1.1.1")

FlowCrypt/src/androidTest/java/com/flowcrypt/email/WkdClientTest.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ package com.flowcrypt.email
88
import android.content.Context
99
import androidx.test.core.app.ApplicationProvider
1010
import androidx.test.ext.junit.runners.AndroidJUnit4
11+
import androidx.test.filters.FlakyTest
1112
import androidx.test.filters.SmallTest
1213
import com.flowcrypt.email.api.retrofit.ApiHelper
1314
import com.flowcrypt.email.api.retrofit.response.base.ApiError
@@ -24,6 +25,7 @@ import org.apache.commons.codec.binary.ZBase32
2425
import org.apache.commons.codec.digest.DigestUtils
2526
import org.junit.Assert.assertNull
2627
import org.junit.Assert.assertTrue
28+
import org.junit.Ignore
2729
import org.junit.Rule
2830
import org.junit.Test
2931
import org.junit.rules.RuleChain
@@ -79,6 +81,8 @@ class WkdClientTest {
7981
.around(mockWebServerRule)
8082

8183
@Test
84+
@FlakyTest
85+
@Ignore("Temporary disabled as flaky")
8286
fun existingEmailFlowCryptDomainTest() = runBlocking {
8387
val keys = WkdClient.lookupEmail(context, EXISTING_EMAIL)
8488
assertTrue("There are no keys in the key collection", requireNotNull(keys).keyRings.hasNext())

FlowCrypt/src/androidTest/java/com/flowcrypt/email/base/BaseTest.kt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,7 @@ import jakarta.mail.Session
6161
import jakarta.mail.internet.MimeMessage
6262
import kotlinx.coroutines.runBlocking
6363
import org.hamcrest.MatcherAssert.assertThat
64-
import org.hamcrest.Matchers
6564
import org.hamcrest.Matchers.allOf
66-
import org.hamcrest.Matchers.hasItem
6765
import org.hamcrest.Matchers.hasToString
6866
import org.hamcrest.Matchers.`is`
6967
import org.hamcrest.Matchers.not
@@ -356,7 +354,7 @@ abstract class BaseTest : BaseActivityTestImplementation {
356354
intending(
357355
allOf(
358356
hasAction(Intent.ACTION_GET_CONTENT),
359-
hasCategories(hasItem(Matchers.equalTo(Intent.CATEGORY_OPENABLE))),
357+
hasCategories(setOf(Intent.CATEGORY_OPENABLE)),
360358
hasType(type)
361359
)
362360
).respondWith(Instrumentation.ActivityResult(Activity.RESULT_OK, resultData))
@@ -405,6 +403,12 @@ abstract class BaseTest : BaseActivityTestImplementation {
405403
}
406404
}
407405
406+
protected fun getIdentifierByName(name: String): Int {
407+
return getTargetContext()
408+
.resources
409+
.getIdentifier(name, "id", getTargetContext().packageName)
410+
}
411+
408412
companion object{
409413
const val NOTIFICATION_RESOURCES_NAME =
410414
"com.android.systemui:id/expandableNotificationRow"

FlowCrypt/src/androidTest/java/com/flowcrypt/email/matchers/AppBarLayoutBackgroundColorMatcher.kt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/*
22
* © 2016-present FlowCrypt a.s. Limitations apply. Contact human@flowcrypt.com
3-
* Contributors: DenBond7
3+
* Contributors: denbond7
44
*/
55

66
package com.flowcrypt.email.matchers
77

8-
import android.graphics.drawable.ColorDrawable
98
import android.view.View
109
import androidx.test.espresso.matcher.BoundedMatcher
1110
import com.google.android.material.appbar.AppBarLayout
11+
import com.google.android.material.shape.MaterialShapeDrawable
1212
import org.hamcrest.Description
1313

1414
/**
@@ -17,9 +17,11 @@ import org.hamcrest.Description
1717
class AppBarLayoutBackgroundColorMatcher(val color: Int) :
1818
BoundedMatcher<View, AppBarLayout>(AppBarLayout::class.java) {
1919
public override fun matchesSafely(appBarLayout: AppBarLayout): Boolean {
20-
return if (appBarLayout.background is ColorDrawable) {
21-
color == (appBarLayout.background as ColorDrawable).color
22-
} else false
20+
return if (appBarLayout.background is MaterialShapeDrawable) {
21+
(appBarLayout.background as MaterialShapeDrawable).fillColor?.defaultColor == color
22+
} else {
23+
false
24+
}
2325
}
2426

2527
override fun describeTo(description: Description) {

FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/PublicKeyDetailsFlowTest.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import androidx.test.espresso.action.ViewActions.click
1616
import androidx.test.espresso.assertion.ViewAssertions.matches
1717
import androidx.test.espresso.intent.Intents.intending
1818
import androidx.test.espresso.intent.matcher.IntentMatchers
19+
import androidx.test.espresso.intent.matcher.IntentMatchers.hasCategories
1920
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
2021
import androidx.test.espresso.matcher.ViewMatchers.withId
2122
import androidx.test.espresso.matcher.ViewMatchers.withText
@@ -42,8 +43,6 @@ import com.flowcrypt.email.util.DateTimeUtil
4243
import com.flowcrypt.email.util.GeneralUtil
4344
import com.flowcrypt.email.util.PrivateKeysManager
4445
import com.flowcrypt.email.util.TestGeneralUtil
45-
import org.hamcrest.CoreMatchers
46-
import org.hamcrest.Matchers
4746
import org.hamcrest.Matchers.allOf
4847
import org.junit.AfterClass
4948
import org.junit.Rule
@@ -157,7 +156,7 @@ class PublicKeyDetailsFlowTest : BaseTest() {
157156
intending(
158157
allOf(
159158
IntentMatchers.hasAction(Intent.ACTION_CREATE_DOCUMENT),
160-
IntentMatchers.hasCategories(CoreMatchers.hasItem(Matchers.equalTo(Intent.CATEGORY_OPENABLE))),
159+
hasCategories(setOf(Intent.CATEGORY_OPENABLE)),
161160
IntentMatchers.hasType(Constants.MIME_TYPE_PGP_KEY)
162161
)
163162
)

FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/PublicKeyDetailsHideArmorMetaFlowTest.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,7 @@ import jakarta.mail.internet.InternetAddress
4949
import jakarta.mail.internet.MimeMessage
5050
import kotlinx.coroutines.runBlocking
5151
import org.bouncycastle.bcpg.ArmoredInputStream
52-
import org.hamcrest.CoreMatchers.hasItem
5352
import org.hamcrest.Matchers.allOf
54-
import org.hamcrest.Matchers.equalTo
5553
import org.junit.Assert.assertArrayEquals
5654
import org.junit.Rule
5755
import org.junit.Test
@@ -134,7 +132,7 @@ class PublicKeyDetailsHideArmorMetaFlowTest : BaseTest() {
134132
intending(
135133
allOf(
136134
hasAction(Intent.ACTION_CREATE_DOCUMENT),
137-
hasCategories(hasItem(equalTo(Intent.CATEGORY_OPENABLE))),
135+
hasCategories(setOf(Intent.CATEGORY_OPENABLE)),
138136
hasType(Constants.MIME_TYPE_PGP_KEY)
139137
)
140138
)

FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/RecipientsListFlowTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ class RecipientsListFlowTest : BaseRecipientsListTest() {
129129
onView(withId(R.id.menuSearch))
130130
.check(matches(isDisplayed()))
131131
.perform(click())
132-
onView(withId(com.google.android.material.R.id.search_src_text))
132+
onView(withId(getIdentifierByName("search_src_text")))
133133
.perform(clearText(), replaceText("00"))
134134
.perform(pressKey(KeyEvent.KEYCODE_ENTER))
135135
closeSoftKeyboard()

FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/SelectRecipientsFragmentFlowTest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* © 2016-present FlowCrypt a.s. Limitations apply. Contact human@flowcrypt.com
3-
* Contributors: DenBond7
3+
* Contributors: denbond7
44
*/
55

66
package com.flowcrypt.email.ui
@@ -115,15 +115,15 @@ class SelectRecipientsFragmentFlowTest : BaseTest() {
115115
onView(withId(R.id.menuSearch))
116116
.check(matches(isDisplayed()))
117117
.perform(click())
118-
onView(withId(com.google.android.material.R.id.search_src_text))
118+
onView(withId(getIdentifierByName("search_src_text")))
119119
.perform(clearText(), typeText("some email"))
120120
closeSoftKeyboard()
121121
onView(withId(R.id.tVEmpty))
122122
.check(matches(isDisplayed())).check(matches(withText(R.string.no_results)))
123123
}
124124

125125
private fun checkIsTypedUserFound(viewId: Int, viewText: String) {
126-
onView(withId(com.google.android.material.R.id.search_src_text))
126+
onView(withId(getIdentifierByName("search_src_text")))
127127
.perform(clearText(), typeText(viewText))
128128
closeSoftKeyboard()
129129
onView(withId(viewId))

0 commit comments

Comments
 (0)