diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index a9f24734ee..5ee4402859 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -1,5 +1,39 @@ + + + diff --git a/FlowCrypt/build.gradle.kts b/FlowCrypt/build.gradle.kts index 21455b434a..60b1d353a9 100644 --- a/FlowCrypt/build.gradle.kts +++ b/FlowCrypt/build.gradle.kts @@ -4,6 +4,10 @@ */ +import com.android.build.api.artifact.SingleArtifact +import com.android.build.api.variant.ResValue +import org.gradle.api.GradleException +import java.io.File import com.android.ddmlib.DdmPreferences import java.io.FileInputStream import java.text.SimpleDateFormat @@ -15,7 +19,6 @@ DdmPreferences.setTimeOut(10 * 60 * 1000) plugins { id("com.android.application") - id("kotlin-android") id("androidx.navigation.safeargs.kotlin") id("com.starter.easylauncher") id("kotlin-parcelize") @@ -30,7 +33,7 @@ if (propertiesFile.exists()) { } android { - compileSdk = extra["compileSdkVersion"] as Int + compileSdk = rootProject.extra["compileSdkVersion"] as Int namespace = "com.flowcrypt.email" defaultConfig { @@ -42,10 +45,10 @@ android { testInstrumentationRunnerArguments += mapOf("clearPackageData" to "true") applicationId = "com.flowcrypt.email" - minSdk = extra["minSdkVersion"] as Int - targetSdk = extra["targetSdkVersion"] as Int - versionCode = extra["appVersionCode"] as Int - versionName = extra["appVersionName"] as String + minSdk = rootProject.extra["minSdkVersion"] as Int + targetSdk = rootProject.extra["targetSdkVersion"] as Int + versionCode = rootProject.extra["appVersionCode"] as Int + versionName = rootProject.extra["appVersionName"] as String testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" buildConfigField("int", "MIN_SDK_VERSION", "$minSdk") multiDexEnabled = true @@ -191,6 +194,7 @@ android { buildFeatures { buildConfig = true viewBinding = true + resValues = true } packaging { @@ -264,23 +268,89 @@ ksp { } androidComponents { + beforeVariants { variantBuilder -> - if (variantBuilder.name in listOf("devRelease", "devUiTests")) { - // Gradle ignores any variants that satisfy the conditions above. + if (variantBuilder.name in setOf("devRelease", "devUiTests")) { println("INFO: Excluded \"${variantBuilder.name}\" from build variant list as unused") variantBuilder.enable = false } } + // --- Applies to ALL variants --- onVariants { variant -> - //we share applicationId as a res value + // Share applicationId as a res value variant.resValues.put( variant.makeResValueKey("string", "application_id"), - com.android.build.api.variant.ResValue(variant.applicationId.get()) + ResValue(variant.applicationId.get()) ) } + + val releaseSelector = selector().withBuildType("release") + + // --- Release-only tasks --- + onVariants(releaseSelector) { variant -> + val cap = variant.name.replaceFirstChar { it.uppercase() } + + // APK output directory provider + val apkDirProvider = variant.artifacts.get(SingleArtifact.APK) + + fun listApks(): List { + val dir = apkDirProvider.get().asFile + return dir.walkTopDown().filter { it.isFile && it.extension == "apk" }.toList() + } + + val checkTask = tasks.register("check${cap}ApkSize") { + doLast { + val apks = listApks() + if (apks.isEmpty()) { + throw GradleException("No APK files found in: ${apkDirProvider.get().asFile.absolutePath}") + } + + val maxExpected = 50L * 1024L * 1024L + apks.forEach { apk -> + val size = apk.length() + if (size > maxExpected) { + throw GradleException( + "Release APK is bigger than expected. max=$maxExpected, actual=$size, file=${apk.name}" + ) + } + } + } + } + + val renameTask = tasks.register("rename${cap}Builds") { + doLast { + val apks = listApks() + if (apks.isEmpty()) { + logger.lifecycle("No APK files found to rename in: ${apkDirProvider.get().asFile.absolutePath}") + return@doLast + } + + val ts = SimpleDateFormat("yyyy_MM_dd_HH_mm").format(Date()) + + // If multiple outputs exist (splits), versionCode/versionName can differ; + // fallback to defaultConfig if not available. + val vCode = + variant.outputs.singleOrNull()?.versionCode?.orNull ?: android.defaultConfig.versionCode + val vName = + variant.outputs.singleOrNull()?.versionName?.orNull ?: android.defaultConfig.versionName + + apks.forEach { apk -> + val newName = apk.name.removeSuffix(".apk") + "_${vCode}_${vName}_${ts}.apk" + val target = apk.parentFile.resolve(newName) + + if (!apk.renameTo(target)) { + throw GradleException("Failed to rename ${apk.absolutePath} -> ${target.absolutePath}") + } else { + logger.lifecycle("Renamed: ${apk.name} -> ${target.name}") + } + } + } + } + } } + easylauncher { buildTypes { register("debug") { @@ -345,44 +415,6 @@ tasks.register("checkCorrectBranch") { } } -tasks.register("checkReleaseBuildsSize") { - doLast { - android.applicationVariants.forEach { applicationVariant -> - if (applicationVariant.buildType.name == "release") { - applicationVariant.outputs.forEach { variantOutput -> - val apkFile = variantOutput.outputFile - //for now apk up to 50Mb is normal - val maxExpectedSizeInBytes = 50 * 1024 * 1024 - if (apkFile.length() > maxExpectedSizeInBytes) { - throw GradleException( - "The generated release build is bigger then expected: " + - "expected = not big then $maxExpectedSizeInBytes, actual = ${apkFile.length()}" - ) - } - } - } - } - } -} - -tasks.register("renameReleaseBuilds") { - doLast { - android.applicationVariants.forEach { applicationVariant -> - if (applicationVariant.buildType.name == "release") { - applicationVariant.outputs.forEach { variantOutput -> - val file = variantOutput.outputFile - val newName = file.name.replace( - ".apk", "_" + android.defaultConfig.versionCode + - "_" + android.defaultConfig.versionName + "_" - + SimpleDateFormat("yyyy_MM_dd_HH_mm").format(Date()) + ".apk" - ) - variantOutput.outputFile.renameTo(File(file.parent, newName)) - } - } - } - } -} - tasks.register("copyReleaseApks") { includeEmptyDirs = false diff --git a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/ComposeScreenExternalIntentsFlowTest.kt b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/ComposeScreenExternalIntentsFlowTest.kt index 2565059d82..dfbd40d7d4 100644 --- a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/ComposeScreenExternalIntentsFlowTest.kt +++ b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/ComposeScreenExternalIntentsFlowTest.kt @@ -1,6 +1,6 @@ /* * © 2016-present FlowCrypt a.s. Limitations apply. Contact human@flowcrypt.com - * Contributors: DenBond7 + * Contributors: denbond7 */ package com.flowcrypt.email.ui @@ -42,9 +42,6 @@ import okhttp3.mockwebserver.Dispatcher import okhttp3.mockwebserver.MockResponse import okhttp3.mockwebserver.RecordedRequest import org.hamcrest.Matchers.allOf -import org.hamcrest.Matchers.emptyString -import org.hamcrest.Matchers.`is` -import org.hamcrest.Matchers.not import org.junit.After import org.junit.Before import org.junit.Rule @@ -463,7 +460,8 @@ class ComposeScreenExternalIntentsFlowTest : BaseTest() { .check(matches(withText(getRidOfCharacterSubstitutes(body.toString())))) } else { onView(withId(R.id.editTextEmailMessage)) - .check(matches(isDisplayed())).check(matches(withText(`is`(emptyString())))) + .check(matches(isDisplayed())) + .check(matches(withText(""))) } } @@ -474,7 +472,8 @@ class ComposeScreenExternalIntentsFlowTest : BaseTest() { .check(matches(withText(getRidOfCharacterSubstitutes(subject)))) } else { onView(withId(R.id.editTextEmailSubject)) - .check(matches(isDisplayed())).check(matches(withText(`is`(emptyString())))) + .check(matches(isDisplayed())) + .check(matches(withText(""))) } } diff --git a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/ComposeScreenFlowTest.kt b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/ComposeScreenFlowTest.kt index 481e6695db..b465dfb00e 100644 --- a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/ComposeScreenFlowTest.kt +++ b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/ComposeScreenFlowTest.kt @@ -72,7 +72,6 @@ import org.apache.commons.io.FileUtils import org.hamcrest.Description import org.hamcrest.Matcher import org.hamcrest.Matchers.allOf -import org.hamcrest.Matchers.emptyString import org.hamcrest.Matchers.`is` import org.hamcrest.Matchers.not import org.junit.Assert.assertEquals @@ -152,7 +151,7 @@ class ComposeScreenFlowTest : BaseComposeScreenTest() { ) onView(withId(R.id.editTextEmailSubject)) .perform(scrollTo(), click(), typeText("subject"), clearText()) - .check(matches(withText(`is`(emptyString())))) + .check(matches(withText(""))) onView(withId(R.id.menuActionSend)) .check(matches(isDisplayed())) .perform(click()) @@ -177,7 +176,7 @@ class ComposeScreenFlowTest : BaseComposeScreenTest() { .perform(scrollTo(), click(), replaceText(EMAIL_SUBJECT)) onView(withId(R.id.editTextEmailMessage)) .perform(scrollTo(), click(), replaceText("")) - .check(matches(withText(`is`(emptyString())))) + .check(matches(withText(""))) Espresso.closeSoftKeyboard() onView(withId(R.id.menuActionSend)) .check(matches(isDisplayed())) @@ -259,13 +258,13 @@ class ComposeScreenFlowTest : BaseComposeScreenTest() { .check(matches(isDisplayed())) onView(withId(R.id.editTextFrom)) .perform(scrollTo()) - .check(matches(withText(not(`is`(emptyString()))))) + .check(matches(withText(not("")))) onView(withId(R.id.recyclerViewChipsTo)) .check(matches(isDisplayed())) .check(matches(withRecyclerViewItemCount(1))) onView(withId(R.id.editTextEmailSubject)) .perform(scrollTo()) - .check(matches(withText(`is`(emptyString())))) + .check(matches(withText(""))) } @Test @@ -921,7 +920,8 @@ class ComposeScreenFlowTest : BaseComposeScreenTest() { @get:ClassRule @JvmStatic - val mockWebServerRule = FlowCryptMockWebServerRule(TestConstants.MOCK_WEB_SERVER_PORT, + val mockWebServerRule = FlowCryptMockWebServerRule( + TestConstants.MOCK_WEB_SERVER_PORT, object : Dispatcher() { override fun dispatch(request: RecordedRequest): MockResponse { if (request.path?.startsWith("/attester/pub", ignoreCase = true) == true) { diff --git a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/SearchMessagesFlowTest.kt b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/SearchMessagesFlowTest.kt index b0cffddc5f..3af7fbb77d 100644 --- a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/SearchMessagesFlowTest.kt +++ b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/SearchMessagesFlowTest.kt @@ -1,6 +1,6 @@ /* * © 2016-present FlowCrypt a.s. Limitations apply. Contact human@flowcrypt.com - * Contributors: DenBond7 + * Contributors: denbond7 */ package com.flowcrypt.email.ui @@ -34,9 +34,7 @@ import com.flowcrypt.email.rules.RetryRule import com.flowcrypt.email.rules.ScreenshotTestRule import com.flowcrypt.email.ui.activity.MainActivity import com.flowcrypt.email.util.AccountDaoManager -import org.hamcrest.Matchers.`is` import org.hamcrest.Matchers.allOf -import org.hamcrest.Matchers.emptyString import org.hamcrest.Matchers.not import org.junit.Before import org.junit.Rule @@ -144,7 +142,7 @@ class SearchMessagesFlowTest : BaseTest() { onView(withId(androidx.appcompat.R.id.search_close_btn)) .perform(click()) onView(isAssignableFrom(EditText::class.java)) - .check(matches(withText(`is`(emptyString())))) + .check(matches(withText(""))) } companion object { diff --git a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/StandardReplyWithServiceInfoAndOneFileFlowTest.kt b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/StandardReplyWithServiceInfoAndOneFileFlowTest.kt index 2c8cc66fc7..13edcdfb06 100644 --- a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/StandardReplyWithServiceInfoAndOneFileFlowTest.kt +++ b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/StandardReplyWithServiceInfoAndOneFileFlowTest.kt @@ -1,6 +1,6 @@ /* * © 2016-present FlowCrypt a.s. Limitations apply. Contact human@flowcrypt.com - * Contributors: DenBond7 + * Contributors: denbond7 */ package com.flowcrypt.email.ui @@ -42,8 +42,6 @@ import com.flowcrypt.email.ui.activity.CreateMessageActivity import com.flowcrypt.email.util.AccountDaoManager import com.flowcrypt.email.util.TestGeneralUtil import org.hamcrest.Matchers.allOf -import org.hamcrest.Matchers.emptyString -import org.hamcrest.Matchers.`is` import org.hamcrest.Matchers.not import org.junit.Rule import org.junit.Test @@ -162,8 +160,11 @@ class StandardReplyWithServiceInfoAndOneFileFlowTest : BaseTest() { matches( allOf( isDisplayed(), - if (TextUtils.isEmpty(serviceInfo.systemMsg)) withText(`is`(emptyString())) - else withText(serviceInfo.systemMsg), + if (TextUtils.isEmpty(serviceInfo.systemMsg)) { + withText("") + } else { + withText(serviceInfo.systemMsg) + }, if (serviceInfo.isMsgEditable) isFocusable() else not(isFocusable()) ) ) diff --git a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/base/BasePassphraseFlowTest.kt b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/base/BasePassphraseFlowTest.kt index 030831e66d..7e21d710e0 100644 --- a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/base/BasePassphraseFlowTest.kt +++ b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/base/BasePassphraseFlowTest.kt @@ -1,6 +1,6 @@ /* * © 2016-present FlowCrypt a.s. Limitations apply. Contact human@flowcrypt.com - * Contributors: DenBond7 + * Contributors: denbond7 */ package com.flowcrypt.email.ui.base @@ -15,8 +15,6 @@ import androidx.test.espresso.matcher.ViewMatchers.isDisplayed import androidx.test.espresso.matcher.ViewMatchers.withId import androidx.test.espresso.matcher.ViewMatchers.withText import com.flowcrypt.email.R -import org.hamcrest.Matchers.emptyString -import org.hamcrest.Matchers.`is` import org.junit.Test /** @@ -102,6 +100,7 @@ abstract class BasePassphraseFlowTest : BaseCheckPassphraseOnFirstScreenFlowTest testShowRepeatingPassPhraseScreen() onView(withId(R.id.editTextKeyPasswordSecond)) - .check(matches(isDisplayed())).check(matches(withText(`is`(emptyString())))) + .check(matches(isDisplayed())) + .check(matches(withText(""))) } } diff --git a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/fragment/isolation/incontainer/AddOtherAccountFragmentInIsolationTest.kt b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/fragment/isolation/incontainer/AddOtherAccountFragmentInIsolationTest.kt index eab2bee12e..5fdf763705 100644 --- a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/fragment/isolation/incontainer/AddOtherAccountFragmentInIsolationTest.kt +++ b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/fragment/isolation/incontainer/AddOtherAccountFragmentInIsolationTest.kt @@ -35,7 +35,6 @@ import com.flowcrypt.email.ui.activity.fragment.AddOtherAccountFragment import com.flowcrypt.email.ui.base.AddOtherAccountBaseTest import com.flowcrypt.email.util.AuthCredentialsManager import org.hamcrest.Matchers.allOf -import org.hamcrest.Matchers.emptyString import org.hamcrest.Matchers.instanceOf import org.hamcrest.Matchers.`is` import org.hamcrest.Matchers.not @@ -95,12 +94,12 @@ class AddOtherAccountFragmentInIsolationTest : AddOtherAccountBaseTest() { @Test fun testIsPasswordFieldsAlwaysEmptyAtStart() { onView(withId(R.id.editTextPassword)) - .check(matches(withText(`is`(emptyString())))) + .check(matches(withText(""))) enableAdvancedMode() onView(withId(R.id.checkBoxRequireSignInForSmtp)) .perform(scrollTo(), click()) onView(withId(R.id.editTextSmtpPassword)) - .check(matches(withText(`is`(emptyString())))) + .check(matches(withText(""))) } @Test @@ -190,7 +189,8 @@ class AddOtherAccountFragmentInIsolationTest : AddOtherAccountBaseTest() { .check(matches(isDisplayed())) onView(withId(R.id.editTextSmtpPassword)) .perform(scrollTo()) - .check(matches(isDisplayed())).check(matches(withText(`is`(emptyString())))) + .check(matches(isDisplayed())) + .check(matches(withText(""))) onView(withId(R.id.checkBoxRequireSignInForSmtp)) .perform(scrollTo(), click()) @@ -217,13 +217,13 @@ class AddOtherAccountFragmentInIsolationTest : AddOtherAccountBaseTest() { .perform(scrollTo(), clearText(), typeText(invalidEmailAddress), closeSoftKeyboard()) onView(withId(R.id.editTextUserName)) .perform(scrollTo()) - .check(matches(withText(`is`(emptyString())))) + .check(matches(withText(""))) onView(withId(R.id.editTextImapServer)) .perform(scrollTo()) - .check(matches(withText(`is`(emptyString())))) + .check(matches(withText(""))) onView(withId(R.id.editTextSmtpServer)) .perform(scrollTo()) - .check(matches(withText(`is`(emptyString())))) + .check(matches(withText(""))) } val text = userName + TestConstants.COMMERCIAL_AT_SYMBOL + host diff --git a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/fragment/isolation/incontainer/CreatePrivateKeySecondFragmentInIsolationTest.kt b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/fragment/isolation/incontainer/CreatePrivateKeySecondFragmentInIsolationTest.kt index b1572d6ea5..97d34eac1d 100644 --- a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/fragment/isolation/incontainer/CreatePrivateKeySecondFragmentInIsolationTest.kt +++ b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/fragment/isolation/incontainer/CreatePrivateKeySecondFragmentInIsolationTest.kt @@ -1,6 +1,6 @@ /* * © 2016-present FlowCrypt a.s. Limitations apply. Contact human@flowcrypt.com - * Contributors: DenBond7 + * Contributors: denbond7 */ package com.flowcrypt.email.ui.fragment.isolation.incontainer @@ -24,8 +24,6 @@ import com.flowcrypt.email.ui.activity.fragment.CreatePrivateKeySecondFragment import com.flowcrypt.email.ui.activity.fragment.CreatePrivateKeySecondFragmentArgs import com.flowcrypt.email.ui.base.AddAccountToDatabaseRuleInterface import com.flowcrypt.email.util.AccountDaoManager -import org.hamcrest.Matchers.emptyString -import org.hamcrest.Matchers.`is` import org.junit.Before import org.junit.Rule import org.junit.Test @@ -64,7 +62,7 @@ class CreatePrivateKeySecondFragmentInIsolationTest : BaseTest(), onView(withId(R.id.textViewSecondPasswordCheckTitle)) .check(matches(withText(getResString(R.string.set_up_flow_crypt, getResString(R.string.app_name))))) onView(withId(R.id.editTextKeyPasswordSecond)) - .check(matches(withText(`is`(emptyString())))) + .check(matches(withText(""))) onView(withId(R.id.buttonConfirmPassPhrases)) .perform(click()) diff --git a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/fragment/isolation/incontainer/EditContactFragmentInIsolationTest.kt b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/fragment/isolation/incontainer/EditContactFragmentInIsolationTest.kt index 3f7fb92b40..04a6604212 100644 --- a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/fragment/isolation/incontainer/EditContactFragmentInIsolationTest.kt +++ b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/fragment/isolation/incontainer/EditContactFragmentInIsolationTest.kt @@ -17,7 +17,6 @@ import androidx.test.filters.MediumTest import com.flowcrypt.email.R import com.flowcrypt.email.base.BaseTest import com.flowcrypt.email.database.entity.PublicKeyEntity -import com.flowcrypt.email.junit.annotations.DependsOnMailServer import com.flowcrypt.email.junit.annotations.FlowCryptTestSettings import com.flowcrypt.email.rules.AddPrivateKeyToDatabaseRule import com.flowcrypt.email.rules.ClearAppSettingsRule @@ -27,10 +26,6 @@ import com.flowcrypt.email.rules.ScreenshotTestRule import com.flowcrypt.email.ui.activity.fragment.EditContactFragment import com.flowcrypt.email.ui.activity.fragment.EditContactFragmentArgs import com.flowcrypt.email.ui.base.AddAccountToDatabaseRuleInterface -import org.hamcrest.CoreMatchers.`is` -import org.hamcrest.CoreMatchers.startsWith -import org.hamcrest.Matchers -import org.hamcrest.Matchers.emptyString import org.junit.Before import org.junit.Rule import org.junit.Test @@ -75,7 +70,7 @@ class EditContactFragmentInIsolationTest : BaseTest(), AddAccountToDatabaseRuleI Thread.sleep(1000) onView(withId(R.id.editTextNewPubKey)) - .check(matches(withText(`is`(emptyString())))) + .check(matches(withText(""))) onView(withId(R.id.buttonCheck)) .check(matches(isNotEnabled())) diff --git a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/fragment/isolation/incontainer/ImportRecipientsFromSourceFragmentInIsolationTest.kt b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/fragment/isolation/incontainer/ImportRecipientsFromSourceFragmentInIsolationTest.kt index 75ae59fa6c..a2347863f7 100644 --- a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/fragment/isolation/incontainer/ImportRecipientsFromSourceFragmentInIsolationTest.kt +++ b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/fragment/isolation/incontainer/ImportRecipientsFromSourceFragmentInIsolationTest.kt @@ -21,10 +21,6 @@ import com.flowcrypt.email.rules.RetryRule import com.flowcrypt.email.rules.ScreenshotTestRule import com.flowcrypt.email.ui.activity.fragment.ImportRecipientsFromSourceFragment import com.flowcrypt.email.ui.base.AddAccountToDatabaseRuleInterface -import org.hamcrest.CoreMatchers -import org.hamcrest.CoreMatchers.`is` -import org.hamcrest.Matchers -import org.hamcrest.Matchers.emptyString import org.junit.Before import org.junit.Rule import org.junit.Test @@ -60,6 +56,6 @@ class ImportRecipientsFromSourceFragmentInIsolationTest : BaseTest(), Thread.sleep(1000) onView(withId(R.id.eTKeyIdOrEmail)) - .check(matches(withText(`is`(emptyString())))) + .check(matches(withText(""))) } } \ No newline at end of file diff --git a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/fragment/isolation/incontainer/ServerSettingsFragmentInIsolationTest.kt b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/fragment/isolation/incontainer/ServerSettingsFragmentInIsolationTest.kt index 37b9454ca8..04c42227f0 100644 --- a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/fragment/isolation/incontainer/ServerSettingsFragmentInIsolationTest.kt +++ b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/fragment/isolation/incontainer/ServerSettingsFragmentInIsolationTest.kt @@ -23,8 +23,6 @@ import com.flowcrypt.email.rules.RetryRule import com.flowcrypt.email.rules.ScreenshotTestRule import com.flowcrypt.email.ui.activity.fragment.ServerSettingsFragment import com.flowcrypt.email.ui.base.AddAccountToDatabaseRuleInterface -import org.hamcrest.Matchers.emptyString -import org.hamcrest.Matchers.`is` import org.junit.Before import org.junit.Rule import org.junit.Test @@ -66,7 +64,7 @@ class ServerSettingsFragmentInIsolationTest : BaseTest(), AddAccountToDatabaseRu .check(matches(isNotEnabled())) .check(matches(withText(account.username))) onView(withId(R.id.editTextPassword)) - .check(matches(withText(`is`(emptyString())))) + .check(matches(withText(""))) onView(withId(R.id.editTextImapServer)) .check(matches(withText(account.imapServer))) onView(withId(R.id.editTextImapPort)) @@ -81,6 +79,6 @@ class ServerSettingsFragmentInIsolationTest : BaseTest(), AddAccountToDatabaseRu onView(withId(R.id.editTextSmtpUsername)) .check(matches(withText(account.smtpUsername))) onView(withId(R.id.editTextSmtpPassword)) - .check(matches(withText(`is`(emptyString())))) + .check(matches(withText(""))) } } diff --git a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/fragment/isolation/incontainer/SignatureSettingsFragmentFirstRunInIsolationTest.kt b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/fragment/isolation/incontainer/SignatureSettingsFragmentFirstRunInIsolationTest.kt index 5001197e16..a8e2a0e8de 100644 --- a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/fragment/isolation/incontainer/SignatureSettingsFragmentFirstRunInIsolationTest.kt +++ b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/fragment/isolation/incontainer/SignatureSettingsFragmentFirstRunInIsolationTest.kt @@ -1,14 +1,12 @@ /* * © 2016-present FlowCrypt a.s. Limitations apply. Contact human@flowcrypt.com - * Contributors: DenBond7 + * Contributors: denbond7 */ package com.flowcrypt.email.ui.fragment.isolation.incontainer import androidx.test.espresso.Espresso.onView -import androidx.test.espresso.action.ViewActions.click import androidx.test.espresso.assertion.ViewAssertions.matches -import androidx.test.espresso.matcher.ViewMatchers.isDisplayed import androidx.test.espresso.matcher.ViewMatchers.withId import androidx.test.espresso.matcher.ViewMatchers.withText import androidx.test.ext.junit.runners.AndroidJUnit4 @@ -16,8 +14,6 @@ import androidx.test.filters.MediumTest import com.flowcrypt.email.R import com.flowcrypt.email.base.BaseTest import com.flowcrypt.email.junit.annotations.FlowCryptTestSettings -import com.flowcrypt.email.matchers.CustomMatchers.Companion.withEmptyRecyclerView -import com.flowcrypt.email.matchers.CustomMatchers.Companion.withRecyclerViewItemCount import com.flowcrypt.email.rules.AddAccountToDatabaseRule import com.flowcrypt.email.rules.AddPrivateKeyToDatabaseRule import com.flowcrypt.email.rules.ClearAppSettingsRule @@ -25,9 +21,6 @@ import com.flowcrypt.email.rules.GrantPermissionRuleChooser import com.flowcrypt.email.rules.RetryRule import com.flowcrypt.email.rules.ScreenshotTestRule import com.flowcrypt.email.ui.activity.fragment.SignatureSettingsFragment -import org.hamcrest.Matchers.emptyString -import org.hamcrest.Matchers.`is` -import org.hamcrest.Matchers.not import org.junit.Rule import org.junit.Test import org.junit.rules.RuleChain @@ -62,6 +55,6 @@ class SignatureSettingsFragmentFirstRunInIsolationTest : BaseTest() { ) onView(withId(R.id.editTextSignature)) - .check(matches(withText(`is`(emptyString())))) + .check(matches(withText(""))) } } diff --git a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/fragment/isolation/incontainer/SignatureSettingsFragmentNonEmptyAliasSignatureRunInIsolationTest.kt b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/fragment/isolation/incontainer/SignatureSettingsFragmentNonEmptyAliasSignatureRunInIsolationTest.kt index af5b1714a9..571a7a6cd0 100644 --- a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/fragment/isolation/incontainer/SignatureSettingsFragmentNonEmptyAliasSignatureRunInIsolationTest.kt +++ b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/fragment/isolation/incontainer/SignatureSettingsFragmentNonEmptyAliasSignatureRunInIsolationTest.kt @@ -1,13 +1,12 @@ /* * © 2016-present FlowCrypt a.s. Limitations apply. Contact human@flowcrypt.com - * Contributors: DenBond7 + * Contributors: denbond7 */ package com.flowcrypt.email.ui.fragment.isolation.incontainer import androidx.test.espresso.Espresso.onView import androidx.test.espresso.action.ViewActions.click -import androidx.test.espresso.assertion.ViewAssertions.doesNotExist import androidx.test.espresso.assertion.ViewAssertions.matches import androidx.test.espresso.matcher.ViewMatchers.isChecked import androidx.test.espresso.matcher.ViewMatchers.isDisplayed @@ -32,8 +31,6 @@ import com.flowcrypt.email.rules.ScreenshotTestRule import com.flowcrypt.email.ui.activity.fragment.SignatureSettingsFragment import com.flowcrypt.email.util.AccountDaoManager import com.flowcrypt.email.util.UIUtil -import org.hamcrest.Matchers.emptyString -import org.hamcrest.Matchers.`is` import org.hamcrest.Matchers.not import org.junit.Rule import org.junit.Test @@ -113,7 +110,7 @@ class SignatureSettingsFragmentNonEmptyAliasSignatureRunInIsolationTest : BaseTe ) onView(withId(R.id.editTextSignature)) - .check(matches(withText(`is`(emptyString())))) + .check(matches(withText(""))) onView(withId(R.id.switchUseGmailAliases)) .check(matches(isChecked())) diff --git a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/fragment/isolation/incontainer/UpdatePrivateKeyFragmentInIsolationTest.kt b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/fragment/isolation/incontainer/UpdatePrivateKeyFragmentInIsolationTest.kt index 53d8d4433b..f90b23b7d8 100644 --- a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/fragment/isolation/incontainer/UpdatePrivateKeyFragmentInIsolationTest.kt +++ b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/fragment/isolation/incontainer/UpdatePrivateKeyFragmentInIsolationTest.kt @@ -5,13 +5,13 @@ package com.flowcrypt.email.ui.fragment.isolation.incontainer -import androidx.test.espresso.Espresso -import androidx.test.espresso.Espresso.* +import androidx.test.espresso.Espresso.onView import androidx.test.espresso.action.ViewActions -import androidx.test.espresso.assertion.ViewAssertions -import androidx.test.espresso.assertion.ViewAssertions.* -import androidx.test.espresso.matcher.ViewMatchers -import androidx.test.espresso.matcher.ViewMatchers.* +import androidx.test.espresso.assertion.ViewAssertions.matches +import androidx.test.espresso.matcher.ViewMatchers.isEnabled +import androidx.test.espresso.matcher.ViewMatchers.isNotEnabled +import androidx.test.espresso.matcher.ViewMatchers.withId +import androidx.test.espresso.matcher.ViewMatchers.withText import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.MediumTest import com.flowcrypt.email.R @@ -22,21 +22,15 @@ import com.flowcrypt.email.rules.ClearAppSettingsRule import com.flowcrypt.email.rules.GrantPermissionRuleChooser import com.flowcrypt.email.rules.RetryRule import com.flowcrypt.email.rules.ScreenshotTestRule -import com.flowcrypt.email.security.pgp.PgpKey import com.flowcrypt.email.ui.activity.fragment.UpdatePrivateKeyFragment import com.flowcrypt.email.ui.activity.fragment.UpdatePrivateKeyFragmentArgs import com.flowcrypt.email.ui.base.AddAccountToDatabaseRuleInterface -import org.hamcrest.CoreMatchers -import org.hamcrest.CoreMatchers.* -import org.hamcrest.Matchers -import org.hamcrest.Matchers.emptyString import org.junit.Before import org.junit.Rule import org.junit.Test import org.junit.rules.RuleChain import org.junit.rules.TestRule import org.junit.runner.RunWith -import org.pgpainless.key.info.KeyRingInfo /** * @author Denys Bondarenko @@ -72,7 +66,7 @@ class UpdatePrivateKeyFragmentInIsolationTest : BaseTest(), AddAccountToDatabase Thread.sleep(1000) onView(withId(R.id.editTextNewPrivateKey)) - .check(matches(withText(`is`(emptyString())))) + .check(matches(withText(""))) onView(withId(R.id.buttonCheck)) .check(matches(isNotEnabled())) diff --git a/build.gradle.kts b/build.gradle.kts index 66f0dbc371..baf5d4e9b8 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -4,17 +4,13 @@ */ // Top-level build file where you can add configuration options common to all sub-projects/modules. +apply(from = "$rootDir/ext.gradle.kts") plugins { - id("com.android.application") version "8.13.2" apply false - id("org.jetbrains.kotlin.android") version "2.3.0" apply false + id("com.android.application") version "9.0.0" apply false id("androidx.navigation.safeargs.kotlin") version "2.9.6" apply false id("com.starter.easylauncher") version "6.4.1" apply false id("org.jetbrains.kotlin.plugin.parcelize") version "2.3.0" apply false id("com.google.devtools.ksp") version "2.3.4" apply false id("org.ajoberstar.grgit") version "5.3.3" apply false } - -subprojects { - apply(from = "$rootDir/ext.gradle.kts") -} diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index d7a18bace7..768e4fe167 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -5,6 +5,6 @@ #Sat Aug 16 14:50:01 EEST 2025 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.0-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists