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

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

data_extraction_rules.xml62 lines · 3.1 KiBRaw
1<?xml version="1.0" encoding="utf-8"?>
2<!--
3 Travel. Audited state:
4 * databases/travel-db — Room DB with RecentSearch, BookedTrip, FrequentFlyer
5 and Customer entities (trips and passenger profiles: the user data that
6 must survive a restore).
7 * secure_prefs.xml — SQLCipher passphrase for that DB, wrapped by a
8 non-exportable AndroidKeyStore key.
9 * filesDir/datastore_default.preferences_pb — shared DataStore UI
10 preferences.
11
12 travel-db is excluded from both sections as a raw file: it is
13 SQLCipher-encrypted under a passphrase wrapped by a hardware-bound
14 AndroidKeyStore key that never backs up, so a restored raw copy cannot be
15 opened on the new device (a fresh key/passphrase is minted and Room fails
16 with SQLiteNotADatabaseException). secure_prefs.xml is excluded for the
17 same reason — restoring the wrapped passphrase without its KeyStore key
18 is useless and would block minting a fresh one cleanly.
19
20 The trips still migrate: travel declares
21 android:backupAgent=".platform.AppBackupAgent", which uses
22 SqlCipherDbCodec (the weather pattern) to export the DB to plaintext
23 inside the backup payload and re-encrypt it under the new device's key
24 on restore, plus the datastore_default file. That path is the one that
25 works; a raw file copy would only get in its way.
26
27 SCOPE: travel declares android:backupAgent and does NOT set
28 android:fullBackupOnly, so Android uses key/value backup here and the
29 <cloud-backup> section below is NOT consulted. Cloud content is exactly
30 AppBackupAgent's travelDbConfigs(this) (travel-db via SqlCipherDbCodec)
31 plus datastore_default. The rules below govern <device-transfer>, and
32 are the correct cloud control if the backupAgent is ever removed: on
33 that path the DB and secure_prefs stay excluded, so a restore is a
34 clean first launch rather than an undecryptable DB.
35-->
36<data-extraction-rules>
37 <!-- Not consulted while android:backupAgent is declared; see SCOPE above. -->
38 <cloud-backup>
39 <include domain="root" path="." />
40 <include domain="file" path="." />
41 <include domain="database" path="." />
42 <exclude domain="database" path="travel-db" />
43 <exclude domain="database" path="travel-db-wal" />
44 <exclude domain="database" path="travel-db-shm" />
45 <exclude domain="database" path="travel-db-journal" />
46 <include domain="sharedpref" path="." />
47 <exclude domain="sharedpref" path="secure_prefs.xml" />
48 <include domain="external" path="." />
49 </cloud-backup>
50 <device-transfer>
51 <include domain="root" path="." />
52 <include domain="file" path="." />
53 <include domain="database" path="." />
54 <exclude domain="database" path="travel-db" />
55 <exclude domain="database" path="travel-db-wal" />
56 <exclude domain="database" path="travel-db-shm" />
57 <exclude domain="database" path="travel-db-journal" />
58 <include domain="sharedpref" path="." />
59 <exclude domain="sharedpref" path="secure_prefs.xml" />
60 <include domain="external" path="." />
61 </device-transfer>
62</data-extraction-rules>