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

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

data_extraction_rules.xml76 lines · 4.4 KiBRaw
1<?xml version="1.0" encoding="utf-8"?>
2<!-- Browser.
3
4 Storage audit:
5 database web-browser-db Room: HistoryEntry, Bookmark, BookmarkFolder, SitePermission,
6 StorageInfo, DownloadEntry, InstalledSite (PWAs), ShieldSetting.
7 Bookmarks and history are user data worth preserving.
8 sharedpref web_prefs.xml Browser + Shields settings AND the serialized open-tab
9 list (full URLs) for every window.
10 sharedpref secure_prefs.xml SQLCipher passphrase, wrapped by a non-exportable
11 AndroidKeyStore key that never leaves the device.
12 root app_webview/ WebView profile: cookies, localStorage, IndexedDB, service
13 workers and cache. Cookies are live session credentials
14 and the profile embeds device-bound session state.
15 file shields/ ~8 MB serialized adblock engine snapshot, rebuilt from the
16 bundled assets whenever it is missing or stale.
17 file favicons/ Site icons, refetched on demand.
18 cache tab-thumbs/ Tab thumbnails (cacheDir, never backed up).
19 Downloads go to the public Downloads dir via DownloadManager, not app storage.
20
21 The raw database must never be copied by a rule on either channel: it is
22 SQLCipher-encrypted under a passphrase wrapped by the old device's
23 non-exportable AndroidKeyStore key, so a restored copy cannot be opened —
24 the restore device mints a fresh key and passphrase, the already-encrypted
25 file is skipped by the encryption check, and Room fails to open it.
26
27 Data is preserved instead by .platform.AppBackupAgent (manifest
28 android:backupAgent, no fullBackupOnly): cloud backup is key/value
29 through that agent, and it uses SqlCipherDbCodec to export the database
30 to plaintext inside the backup payload and re-encrypt it under the new
31 device's passphrase on restore, plus web_prefs (settings and open tabs;
32 the tab URLs duplicate the history already in the database).
33
34 SCOPE: because the backupAgent is declared, the <cloud-backup> section
35 below is NOT consulted for cloud backup; it is the correct control if
36 the agent is ever removed. <device-transfer> is governed here. Both
37 sections are kept identical so the two channels stay coherent: the same
38 raw files are withheld either way, and the agent payload is the one
39 path that carries the database and preferences.
40
41 WebView profile decision, explicit for both channels: app_webview/ is
42 excluded entirely. Its cache is regenerable, and its cookies are live
43 session credentials — transplanting them would move signed-in sessions
44 to a new device, and the surrounding localStorage/IndexedDB/service-worker
45 state is device-bound session state of the same kind. Nothing under
46 app_webview/ is copied raw; the user signs in again after a restore. -->
47<data-extraction-rules>
48 <cloud-backup>
49 <include domain="root" path="." />
50 <exclude domain="root" path="app_webview" />
51 <include domain="file" path="." />
52 <exclude domain="file" path="shields" />
53 <exclude domain="file" path="favicons" />
54 <include domain="database" path="." />
55 <exclude domain="database" path="web-browser-db" />
56 <exclude domain="database" path="web-browser-db-wal" />
57 <exclude domain="database" path="web-browser-db-shm" />
58 <exclude domain="database" path="web-browser-db-journal" />
59 <include domain="sharedpref" path="." />
60 <exclude domain="sharedpref" path="secure_prefs.xml" />
61 </cloud-backup>
62 <device-transfer>
63 <include domain="root" path="." />
64 <exclude domain="root" path="app_webview" />
65 <include domain="file" path="." />
66 <exclude domain="file" path="shields" />
67 <exclude domain="file" path="favicons" />
68 <include domain="database" path="." />
69 <exclude domain="database" path="web-browser-db" />
70 <exclude domain="database" path="web-browser-db-wal" />
71 <exclude domain="database" path="web-browser-db-shm" />
72 <exclude domain="database" path="web-browser-db-journal" />
73 <include domain="sharedpref" path="." />
74 <exclude domain="sharedpref" path="secure_prefs.xml" />
75 </device-transfer>
76</data-extraction-rules>