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

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

data_extraction_rules.xml58 lines · 3.0 KiBRaw
1<?xml version="1.0" encoding="utf-8"?>
2<!--
3 Flashcards. Audited state:
4 * databases/flashcards-db — Room DB holding decks, notes, cards and the
5 FSRS review schedule. The user's content; genuinely worth restoring.
6 * files/datastore_default.preferences_pb — app settings.
7 * files/media/ — card images referenced from note fields.
8 * shared_prefs/secure_prefs.xml — SQLCipher passphrase wrapped by the
9 non-exportable AndroidKeyStore key (db_no_auth_key).
10
11 flashcards-db is excluded from both sections below: it is SQLCipher-
12 encrypted under a passphrase wrapped by a key that never leaves the source
13 device, so a restored raw copy cannot be opened — the app mints a fresh key
14 and passphrase on the new device, the already-encrypted file is skipped by
15 the encrypt-on-open step, and Room then fails to open it. Shipping the raw
16 file would trade a clean first launch for a crash and no data.
17
18 The data still migrates: flashcards declares
19 android:backupAgent=".platform.AppBackupAgent", which uses SqlCipherDbCodec
20 to export the DB to plaintext inside the backup payload and re-encrypt it
21 under the new device's passphrase on restore, alongside the settings
22 datastore and the media directory.
23
24 SCOPE: because a backupAgent is declared (without fullBackupOnly), cloud
25 backup uses key/value backup and the <cloud-backup> section below is NOT
26 consulted; cloud content is exactly AppBackupAgent's payload. The rules
27 below govern <device-transfer>, and are the correct control if the
28 backupAgent is ever removed. disableIfNoEncryptionCapabilities stays on
29 <cloud-backup> for that fallback: card text can contain anything, and the
30 codec payload carries the database in plaintext.
31-->
32<data-extraction-rules>
33 <!-- Not consulted while android:backupAgent is declared; see SCOPE above. -->
34 <cloud-backup disableIfNoEncryptionCapabilities="true">
35 <include domain="root" path="." />
36 <include domain="file" path="." />
37 <include domain="database" path="." />
38 <exclude domain="database" path="flashcards-db" />
39 <exclude domain="database" path="flashcards-db-wal" />
40 <exclude domain="database" path="flashcards-db-shm" />
41 <exclude domain="database" path="flashcards-db-journal" />
42 <include domain="sharedpref" path="." />
43 <exclude domain="sharedpref" path="secure_prefs.xml" />
44 <include domain="external" path="." />
45 </cloud-backup>
46 <device-transfer>
47 <include domain="root" path="." />
48 <include domain="file" path="." />
49 <include domain="database" path="." />
50 <exclude domain="database" path="flashcards-db" />
51 <exclude domain="database" path="flashcards-db-wal" />
52 <exclude domain="database" path="flashcards-db-shm" />
53 <exclude domain="database" path="flashcards-db-journal" />
54 <include domain="sharedpref" path="." />
55 <exclude domain="sharedpref" path="secure_prefs.xml" />
56 <include domain="external" path="." />
57 </device-transfer>
58</data-extraction-rules>