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

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

data_extraction_rules.xml75 lines · 4.2 KiBRaw
1<?xml version="1.0" encoding="utf-8"?>
2<!-- Overrides the permissive default in the shared :library module.
3
4 Storage audited:
5 database/passwords-db AppDatabase (Conversation/Message/Memory,
6 PendingToolCall, AuditRecord): the full
7 conversation history plus remembered facts.
8 Free-form user text, so it can contain
9 anything. SQLCipher-encrypted.
10 file/datastore_default.preferences_pb the user's editable system
11 prompt, plus model download progress and
12 version markers (progress_*, dlid_*). The
13 markers are meaningless without the models;
14 the prompt is real user data.
15 external/ on-demand model downloads in
16 getExternalFilesDir(null): the gemma4/ model
17 files. Gigabytes, and re-downloadable.
18 cache/ recordings and attachment scratch files;
19 Android never backs up cacheDir. Message
20 imagePaths point into cacheDir, so restored
21 messages can reference already-gone scratch
22 images; the conversation text is unaffected.
23 sharedpref/secure_prefs keystore-wrapped SQLCipher passphrase.
24
25 passwords-db is excluded from both sections for the same reason as
26 weather-db: it is SQLCipher ciphertext under a passphrase wrapped by a
27 non-exportable AndroidKeyStore key. That key never leaves the device,
28 so a restored copy of this file cannot be opened on a new device and
29 would crash Room on first launch. The conversations still migrate:
30 the declared BackupAgent (platform/AppBackupAgent) uses
31 SqlCipherDbCodec to export the database to plaintext inside the
32 backup payload and re-encrypt it under the new device's key on
33 restore. That path is the one that works; a raw file copy would only
34 get in its way, on both the cloud and the device-to-device channel.
35
36 SCOPE: openassistant declares android:backupAgent=
37 ".platform.AppBackupAgent" and does NOT set android:fullBackupOnly,
38 so Android uses key/value backup here and the <cloud-backup> section
39 below is NOT consulted. Cloud content is exactly AppBackupAgent's
40 payload: the codec-exported database plus datastore_default. The
41 rules below govern <device-transfer>, and are the correct control if
42 the backupAgent is ever removed. Model files stay out of every
43 channel because they are gigabytes and re-downloadable.
44-->
45<data-extraction-rules>
46 <!-- Not consulted while android:backupAgent is declared; see SCOPE above. -->
47 <cloud-backup>
48 <include domain="root" path="." />
49 <include domain="file" path="." />
50 <include domain="database" path="." />
51 <exclude domain="database" path="passwords-db" />
52 <exclude domain="database" path="passwords-db-wal" />
53 <exclude domain="database" path="passwords-db-shm" />
54 <exclude domain="database" path="passwords-db-journal" />
55 <include domain="sharedpref" path="." />
56 <exclude domain="sharedpref" path="secure_prefs.xml" />
57 <include domain="external" path="." />
58 <!-- Model downloads: gigabytes and re-downloadable. -->
59 <exclude domain="external" path="gemma4" />
60 </cloud-backup>
61 <device-transfer>
62 <include domain="root" path="." />
63 <include domain="file" path="." />
64 <include domain="database" path="." />
65 <exclude domain="database" path="passwords-db" />
66 <exclude domain="database" path="passwords-db-wal" />
67 <exclude domain="database" path="passwords-db-shm" />
68 <exclude domain="database" path="passwords-db-journal" />
69 <include domain="sharedpref" path="." />
70 <exclude domain="sharedpref" path="secure_prefs.xml" />
71 <include domain="external" path="." />
72 <!-- Model downloads: gigabytes and re-downloadable. -->
73 <exclude domain="external" path="gemma4" />
74 </device-transfer>
75</data-extraction-rules>