forked from thunderbird/thunderbird-android
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
1,025 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package app.k9mail.dev | ||
|
||
import org.koin.core.module.Module | ||
import org.koin.core.scope.Scope | ||
|
||
fun Scope.developmentBackends() = mapOf( | ||
"demo" to get<DemoBackendFactory>() | ||
) | ||
|
||
fun Module.developmentModuleAdditions() { | ||
single { DemoBackendFactory(backendStorageFactory = get()) } | ||
} |
14 changes: 14 additions & 0 deletions
14
app/k9mail/src/debug/java/app/k9mail/dev/DemoBackendFactory.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package app.k9mail.dev | ||
|
||
import app.k9mail.backend.demo.DemoBackend | ||
import com.fsck.k9.Account | ||
import com.fsck.k9.backend.BackendFactory | ||
import com.fsck.k9.backend.api.Backend | ||
import com.fsck.k9.mailstore.K9BackendStorageFactory | ||
|
||
class DemoBackendFactory(private val backendStorageFactory: K9BackendStorageFactory) : BackendFactory { | ||
override fun createBackend(account: Account): Backend { | ||
val backendStorage = backendStorageFactory.createBackendStorage(account) | ||
return DemoBackend(backendStorage) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package app.k9mail.dev | ||
|
||
import com.fsck.k9.backend.BackendFactory | ||
import org.koin.core.module.Module | ||
import org.koin.core.scope.Scope | ||
|
||
fun Scope.developmentBackends() = emptyMap<String, BackendFactory>() | ||
|
||
fun Module.developmentModuleAdditions() = Unit |
27 changes: 27 additions & 0 deletions
27
app/ui/legacy/src/debug/java/com/fsck/k9/ui/settings/ExtraAccountDiscovery.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.fsck.k9.ui.settings | ||
|
||
import com.fsck.k9.mail.AuthType | ||
import com.fsck.k9.mail.ConnectionSecurity | ||
import com.fsck.k9.mail.ServerSettings | ||
import com.fsck.k9.ui.ConnectionSettings | ||
|
||
object ExtraAccountDiscovery { | ||
@JvmStatic | ||
fun discover(email: String): ConnectionSettings? { | ||
return if (email.endsWith("@k9mail.example")) { | ||
val serverSettings = ServerSettings( | ||
type = "demo", | ||
host = "irrelevant", | ||
port = 23, | ||
connectionSecurity = ConnectionSecurity.SSL_TLS_REQUIRED, | ||
authenticationType = AuthType.AUTOMATIC, | ||
username = "irrelevant", | ||
password = "irrelevant", | ||
clientCertificateAlias = null | ||
) | ||
ConnectionSettings(incoming = serverSettings, outgoing = serverSettings) | ||
} else { | ||
null | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
app/ui/legacy/src/release/java/com/fsck/k9/ui/settings/ExtraAccountDiscovery.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.fsck.k9.ui.settings | ||
|
||
import com.fsck.k9.ui.ConnectionSettings | ||
|
||
object ExtraAccountDiscovery { | ||
@JvmStatic | ||
fun discover(email: String): ConnectionSettings? = null | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
apply plugin: 'com.android.library' | ||
apply plugin: 'org.jetbrains.kotlin.android' | ||
apply plugin: 'kotlin-kapt' | ||
|
||
if (rootProject.testCoverage) { | ||
apply plugin: 'jacoco' | ||
} | ||
|
||
dependencies { | ||
api project(":backend:api") | ||
|
||
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:${versions.kotlinCoroutines}" | ||
implementation "com.jakewharton.timber:timber:${versions.timber}" | ||
implementation "com.squareup.moshi:moshi:${versions.moshi}" | ||
kapt "com.squareup.moshi:moshi-kotlin-codegen:${versions.moshi}" | ||
|
||
testImplementation project(":mail:testing") | ||
testImplementation "junit:junit:${versions.junit}" | ||
testImplementation "org.mockito:mockito-core:${versions.mockito}" | ||
testImplementation "com.google.truth:truth:${versions.truth}" | ||
} | ||
|
||
android { | ||
compileSdkVersion buildConfig.compileSdk | ||
buildToolsVersion buildConfig.buildTools | ||
|
||
defaultConfig { | ||
minSdkVersion buildConfig.minSdk | ||
} | ||
|
||
buildTypes { | ||
debug { | ||
testCoverageEnabled rootProject.testCoverage | ||
} | ||
} | ||
|
||
lintOptions { | ||
abortOnError false | ||
lintConfig file("$rootProject.projectDir/config/lint/lint.xml") | ||
} | ||
|
||
compileOptions { | ||
sourceCompatibility javaVersion | ||
targetCompatibility javaVersion | ||
} | ||
|
||
kotlinOptions { | ||
jvmTarget = kotlinJvmVersion | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest package="app.k9mail.backend.demo" /> |
Oops, something went wrong.