Repo created
This commit is contained in:
parent
75dc487a7a
commit
39c29d175b
6317 changed files with 388324 additions and 2 deletions
27
app-k9mail/src/debug/AndroidManifest.xml
Normal file
27
app-k9mail/src/debug/AndroidManifest.xml
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
>
|
||||
|
||||
<application tools:ignore="MissingApplicationIcon">
|
||||
|
||||
<!-- This component is disabled by default (if possible). It will be enabled programmatically if necessary. -->
|
||||
<!-- IMPORTANT: The component name must be -->
|
||||
<!-- `net.thunderbird.feature.widget.message.list.MessageListWidgetReceiver` and can't be changed. -->
|
||||
<receiver
|
||||
android:name="net.thunderbird.feature.widget.message.list.MessageListWidgetReceiver"
|
||||
android:exported="true"
|
||||
android:label="@string/message_list_glance_widget_label"
|
||||
>
|
||||
<intent-filter>
|
||||
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
|
||||
</intent-filter>
|
||||
<meta-data
|
||||
android:name="android.appwidget.provider"
|
||||
android:resource="@xml/message_list_glance_widget_info"
|
||||
/>
|
||||
</receiver>
|
||||
|
||||
</application>
|
||||
</manifest>
|
||||
|
|
@ -0,0 +1,92 @@
|
|||
package app.k9mail.auth
|
||||
|
||||
import com.fsck.k9.BuildConfig
|
||||
import net.thunderbird.core.common.oauth.OAuthConfiguration
|
||||
import net.thunderbird.core.common.oauth.OAuthConfigurationFactory
|
||||
|
||||
@Suppress("ktlint:standard:max-line-length")
|
||||
class K9OAuthConfigurationFactory : OAuthConfigurationFactory {
|
||||
override fun createConfigurations(): Map<List<String>, OAuthConfiguration> {
|
||||
return mapOf(
|
||||
createAolConfiguration(),
|
||||
createFastmailConfiguration(),
|
||||
createGmailConfiguration(),
|
||||
createMicrosoftConfiguration(),
|
||||
createYahooConfiguration(),
|
||||
)
|
||||
}
|
||||
|
||||
private fun createAolConfiguration(): Pair<List<String>, OAuthConfiguration> {
|
||||
return listOf(
|
||||
"imap.aol.com",
|
||||
"smtp.aol.com",
|
||||
) to OAuthConfiguration(
|
||||
clientId = "dj0yJmk9cHYydkJkTUxHcXlYJmQ9WVdrOWVHZHhVVXN4VVV3bWNHbzlNQT09JnM9Y29uc3VtZXJzZWNyZXQmc3Y9MCZ4PTdm",
|
||||
scopes = listOf("mail-w"),
|
||||
authorizationEndpoint = "https://api.login.aol.com/oauth2/request_auth",
|
||||
tokenEndpoint = "https://api.login.aol.com/oauth2/get_token",
|
||||
redirectUri = "${BuildConfig.APPLICATION_ID}://oauth2redirect",
|
||||
)
|
||||
}
|
||||
|
||||
private fun createFastmailConfiguration(): Pair<List<String>, OAuthConfiguration> {
|
||||
return listOf(
|
||||
"imap.fastmail.com",
|
||||
"smtp.fastmail.com",
|
||||
) to OAuthConfiguration(
|
||||
clientId = "353641ae",
|
||||
scopes = listOf("https://www.fastmail.com/dev/protocol-imap", "https://www.fastmail.com/dev/protocol-smtp"),
|
||||
authorizationEndpoint = "https://api.fastmail.com/oauth/authorize",
|
||||
tokenEndpoint = "https://api.fastmail.com/oauth/refresh",
|
||||
redirectUri = "${BuildConfig.APPLICATION_ID}://oauth2redirect",
|
||||
)
|
||||
}
|
||||
|
||||
private fun createGmailConfiguration(): Pair<List<String>, OAuthConfiguration> {
|
||||
return listOf(
|
||||
"imap.gmail.com",
|
||||
"imap.googlemail.com",
|
||||
"smtp.gmail.com",
|
||||
"smtp.googlemail.com",
|
||||
) to OAuthConfiguration(
|
||||
clientId = "262622259280-5qb3vtj68d5dtudmaif4g9vd3cpar8r3.apps.googleusercontent.com",
|
||||
scopes = listOf("https://mail.google.com/"),
|
||||
authorizationEndpoint = "https://accounts.google.com/o/oauth2/v2/auth",
|
||||
tokenEndpoint = "https://oauth2.googleapis.com/token",
|
||||
redirectUri = "${BuildConfig.APPLICATION_ID}:/oauth2redirect",
|
||||
)
|
||||
}
|
||||
|
||||
private fun createMicrosoftConfiguration(): Pair<List<String>, OAuthConfiguration> {
|
||||
return listOf(
|
||||
"outlook.office365.com",
|
||||
"smtp.office365.com",
|
||||
"smtp-mail.outlook.com",
|
||||
) to OAuthConfiguration(
|
||||
clientId = "e647013a-ada4-4114-b419-e43d250f99c5",
|
||||
scopes = listOf(
|
||||
"openid",
|
||||
"email",
|
||||
"https://outlook.office.com/IMAP.AccessAsUser.All",
|
||||
"https://outlook.office.com/SMTP.Send",
|
||||
"offline_access",
|
||||
),
|
||||
authorizationEndpoint = "https://login.microsoftonline.com/common/oauth2/v2.0/authorize",
|
||||
tokenEndpoint = "https://login.microsoftonline.com/common/oauth2/v2.0/token",
|
||||
redirectUri = "msauth://com.fsck.k9.debug/VZF2DYuLYAu4TurFd6usQB2JPts%3D",
|
||||
)
|
||||
}
|
||||
|
||||
private fun createYahooConfiguration(): Pair<List<String>, OAuthConfiguration> {
|
||||
return listOf(
|
||||
"imap.mail.yahoo.com",
|
||||
"smtp.mail.yahoo.com",
|
||||
) to OAuthConfiguration(
|
||||
clientId = "dj0yJmk9ejRCRU1ybmZjQlVBJmQ9WVdrOVVrZEViak4xYmxZbWNHbzlNQT09JnM9Y29uc3VtZXJzZWNyZXQmc3Y9MCZ4PTZj",
|
||||
scopes = listOf("mail-w"),
|
||||
authorizationEndpoint = "https://api.login.yahoo.com/oauth2/request_auth",
|
||||
tokenEndpoint = "https://api.login.yahoo.com/oauth2/get_token",
|
||||
redirectUri = "${BuildConfig.APPLICATION_ID}://oauth2redirect",
|
||||
)
|
||||
}
|
||||
}
|
||||
17
app-k9mail/src/debug/kotlin/app/k9mail/dev/DebugConfig.kt
Normal file
17
app-k9mail/src/debug/kotlin/app/k9mail/dev/DebugConfig.kt
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
package app.k9mail.dev
|
||||
|
||||
import app.k9mail.autodiscovery.api.AutoDiscovery
|
||||
import app.k9mail.autodiscovery.demo.DemoAutoDiscovery
|
||||
import com.fsck.k9.backend.BackendFactory
|
||||
import org.koin.core.module.Module
|
||||
import org.koin.core.qualifier.named
|
||||
|
||||
fun Module.developmentModuleAdditions() {
|
||||
single { DemoBackendFactory(backendStorageFactory = get()) }
|
||||
single<Map<String, BackendFactory>>(named("developmentBackends")) {
|
||||
mapOf("demo" to get<DemoBackendFactory>())
|
||||
}
|
||||
single<List<AutoDiscovery>>(named("extraAutoDiscoveries")) {
|
||||
listOf(DemoAutoDiscovery())
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package app.k9mail.dev
|
||||
|
||||
import app.k9mail.backend.demo.DemoBackend
|
||||
import com.fsck.k9.backend.BackendFactory
|
||||
import com.fsck.k9.backend.api.Backend
|
||||
import com.fsck.k9.mailstore.K9BackendStorageFactory
|
||||
import net.thunderbird.core.android.account.LegacyAccount
|
||||
|
||||
class DemoBackendFactory(private val backendStorageFactory: K9BackendStorageFactory) : BackendFactory {
|
||||
override fun createBackend(account: LegacyAccount): Backend {
|
||||
val backendStorage = backendStorageFactory.createBackendStorage(account)
|
||||
return DemoBackend(backendStorage)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package app.k9mail.featureflag
|
||||
|
||||
import net.thunderbird.core.featureflag.FeatureFlag
|
||||
import net.thunderbird.core.featureflag.FeatureFlagFactory
|
||||
import net.thunderbird.core.featureflag.FeatureFlagKey
|
||||
import net.thunderbird.core.featureflag.toFeatureFlagKey
|
||||
|
||||
class K9FeatureFlagFactory : FeatureFlagFactory {
|
||||
override fun createFeatureCatalog(): List<FeatureFlag> {
|
||||
return listOf(
|
||||
FeatureFlag("archive_marks_as_read".toFeatureFlagKey(), enabled = true),
|
||||
FeatureFlag("new_account_settings".toFeatureFlagKey(), enabled = true),
|
||||
FeatureFlag("disable_font_size_config".toFeatureFlagKey(), enabled = true),
|
||||
FeatureFlag("email_notification_default".toFeatureFlagKey(), enabled = true),
|
||||
FeatureFlag("enable_dropdown_drawer".toFeatureFlagKey(), enabled = true),
|
||||
FeatureFlag("enable_dropdown_drawer_ui".toFeatureFlagKey(), enabled = true),
|
||||
FeatureFlag(FeatureFlagKey.DisplayInAppNotifications, enabled = true),
|
||||
FeatureFlag(FeatureFlagKey.UseNotificationSenderForSystemNotifications, enabled = true),
|
||||
)
|
||||
}
|
||||
}
|
||||
8
app-k9mail/src/debug/res/values/app_logo_colors.xml
Normal file
8
app-k9mail/src/debug/res/values/app_logo_colors.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="app_logo_main">#5917ff</color>
|
||||
<color name="app_logo_highlight_light">#7a45ff</color>
|
||||
<color name="app_logo_highlight_dark">#531ad8</color>
|
||||
|
||||
<color name="launcher_icon_background">#e3d9ff</color>
|
||||
</resources>
|
||||
Loading…
Add table
Add a link
Reference in a new issue