commit
initial commit
diff --git a/email/build.gradle.kts b/email/build.gradle.kts
new file mode 100644
index 0000000..95d192b
--- /dev/null
+++ b/email/build.gradle.kts
@@ -0,0 +1,53 @@
+import java.util.Properties
+
+plugins {
+ id("com.android.application")
+}
+
+// Signing details live in keystore.properties (not committed). Without it the
+// release build is left unsigned.
+val keystoreProps = Properties().apply {
+ val f = rootProject.file("keystore.properties")
+ if (f.exists()) f.inputStream().use { load(it) }
+}
+
+android {
+ namespace = "gay.doughmination.mail"
+ compileSdk = 35
+
+ defaultConfig {
+ applicationId = "gay.doughmination.mail"
+ minSdk = 23
+ targetSdk = 35
+ // CI passes the run number so every build installs over the last one.
+ versionCode = (System.getenv("VERSION_CODE") ?: "1").toInt()
+ versionName = System.getenv("VERSION_NAME") ?: "1.0"
+ }
+
+ signingConfigs {
+ if (keystoreProps.isNotEmpty()) {
+ create("release") {
+ storeFile = rootProject.file(keystoreProps.getProperty("storeFile"))
+ storePassword = keystoreProps.getProperty("storePassword")
+ keyAlias = keystoreProps.getProperty("keyAlias")
+ keyPassword = keystoreProps.getProperty("keyPassword")
+ }
+ }
+ }
+
+ buildTypes {
+ release {
+ isMinifyEnabled = false
+ signingConfig = signingConfigs.findByName("release")
+ }
+ }
+
+ compileOptions {
+ sourceCompatibility = JavaVersion.VERSION_17
+ targetCompatibility = JavaVersion.VERSION_17
+ }
+}
+
+dependencies {
+ implementation("com.google.androidbrowserhelper:androidbrowserhelper:2.5.0")
+}
diff --git a/email/src/main/AndroidManifest.xml b/email/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..ac116c7
--- /dev/null
+++ b/email/src/main/AndroidManifest.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- A Trusted Web Activity: the app is the live site at launch_url, shown
+ full-screen in Chrome once assetlinks.json on the site matches our key. -->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
+
+ <application
+ android:allowBackup="true"
+ android:icon="@mipmap/ic_launcher"
+ android:label="@string/app_name"
+ android:theme="@android:style/Theme.Translucent.NoTitleBar">
+
+ <meta-data
+ android:name="asset_statements"
+ android:resource="@string/asset_statements" />
+
+ <activity
+ android:name="com.google.androidbrowserhelper.trusted.LauncherActivity"
+ android:exported="true"
+ android:label="@string/app_name">
+ <meta-data
+ android:name="android.support.customtabs.trusted.DEFAULT_URL"
+ android:value="@string/launch_url" />
+ <meta-data
+ android:name="android.support.customtabs.trusted.STATUS_BAR_COLOR"
+ android:resource="@color/background" />
+ <meta-data
+ android:name="android.support.customtabs.trusted.NAVIGATION_BAR_COLOR"
+ android:resource="@color/background" />
+ <meta-data
+ android:name="android.support.customtabs.trusted.FALLBACK_STRATEGY"
+ android:value="customtabs" />
+
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+
+ <!-- Open mail.doughmination.gay links in the app. -->
+ <intent-filter android:autoVerify="true">
+ <action android:name="android.intent.action.VIEW" />
+ <category android:name="android.intent.category.DEFAULT" />
+ <category android:name="android.intent.category.BROWSABLE" />
+ <data android:scheme="https" android:host="mail.doughmination.gay" />
+ </intent-filter>
+ </activity>
+
+ <activity android:name="com.google.androidbrowserhelper.trusted.FocusActivity" />
+
+ <!-- Lets Chrome hand the site's Web Push notifications to the app, so
+ they show up under "Inbox" rather than under Chrome. -->
+ <service
+ android:name="com.google.androidbrowserhelper.trusted.DelegationService"
+ android:enabled="true"
+ android:exported="true">
+ <meta-data
+ android:name="android.support.customtabs.trusted.SMALL_ICON"
+ android:resource="@drawable/ic_notification" />
+ <intent-filter>
+ <action android:name="android.support.customtabs.trusted.TRUSTED_WEB_ACTIVITY_SERVICE" />
+ <category android:name="android.intent.category.DEFAULT" />
+ </intent-filter>
+ </service>
+ </application>
+</manifest>
diff --git a/email/src/main/res/drawable/ic_notification.xml b/email/src/main/res/drawable/ic_notification.xml
new file mode 100644
index 0000000..aa39160
--- /dev/null
+++ b/email/src/main/res/drawable/ic_notification.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Status bar icon: a plain white envelope (Android only uses the alpha). -->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24"
+ android:viewportHeight="24">
+ <path
+ android:fillColor="#FFFFFFFF"
+ android:pathData="M4,4h16c1.1,0 2,0.9 2,2v12c0,1.1 -0.9,2 -2,2H4c-1.1,0 -2,-0.9 -2,-2V6c0,-1.1 0.9,-2 2,-2zM20,8l-8,5 -8,-5v-2l8,5 8,-5z" />
+</vector>
diff --git a/email/src/main/res/mipmap-hdpi/ic_launcher.png b/email/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 0000000..54bbf2c
Binary files /dev/null and b/email/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/email/src/main/res/mipmap-mdpi/ic_launcher.png b/email/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 0000000..7bcb162
Binary files /dev/null and b/email/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/email/src/main/res/mipmap-xhdpi/ic_launcher.png b/email/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..6018003
Binary files /dev/null and b/email/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/email/src/main/res/mipmap-xxhdpi/ic_launcher.png b/email/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..a32a162
Binary files /dev/null and b/email/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/email/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/email/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 0000000..6e68d97
Binary files /dev/null and b/email/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/email/src/main/res/values/colors.xml b/email/src/main/res/values/colors.xml
new file mode 100644
index 0000000..0e3ceb1
--- /dev/null
+++ b/email/src/main/res/values/colors.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <color name="background">#0B0A0D</color>
+</resources>
diff --git a/email/src/main/res/values/strings.xml b/email/src/main/res/values/strings.xml
new file mode 100644
index 0000000..1e3a54b
--- /dev/null
+++ b/email/src/main/res/values/strings.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="app_name">Inbox</string>
+ <string name="launch_url" translatable="false">https://mail.doughmination.gay/inbox</string>
+ <string name="asset_statements" translatable="false">
+ [{
+ \"relation\": [\"delegate_permission/common.handle_all_urls\"],
+ \"target\": {\"namespace\": \"web\", \"site\": \"https://mail.doughmination.gay\"}
+ }]
+ </string>
+</resources>