backup: add module scaffold and build wiring
- Commit
9cec55ff9f3b36ef343886d108a2e4abefcbac16- Author
- Vayun Mathur <[email protected]>
- When
- 2026-08-12 18:52 UTC (3 months ago)
- Parents
b1cf44d
Diff
backup/build.gradle.kts
diff --git a/backup/build.gradle.kts b/backup/build.gradle.ktsnew file mode 100644index 0000000000..5b39a220e4--- /dev/null+++ b/backup/build.gradle.kts@@ -0,0 +1,29 @@+plugins {+ id("common-conventions-app")+ // Listing screenshots come from Compose previews (src/screenshotTest), not from an+ // instrumented test on a device. Same `:backup:metadata` task name either way.+ id("common-conventions-preview-metadata")+}++launcherIcon {+ symbol = "backup"+}++android {+ defaultConfig {+ applicationId = "com.vayunmathur.backup"+ }+}++dependencies {+ // WebDAV/Nextcloud remote reaches the server over the platform HTTP stack.+ implementation(project(":library:network"))+ // Scheduled file/media backups.+ implementation(project(":library:work"))+ // Optional biometric gate for the recovery code / master key.+ implementation(project(":library:biometric"))+ // AES-256-GCM segment crypto (aesEncrypt/aesDecrypt, newContentKey).+ implementation(project(":library:e2ee-p2p"))+ // Local config (backend uri/creds handle, enabled sets, last-run).+ implementation(libs.androidx.datastore.preferences)+}
backup/src/main/AndroidManifest.xml
diff --git a/backup/src/main/AndroidManifest.xml b/backup/src/main/AndroidManifest.xmlnew file mode 100644index 0000000000..baf0cf9707--- /dev/null+++ b/backup/src/main/AndroidManifest.xml@@ -0,0 +1,24 @@+<?xml version="1.0" encoding="utf-8"?>+<manifest xmlns:android="http://schemas.android.com/apk/res/android">++ <application+ android:allowBackup="true"+ android:dataExtractionRules="@xml/data_extraction_rules"+ android:icon="@mipmap/ic_launcher"+ android:label="@string/app_name"+ android:roundIcon="@mipmap/ic_launcher"+ android:supportsRtl="true"+ android:theme="@style/Theme.General">+ <activity+ android:configChanges="mcc|mnc|colorMode|density|fontScale|fontWeightAdjustment|keyboard|keyboardHidden|layoutDirection|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode"+ android:name=".MainActivity"+ android:exported="true"+ android:theme="@style/Theme.General">+ <intent-filter>+ <action android:name="android.intent.action.MAIN" />+ <category android:name="android.intent.category.LAUNCHER" />+ </intent-filter>+ </activity>+ </application>++</manifest>
backup/src/main/java/com/vayunmathur/backup/MainActivity.kt
diff --git a/backup/src/main/java/com/vayunmathur/backup/MainActivity.kt b/backup/src/main/java/com/vayunmathur/backup/MainActivity.ktnew file mode 100644index 0000000000..5325849632--- /dev/null+++ b/backup/src/main/java/com/vayunmathur/backup/MainActivity.kt@@ -0,0 +1,20 @@+package com.vayunmathur.backup++import android.os.Bundle+import androidx.activity.ComponentActivity+import androidx.activity.compose.setContent+import androidx.activity.enableEdgeToEdge+import com.vayunmathur.backup.ui.BackupApp+import com.vayunmathur.library.ui.DynamicTheme++class MainActivity : ComponentActivity() {+ override fun onCreate(savedInstanceState: Bundle?) {+ super.onCreate(savedInstanceState)+ enableEdgeToEdge()+ setContent {+ DynamicTheme {+ BackupApp()+ }+ }+ }+}
backup/src/main/java/com/vayunmathur/backup/ui/BackupApp.kt
diff --git a/backup/src/main/java/com/vayunmathur/backup/ui/BackupApp.kt b/backup/src/main/java/com/vayunmathur/backup/ui/BackupApp.ktnew file mode 100644index 0000000000..8c7f0991e6--- /dev/null+++ b/backup/src/main/java/com/vayunmathur/backup/ui/BackupApp.kt@@ -0,0 +1,36 @@+package com.vayunmathur.backup.ui++import androidx.compose.foundation.layout.Arrangement+import androidx.compose.foundation.layout.Column+import androidx.compose.foundation.layout.fillMaxWidth+import androidx.compose.foundation.layout.padding+import androidx.compose.runtime.Composable+import androidx.compose.ui.Modifier+import androidx.compose.ui.unit.dp+import com.vayunmathur.library.ui.AppScaffold+import com.vayunmathur.library.ui.Card+import com.vayunmathur.library.ui.MaterialTheme+import com.vayunmathur.library.ui.Text++@Composable+fun BackupApp() {+ AppScaffold(title = "Backup") { padding ->+ Column(+ modifier = Modifier+ .fillMaxWidth()+ .padding(padding)+ .padding(16.dp),+ verticalArrangement = Arrangement.spacedBy(16.dp),+ ) {+ Card(modifier = Modifier.fillMaxWidth()) {+ Column(+ modifier = Modifier.padding(16.dp).fillMaxWidth(),+ verticalArrangement = Arrangement.spacedBy(4.dp),+ ) {+ Text("Encrypted backup", style = MaterialTheme.typography.titleMedium)+ Text("Set up an encrypted backup destination to get started.")+ }+ }+ }+ }+}
backup/src/main/res/values/strings.xml
diff --git a/backup/src/main/res/values/strings.xml b/backup/src/main/res/values/strings.xmlnew file mode 100644index 0000000000..dc0e705ee3--- /dev/null+++ b/backup/src/main/res/values/strings.xml@@ -0,0 +1,4 @@+<?xml version="1.0" encoding="utf-8"?>+<resources>+ <string name="app_name">Backup</string>+</resources>
backup/src/main/res/xml/data_extraction_rules.xml
diff --git a/backup/src/main/res/xml/data_extraction_rules.xml b/backup/src/main/res/xml/data_extraction_rules.xmlnew file mode 100644index 0000000000..81a97e0f26--- /dev/null+++ b/backup/src/main/res/xml/data_extraction_rules.xml@@ -0,0 +1,17 @@+<?xml version="1.0" encoding="utf-8"?>+<data-extraction-rules>+ <cloud-backup>+ <include domain="root" path="." />+ <include domain="file" path="." />+ <include domain="database" path="." />+ <include domain="sharedpref" path="." />+ <include domain="external" path="." />+ </cloud-backup>+ <device-transfer>+ <include domain="root" path="." />+ <include domain="file" path="." />+ <include domain="database" path="." />+ <include domain="sharedpref" path="." />+ <include domain="external" path="." />+ </device-transfer>+</data-extraction-rules>
settings.gradle.kts
diff --git a/settings.gradle.kts b/settings.gradle.ktsindex 1e7d4edee1..7cf7a49c4f 100644--- a/settings.gradle.kts+++ b/settings.gradle.kts@@ -97,6 +97,7 @@ include(":measure") include(":taxi") include(":communicate") include(":euicc")+include(":backup") // Personal / private app modules live under personal/ (gitignored). Included only // when present so the public repo still configures without them.