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

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

data_extraction_rules.xml64 lines · 3.9 KiBRaw
1<?xml version="1.0" encoding="utf-8"?>
2<!--
3 Allowlist. Overrides the permissive include-everything default in the shared :library
4 module. Both sections use <include>, so anything not named here is excluded.
5
6 ALLOWED: shared_prefs/email_settings.xml
7 Holds one key, "load_remote_images" (EmailSettings.kt). It is an app-wide privacy
8 preference with no account scope, no PII and no crypto dependency, and it is the one
9 setting a user would notice silently reverting after a restore. The cloud-backup
10 section sets disableIfNoEncryptionCapabilities="true" so even this only leaves the
11 device under Google's client-side end-to-end encryption.
12
13 EXCLUDED (by omission from the allowlist):
14
15 databases/email-db (+ -wal/-shm/-journal), databases/email-db_temp
16 The EmailAccount table holds accessToken and refreshToken as PLAINTEXT columns
17 (EmailModels.kt:88-89) alongside passwordEncrypted/passwordIv wrapped by the
18 AndroidKeyStore alias "email_account_pw". The same table holds every account's
19 server config, and the EmailMessage table holds all cached message bodies. Account
20 config cannot be separated from the tokens: they are columns on the same row, in
21 the same file. The file is SQLCipher-encrypted under a passphrase wrapped by
22 "db_no_auth_key", and neither Keystore alias survives cloud backup or D2D, so a
23 restored database is unreadable as well as unsafe. email-db_temp is the plaintext
24 staging file from the plaintext->SQLCipher migration.
25 shared_prefs/secure_prefs.xml
26 Wrapped SQLCipher passphrase + IV. Restoring it without its Keystore key leaves
27 DatabaseHelper.isKeyGenerated() reporting a key that no longer exists.
28 shared_prefs/outlook_oauth.xml
29 In-flight PKCE "verifier" and "state" plus "emailHint". A restored verifier/state
30 pair is a stale CSRF token for an authorization request that no longer exists, and
31 emailHint is an account address. No value, real risk.
32 shared_prefs/email_notif_last_seen.xml
33 Keys are literally "<accountEmail>::<folderName>", so the file enumerates the
34 user's email addresses. The only benefit is suppressing one burst of duplicate
35 notifications, and since the accounts database is not restored there is nothing
36 for those UIDs to line up against.
37 shared_prefs/email_idle_state.xml
38 "idle_restart_pending" is transient runtime state. Restoring it true would enqueue
39 an IMAP IDLE restart on a device with no configured accounts.
40 files/outbox/<entryId>/ and files/outbox/<entryId>/inline/
41 Attachment and inline-image payloads for queued outgoing mail, stored as plaintext
42 files. Unsent user mail content; must not be uploaded.
43 files/ Glance widget state
44 androidx.glance.appwidget writes per-widget-id state files under files/. Widget ids
45 are not stable across installs, so the state is meaningless after a restore, and
46 the widget caches message subjects and senders. Regenerable.
47 databases/androidx.work.workdb (+ sidecars)
48 WorkManager scheduling state, including serialized worker input data. Regenerable.
49 cache/cid/, cache/eml_cid/, cache/inline/, cache/eml_attachments/
50 Decoded inline images and attachments from received mail. The framework never
51 backs up cacheDir, but they are named here so the audit is complete.
52
53 Device transfer carries the same single preference. It is not widened relative to cloud
54 backup, because D2D does not migrate AndroidKeyStore material and the accounts database
55 would arrive unopenable.
56-->
57<data-extraction-rules>
58 <cloud-backup disableIfNoEncryptionCapabilities="true">
59 <include domain="sharedpref" path="email_settings.xml" />
60 </cloud-backup>
61 <device-transfer>
62 <include domain="sharedpref" path="email_settings.xml" />
63 </device-transfer>
64</data-extraction-rules>