Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
71c5654
Updated some libs.| #1048
DenBond7 Mar 1, 2021
3332d59
Added mavenCentral() as repositories.| #1036
DenBond7 Mar 1, 2021
41994df
Updated some libs. Part 2.| #1048
DenBond7 Mar 1, 2021
1682e49
Disabled restarting EmailManagerActivity after switch to a new accoun…
DenBond7 Mar 1, 2021
f1489eb
Reschedule SyncWorker after switch to a new account.| #1010
DenBond7 Mar 1, 2021
2bef5c4
Fixed the logout issue.| #1010
DenBond7 Mar 1, 2021
281f5ac
Added a logic to rerun some CoroutineWorker if an active account was …
DenBond7 Mar 1, 2021
b4346b9
Set Android 8.0(API level 26) as minSdkVersion. Refactored code.| #1044
DenBond7 Mar 2, 2021
fa62a06
Fixed a bug in FoldersManager.getSortedNames()
DenBond7 Mar 4, 2021
62a32ce
Excluded CancellationException from the ACRA reports
DenBond7 Mar 4, 2021
1dc036f
Fixed ConcurrentModificationException in EncryptPrivateKeysIfNeededAc…
DenBond7 Mar 5, 2021
47be2b7
Merge branch 'drop_android_7' into 1.1.6
DenBond7 Mar 5, 2021
d4505e9
Fixed tests filters
DenBond7 Mar 5, 2021
fef9ed1
Modified icons to fit https://developer.android.com/google-play/resou…
DenBond7 Mar 5, 2021
e1a1316
Dropped 'easylauncher' plugin due to don't support vectors.| #1063
DenBond7 Mar 5, 2021
3a60ded
Added 'easylauncher-gradle-plugin' plugin to support vectors for ribb…
DenBond7 Mar 9, 2021
22755a4
Modified lint.xml
DenBond7 Mar 9, 2021
0e6a547
Switched to use 'bouncycastle' instead of 'spongycastle'. Added 'pgpa…
DenBond7 Mar 9, 2021
e09a014
Fixed lint warnings.| #1068
DenBond7 Mar 9, 2021
334a1c1
Updated easylauncher to 3.10.1.| #1068
DenBond7 Mar 9, 2021
b2cd17e
Added printing Java version in semaphore.yml.| #1068
DenBond7 Mar 9, 2021
e31bb7a
Changed semaphore CI settings.| #1068
DenBond7 Mar 10, 2021
bac9126
Modified ci-install-android-sdk.sh.| #1068
DenBond7 Mar 10, 2021
c1d3bed
Migrated to use CertificateFactory.getInstance("X.509") instead of Ce…
DenBond7 Mar 3, 2021
c1f1d4e
Added threads sync in NodeRetrofitHelper.| #1068
DenBond7 Mar 10, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ global_job_config:
value: /home/semaphore/Android/Sdk
prologue:
commands:
- export PATH=${ANDROID_SDK_ROOT}/emulator:${ANDROID_SDK_ROOT}/tools:${ANDROID_SDK_ROOT}/tools/bin:${ANDROID_SDK_ROOT}/platform-tools:${PATH}
- export PATH=${ANDROID_SDK_ROOT}/emulator:${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin:${ANDROID_SDK_ROOT}/platform-tools:${PATH}
- sudo rm -rf ~/.rbenv ~/.phpbrew
- checkout
# restore global caches
Expand Down Expand Up @@ -51,6 +51,7 @@ blocks:
- name: 'Build Project'
commands:
- cat /proc/cpuinfo # print debug info
- java -version # print Java version
- ./gradlew assembleDevTestDebug # compile project
- ./script/ci-lint-checks.sh # run Lint checks
epilogue:
Expand Down
34 changes: 21 additions & 13 deletions FlowCrypt/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: "androidx.navigation.safeargs.kotlin"
apply plugin: 'com.akaita.android.easylauncher'
apply plugin: "com.starter.easylauncher"

def keystoreProperties = new Properties()
File propertiesFile = project.file("keystore.properties")
Expand Down Expand Up @@ -239,12 +239,15 @@ android {

lintOptions {
warningsAsErrors true
//we disable 'IconLauncherShape' to prevent fails because of use easylauncher
disable 'NullSafeMutableLiveData', 'IconLauncherShape'
}

packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENSE.md'
exclude 'META-INF/NOTICE.md'
exclude 'META-INF/*.SF'
exclude 'META-INF/*.DSA'
exclude 'META-INF/*.RSA'
}

testOptions {
Expand Down Expand Up @@ -300,28 +303,26 @@ android {
}

easylauncher {
iconNames "@mipmap/ic_launcher_foreground"
foregroundIconNames "@mipmap/ic_launcher_foreground" // Foreground of adaptive launcher icon
buildTypes {
debug {
filters = [
customColorRibbonFilter("debug", "#556600CC", "#FFFFFF", "top")
customRibbon(ribbonColor: "#6600CC", labelColor: "#FFFFFF", position: "top")
]
}
}

variants {
devDebug {
filters = [
customColorRibbonFilter("dev", "#55CC5F00", "#FFFFFF", "top")
customRibbon(label: "dev", ribbonColor: "#CC5F00", labelColor: "#FFFFFF", position: "top")
]
}
}
}

dependencies {
kapt "com.github.bumptech.glide:compiler:${rootProject.ext.glideVersion}"
kapt "androidx.annotation:annotation:${rootProject.ext.androidxBaseVersion}"
kapt 'androidx.annotation:annotation:1.1.0'
kapt "androidx.room:room-compiler:$roomVersion"

debugImplementation "com.squareup.leakcanary:leakcanary-android:${rootProject.ext.leakcanaryVersion}"
Expand Down Expand Up @@ -356,12 +357,12 @@ dependencies {
implementation "androidx.cardview:cardview:${rootProject.ext.androidxBaseVersion}"
implementation 'androidx.browser:browser:1.3.0'
implementation "androidx.recyclerview:recyclerview:${rootProject.ext.recyclerViewVersion}"
implementation "androidx.recyclerview:recyclerview-selection:${rootProject.ext.recyclerViewVersion}-rc03"
implementation "androidx.recyclerview:recyclerview-selection:${rootProject.ext.recyclerViewVersion}"
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation "androidx.test.espresso:espresso-idling-resource:${rootProject.ext.espressoVersion}"
implementation "androidx.lifecycle:lifecycle-extensions:${rootProject.ext.lifecycleVersion}"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:${rootProject.ext.lifecycleVersion}"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:${rootProject.ext.lifecycleVersion}"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.3.0"
implementation "androidx.room:room-runtime:$roomVersion"
implementation "androidx.room:room-ktx:$roomVersion"
implementation "androidx.paging:paging-runtime-ktx:$pagingVersion"
Expand Down Expand Up @@ -396,6 +397,7 @@ dependencies {
implementation "com.squareup.leakcanary:leakcanary-object-watcher-android:${rootProject.ext.leakcanaryVersion}"

implementation "com.sun.mail:android-mail:${rootProject.ext.javaMailVersion}"
implementation "com.sun.mail:android-activation:${rootProject.ext.javaMailVersion}"
implementation("com.sun.mail:gimap:${rootProject.ext.javaMailVersion}") {
//exclude group: 'com.sun.mail' because it exists in 'com.sun.mail:android-mail'
exclude group: 'com.sun.mail'
Expand All @@ -404,13 +406,19 @@ dependencies {
implementation "com.github.bumptech.glide:glide:${rootProject.ext.glideVersion}"
implementation 'com.hootsuite.android:nachos:1.2.0'
implementation 'com.nulab-inc:zxcvbn:1.4.0'
implementation 'com.madgag.spongycastle:pkix:1.54.0.0'
implementation 'com.madgag.spongycastle:pg:1.54.0.0'
implementation 'commons-io:commons-io:2.8.0'
implementation 'ch.acra:acra:4.11.1'
implementation 'ja.burhanrashid52:photoeditor:1.1.0'
implementation "org.jetbrains.kotlin:kotlin-reflect:1.4.31"
implementation 'net.openid:appauth:0.7.1-14-ged7e194'
implementation 'net.openid:appauth:0.8.0'
implementation 'org.bitbucket.b_c:jose4j:0.7.6'
implementation 'me.everything:overscroll-decor-android:1.1.0'

implementation ('org.pgpainless:pgpainless-core:0.2.0-alpha8') {
//exclude group: 'org.bouncycastle' because we will specify it manually
exclude group: 'org.bouncycastle'
}

implementation "org.bouncycastle:bcpg-jdk15on:${rootProject.ext.bouncycastleVersion}"
implementation "org.bouncycastle:bcpkix-jdk15on:${rootProject.ext.bouncycastleVersion}"
}
3 changes: 2 additions & 1 deletion FlowCrypt/lint.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
~ © 2016-present FlowCrypt a.s. Limitations apply. Contact human@flowcrypt.com
~ Contributors: DenBond7
-->

<!--https://developer.android.com/studio/write/lint#pref-->
<lint>
<!-- Disable the given check in this project -->
<issue id="InvalidPackage">
Expand All @@ -14,6 +14,7 @@
<issue id="TrustAllX509TrustManager">
<!-- Those issues are not relevant to our project, we can skip them -->
<ignore path="**/SslUtils$1.class" />
<ignore path="**/JcaJceUtils**" />
</issue>
<issue id="UnusedResources">
<!-- This file is needed for debug purposes -->
Expand Down
8 changes: 4 additions & 4 deletions FlowCrypt/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,10 @@
-keep interface org.w3c.dom.** { *; }
-dontwarn org.w3c.dom.**

########################################## SPONGYCASTLE ###############################################################
-keep class org.spongycastle.** { *; }
-keep interface org.spongycastle.** { *; }
-dontwarn org.spongycastle.**
########################################## BOUNCYCASTLE ###############################################################
-keep class org.bouncycastle.** { *; }
-keep interface org.bouncycastle.** { *; }
-dontwarn org.bouncycastle.**

########################################## Play services ##############################################################
-dontnote com.google.android.gms.**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,10 @@ import org.junit.runner.RunWith
@RunWith(AndroidJUnit4::class)
class DebugTestingTest {
@Test
@DoesNotNeedMailserver
@ReadyForCIAnnotation
fun alwaysSuccessTest() {
}

@Test
@DoesNotNeedMailserver
@ReadyForCIAnnotation
fun alwaysSuccessTestSecond() {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ import org.junit.runner.Description
* E-mail: DenBond7@gmail.com
*/
class DependsOnMailServerFilter : ReadyForCIFilter() {
override fun shouldRun(description: Description?): Boolean {
return description?.isTest == false || (super.shouldRun(description) && description?.getAnnotation(DoesNotNeedMailserver::class.java) == null)
override fun evaluateTest(description: Description?): Boolean {
val annotationClass = DoesNotNeedMailserver::class.java
val hasClassAnnotation = description?.testClass?.isAnnotationPresent(annotationClass) == true
if (hasClassAnnotation) return false
return super.evaluateTest(description) && description?.getAnnotation(annotationClass) == null
}

override fun describe() = "Filter tests that depend on an email server"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ import org.junit.runner.Description
* E-mail: DenBond7@gmail.com
*/
class DoesNotNeedMailServerFilter : ReadyForCIFilter() {
override fun shouldRun(description: Description?): Boolean {
return description?.isTest == false || (super.shouldRun(description) && description?.getAnnotation(DoesNotNeedMailserver::class.java) != null)
override fun evaluateTest(description: Description?): Boolean {
val annotationClass = DoesNotNeedMailserver::class.java
return super.evaluateTest(description)
&& (description?.testClass?.isAnnotationPresent(annotationClass) == true
|| description?.getAnnotation(annotationClass) != null)
}

override fun describe() = "Filter tests that don't need an email server"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@

package com.flowcrypt.email.junit.filters

import androidx.test.internal.runner.filters.ParentFilter
import org.junit.runner.Description
import org.junit.runner.manipulation.Filter

/**
* @author Denis Bondarenko
* Date: 2/18/21
* Time: 10:42 AM
* E-mail: DenBond7@gmail.com
*/
class OtherTestsFilter : Filter() {
class OtherTestsFilter : ParentFilter() {
private val dependsOnMailServerFilter = DependsOnMailServerFilter()
private val doesNotNeedMailServerFilter = DoesNotNeedMailServerFilter()

override fun shouldRun(description: Description?): Boolean {
return description?.isTest == false || (!dependsOnMailServerFilter.shouldRun(description) && !doesNotNeedMailServerFilter.shouldRun(description))
override fun evaluateTest(description: Description?): Boolean {
return (!dependsOnMailServerFilter.shouldRun(description) && !doesNotNeedMailServerFilter.shouldRun(description))
}

override fun describe() = "Filter tests that are not related to any conditions"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,20 @@

package com.flowcrypt.email.junit.filters

import androidx.test.internal.runner.filters.ParentFilter
import com.flowcrypt.email.ReadyForCIAnnotation
import org.junit.runner.Description
import org.junit.runner.manipulation.Filter

/**
* @author Denis Bondarenko
* Date: 2/17/21
* Time: 5:24 PM
* E-mail: DenBond7@gmail.com
*/
open class ReadyForCIFilter : Filter() {
override fun shouldRun(description: Description?): Boolean {
return description?.getAnnotation(ReadyForCIAnnotation::class.java) != null
open class ReadyForCIFilter : ParentFilter() {
override fun evaluateTest(description: Description?): Boolean {
val annotationClass = ReadyForCIAnnotation::class.java
return (description?.testClass?.isAnnotationPresent(annotationClass) == true || description?.getAnnotation(annotationClass) != null)
}

override fun describe() = "Filter tests that are ready to be run on a CI server"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import androidx.test.ext.junit.rules.activityScenarioRule
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.MediumTest
import androidx.test.platform.app.InstrumentationRegistry
import com.flowcrypt.email.CICandidateAnnotation
import com.flowcrypt.email.DoesNotNeedMailserver
import com.flowcrypt.email.R
import com.flowcrypt.email.ReadyForCIAnnotation
Expand Down Expand Up @@ -99,7 +100,7 @@ class SignInActivityEnterpriseTest : BaseSignActivityTest() {
}

@Test
@ReadyForCIAnnotation
@CICandidateAnnotation
fun testNoPrvCreateRule() {
setupAndClickSignInButton(genMockGoogleSignInAccountJson(EMAIL_WITH_NO_PRV_CREATE_RULE))
intended(hasComponent(CreateOrImportKeyActivity::class.java.name))
Expand Down
1 change: 0 additions & 1 deletion FlowCrypt/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:networkSecurityConfig="@xml/network_security_config"
android:roundIcon="@mipmap/ic_launcher"
android:supportsRtl="true"
android:theme="@style/AppTheme.NoActionBar"
tools:replace="android:allowBackup">
Expand Down
Binary file added FlowCrypt/src/main/ic_launcher-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed FlowCrypt/src/main/ic_launcher-web.png
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -234,25 +234,19 @@ class FoldersManager constructor(val account: String) {
val sortedList = arrayOfNulls<String>(localFolders.size)

val inbox = folderInbox?.let {
localFolders.remove(it)
sortedList[0] = it.folderAlias
it
}

folderTrash?.let {
localFolders.remove(it)
sortedList[localFolders.size + 1] = it.folderAlias
it
}

folderSpam?.let {
localFolders.remove(it)
sortedList[localFolders.size + 1] = it.folderAlias
val moveFolder = fun(localFolder: LocalFolder) {
sortedList[localFolders.size] = localFolder.folderAlias
localFolders.remove(localFolder)
}

folderOutbox?.let {
localFolders.remove(it)
sortedList[localFolders.size + 1] = it.folderAlias
}
folderTrash?.let { moveFolder(it) }
folderSpam?.let { moveFolder(it) }
folderOutbox?.let { moveFolder(it) }

for (i in localFolders.indices) {
val localFolder = localFolders[i]
Expand Down
Loading