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

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

data_extraction_rules.xml65 lines · 3.7 KiBRaw
1<?xml version="1.0" encoding="utf-8"?>
2<!--
3 SCOPE LIMIT — READ BEFORE TRUSTING THE <cloud-backup> SECTION BELOW.
4 This app declares android:backupAgent=".util.AppBackupAgent" and does not set
5 android:fullBackupOnly="true". AppBackupAgent extends BaseBackupAgent, which overrides
6 onBackup()/onRestore() (library/src/main/java/com/vayunmathur/library/util/BackupAgent.kt:21,48),
7 so cloud backup for this app runs through the KEY/VALUE transport and the <cloud-backup>
8 section here is NOT consulted. What actually leaves the device is whatever the agent puts
9 in its stream: today that is dbConfigs = listOf("passwords-db" to passphrase), which
10 BackupHelper exports DECRYPTED via SqlCipherDbCodec. That is a plaintext vault going to
11 Google, and no XML in this file can stop it. Fixing it requires a code change to the
12 agent, or android:fullBackupOnly="true" to route cloud through these rules instead.
13
14 The <device-transfer> section below IS effective: BaseBackupAgent does not override
15 onFullBackup(), so the default BackupAgent.onFullBackup() runs for D2D and honours these
16 rules. The <cloud-backup> section is kept deliberately, as correct-by-default policy for
17 the day the agent is removed or fullBackupOnly is set.
18
19 Deny-all. Overrides the permissive include-everything default in the shared :library module.
20
21 Nothing this app persists is safe to copy off the device, and nothing it persists is
22 restorable even if it were copied:
23
24 databases/passwords-db (+ -wal/-shm/-journal/_temp)
25 The vault. SQLCipher-encrypted; the passphrase is AES-GCM wrapped by the
26 non-exportable AndroidKeyStore key "db_no_auth_key", which never leaves the
27 device on either backup path. -wal/-shm are listed because WAL contents would
28 otherwise leak plaintext pages independently of the main file. _temp is the
29 plaintext staging file used during the plaintext->SQLCipher migration.
30 files/kdbx-sync-backup.kdbx
31 Pre-overwrite copy of the user's KDBX vault, protected only by the master
32 password. Offline-crackable, so this must never reach Google's servers.
33 shared_prefs/secure_prefs.xml, shared_prefs/kdbx_sync_prefs.xml
34 Keystore-wrapped passphrase + IV, and the wrapped KDBX master password.
35 Restoring these is actively harmful: DatabaseHelper.isKeyGenerated() only checks
36 that the IV is present, so a restored prefs file with no matching Keystore key
37 puts the app on the decrypt path with a key that does not exist.
38 files/datastore_default.preferences_pb
39 kdbx sync settings, including kdbx_sync_document_uri. The persisted SAF URI
40 permission grant does not survive backup, so restoring the URI only produces a
41 sync that fails against an unreadable document.
42 databases/androidx.work.workdb (+ sidecars)
43 Regenerable WorkManager scheduling state.
44
45 Device transfer is denied too, not just cloud backup. D2D does not touch Google's
46 servers, but it also does not migrate AndroidKeyStore material, so carrying the vault
47 across yields an unopenable database and the corrupt-state trap described above. The
48 supported migration path is the app's own KDBX sync to a user-chosen SAF document.
49-->
50<data-extraction-rules>
51 <cloud-backup>
52 <exclude domain="root" path="." />
53 <exclude domain="file" path="." />
54 <exclude domain="database" path="." />
55 <exclude domain="sharedpref" path="." />
56 <exclude domain="external" path="." />
57 </cloud-backup>
58 <device-transfer>
59 <exclude domain="root" path="." />
60 <exclude domain="file" path="." />
61 <exclude domain="database" path="." />
62 <exclude domain="sharedpref" path="." />
63 <exclude domain="external" path="." />
64 </device-transfer>
65</data-extraction-rules>