Modern Apps git
git clone https://git.maproj.org/Modern-Apps.git
translate ▾

Modern-Apps.git / todo / src / main / res / xml / data_extraction_rules.xml

data_extraction_rules.xml68 lines · 3.5 KiBRaw
1<?xml version="1.0" encoding="utf-8"?>
2<!--
3 Todo. Audited state:
4 * databases/todo-db — Room DB holding the user's tasks, lists and
5 sync snapshots (genuinely worth restoring).
6 * files/datastore_default.preferences_pb — TodoSettings (default
7 view/sort, digest, calendar mirror) via the shared DataStoreUtils.
8 * shared_prefs/secure_prefs.xml — SQLCipher passphrase wrapped by a
9 non-exportable AndroidKeyStore key.
10 * shared_prefs/todo_reminders.xml — scheduled-alarm bookkeeping;
11 ReminderScheduler.reconcile rebuilds it from the tasks, so it is
12 regenerable either way.
13 * files/wear-todo-*.json — the watch-side catalog/page/pending-op
14 cache. The phone is the source of truth and republishes it, so it
15 needs no protection of its own here.
16
17 todo-db is excluded from both sections: it is SQLCipher-encrypted
18 under a passphrase wrapped by a non-exportable AndroidKeystore key.
19 That key never leaves the device, so a restored raw copy of this file
20 cannot be opened — the repository mints a fresh key and passphrase,
21 and Room would fail on the already-encrypted file. Shipping it would
22 trade a clean first launch for an undecryptable database.
23
24 The tasks still migrate: todo declares its own BackupAgent, which
25 uses SqlCipherDbCodec to export the DB to plaintext inside the backup
26 payload and re-encrypt it under the new device's key on restore. That
27 path is the one that works; the raw file copy would only get in its
28 way. secure_prefs.xml is excluded for the same reason — it is only
29 meaningful with the old device's keystore key, and the new device
30 mints its own passphrase on first launch.
31
32 SCOPE: todo declares android:backupAgent=".platform.AppBackupAgent"
33 and does NOT set android:fullBackupOnly, so Android uses key/value
34 backup here and the <cloud-backup> section below is NOT consulted.
35 Cloud content is exactly AppBackupAgent's payload: todo-db exported
36 to plaintext by SqlCipherDbCodec plus datastore_default. The rules
37 below govern <device-transfer>, and are the correct control if the
38 backupAgent is ever removed (in that case the settings and other
39 plaintext files still migrate, and the database is recreated empty
40 rather than restored undecryptable).
41-->
42<data-extraction-rules>
43 <!-- Not consulted while android:backupAgent is declared; see SCOPE above. -->
44 <cloud-backup>
45 <include domain="root" path="." />
46 <include domain="file" path="." />
47 <include domain="database" path="." />
48 <exclude domain="database" path="todo-db" />
49 <exclude domain="database" path="todo-db-wal" />
50 <exclude domain="database" path="todo-db-shm" />
51 <exclude domain="database" path="todo-db-journal" />
52 <include domain="sharedpref" path="." />
53 <exclude domain="sharedpref" path="secure_prefs.xml" />
54 <include domain="external" path="." />
55 </cloud-backup>
56 <device-transfer>
57 <include domain="root" path="." />
58 <include domain="file" path="." />
59 <include domain="database" path="." />
60 <exclude domain="database" path="todo-db" />
61 <exclude domain="database" path="todo-db-wal" />
62 <exclude domain="database" path="todo-db-shm" />
63 <exclude domain="database" path="todo-db-journal" />
64 <include domain="sharedpref" path="." />
65 <exclude domain="sharedpref" path="secure_prefs.xml" />
66 <include domain="external" path="." />
67 </device-transfer>
68</data-extraction-rules>