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

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

data_extraction_rules.xml69 lines · 3.7 KiBRaw
1<?xml version="1.0" encoding="utf-8"?>
2<!--
3 Notes. Audited state:
4 * databases/notes-db — Room DB holding the user's notes. SQLCipher-encrypted
5 under a passphrase wrapped by a non-exportable AndroidKeyStore key
6 (secure_prefs / db_no_auth_key), so a file copy of it can never be opened
7 on another device. databases/passwords-db is the same story: it is the
8 legacy name the app reads once and deletes in MainActivity.
9 * files/note_images/ — content-addressed images embedded in notes.
10 * files/datastore_default.preferences_pb — app settings.
11 * files/wear-notes-snapshot.json + wear-notes-pending.json — the watch
12 experience's local store (derived snapshot + unreflected watch ops).
13 * shared_prefs/secure_prefs.xml — the keystore-wrapped DB passphrase.
14
15 Both databases and secure_prefs are excluded from both sections: the
16 wrapping key never leaves the old device, so a restored copy is ciphertext
17 the new device cannot open and Room fails on first launch instead of
18 starting cleanly.
19
20 The notes still migrate: notes declares its own BackupAgent
21 (platform/AppBackupAgent), which uses SqlCipherDbCodec to export the DB to
22 plaintext inside the key/value backup payload and re-encrypt it under the
23 new device's passphrase on restore. That path also carries
24 datastore_default and note_images. The rules below govern device transfer
25 (where note_images, settings and the watch store travel by file copy and
26 the databases deliberately do not), and are the correct control if the
27 backupAgent is ever removed.
28
29 SCOPE: notes declares android:backupAgent=".platform.AppBackupAgent" and
30 does NOT set android:fullBackupOnly, so Android uses key/value backup here
31 and the <cloud-backup> section below is NOT consulted. Cloud content is
32 exactly AppBackupAgent's payload: notes-db exported to plaintext by
33 SqlCipherDbCodec, datastore_default, and note_images.
34-->
35<data-extraction-rules>
36 <!-- Not consulted while android:backupAgent is declared; see SCOPE above. -->
37 <cloud-backup disableIfNoEncryptionCapabilities="true">
38 <include domain="root" path="." />
39 <include domain="file" path="." />
40 <include domain="database" path="." />
41 <exclude domain="database" path="notes-db" />
42 <exclude domain="database" path="notes-db-wal" />
43 <exclude domain="database" path="notes-db-shm" />
44 <exclude domain="database" path="notes-db-journal" />
45 <exclude domain="database" path="passwords-db" />
46 <exclude domain="database" path="passwords-db-wal" />
47 <exclude domain="database" path="passwords-db-shm" />
48 <exclude domain="database" path="passwords-db-journal" />
49 <include domain="sharedpref" path="." />
50 <exclude domain="sharedpref" path="secure_prefs.xml" />
51 <include domain="external" path="." />
52 </cloud-backup>
53 <device-transfer>
54 <include domain="root" path="." />
55 <include domain="file" path="." />
56 <include domain="database" path="." />
57 <exclude domain="database" path="notes-db" />
58 <exclude domain="database" path="notes-db-wal" />
59 <exclude domain="database" path="notes-db-shm" />
60 <exclude domain="database" path="notes-db-journal" />
61 <exclude domain="database" path="passwords-db" />
62 <exclude domain="database" path="passwords-db-wal" />
63 <exclude domain="database" path="passwords-db-shm" />
64 <exclude domain="database" path="passwords-db-journal" />
65 <include domain="sharedpref" path="." />
66 <exclude domain="sharedpref" path="secure_prefs.xml" />
67 <include domain="external" path="." />
68 </device-transfer>
69</data-extraction-rules>