Modern-Apps.git
Publicgit clone https://git.maproj.org/Modern-Apps.gitModern-Apps.git / launcher / src / main / res / xml / data_extraction_rules.xml
data_extraction_rules.xml71 lines · 3.6 KiBRaw
| 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <!-- |
| 3 | Launcher. Audited state: |
| 4 | |
| 5 | - launcher-db (SQLCipher, databases/) - the home screen layout: one row |
| 6 | per icon, folder, widget and pinned shortcut, holding the |
| 7 | container/page/cell/span plus the target package, class and user |
| 8 | serial. No content from the apps themselves. Real user data, worth |
| 9 | restoring onto a new device. |
| 10 | - datastore_default.preferences_pb (DataStoreUtils, filesDir root) - |
| 11 | grid size, icon scale, labels, drawer layout, launch counts, seeded |
| 12 | flag. |
| 13 | - tvlauncher_config (DataStore, files/datastore/) - TV row order. |
| 14 | - wear-launcher-favorites.json / wear-launcher-recents.json (filesDir) |
| 15 | - watch favorites snapshot and watch-local recents. |
| 16 | - secure_prefs.xml - the SQLCipher passphrase, wrapped by a |
| 17 | non-exportable AndroidKeyStore key. |
| 18 | |
| 19 | launcher-db is excluded from both sections: it is SQLCipher-encrypted |
| 20 | under a passphrase wrapped by the old device's non-exportable |
| 21 | AndroidKeyStore key. That key never leaves the device, so a restored |
| 22 | copy of this file cannot be opened - the Room builder mints a fresh key |
| 23 | and passphrase, skips the already-encrypted file, and Room throws. The |
| 24 | previous rules included the raw database (and secure_prefs) in both |
| 25 | cloud backup and device transfer, which traded a clean first launch |
| 26 | for a crash and lost the layout anyway. |
| 27 | |
| 28 | The layout still migrates: launcher declares its own BackupAgent |
| 29 | (.platform.AppBackupAgent), which uses SqlCipherDbCodec to export the |
| 30 | DB to plaintext inside the backup payload and re-encrypt it under the |
| 31 | new device's passphrase on restore (minted there if none exists yet). |
| 32 | The same payload carries both DataStores and the watch JSON files. |
| 33 | Widget ids in restored rows are allocated by the system AppWidgetHost |
| 34 | and are meaningless in another install, so a restored widget row is |
| 35 | dropped by reconciliation on first launch rather than rendered. |
| 36 | |
| 37 | SCOPE: launcher declares android:backupAgent=".platform.AppBackupAgent" |
| 38 | and does NOT set android:fullBackupOnly, so Android uses key/value |
| 39 | backup for cloud and the cloud-backup section below is NOT consulted. |
| 40 | Cloud content is exactly the agent's payload described above. The |
| 41 | rules below govern device-transfer, and are the correct control if |
| 42 | the backupAgent is ever removed: everything except the raw database, |
| 43 | its sidecars and the wrapped passphrase transfers as raw files. |
| 44 | --> |
| 45 | <data-extraction-rules> |
| 46 | <!-- Not consulted while android:backupAgent is declared; see SCOPE above. --> |
| 47 | <cloud-backup> |
| 48 | <include domain="root" path="." /> |
| 49 | <include domain="file" path="." /> |
| 50 | <include domain="database" path="." /> |
| 51 | <exclude domain="database" path="launcher-db" /> |
| 52 | <exclude domain="database" path="launcher-db-wal" /> |
| 53 | <exclude domain="database" path="launcher-db-shm" /> |
| 54 | <exclude domain="database" path="launcher-db-journal" /> |
| 55 | <include domain="sharedpref" path="." /> |
| 56 | <exclude domain="sharedpref" path="secure_prefs.xml" /> |
| 57 | <include domain="external" path="." /> |
| 58 | </cloud-backup> |
| 59 | <device-transfer> |
| 60 | <include domain="root" path="." /> |
| 61 | <include domain="file" path="." /> |
| 62 | <include domain="database" path="." /> |
| 63 | <exclude domain="database" path="launcher-db" /> |
| 64 | <exclude domain="database" path="launcher-db-wal" /> |
| 65 | <exclude domain="database" path="launcher-db-shm" /> |
| 66 | <exclude domain="database" path="launcher-db-journal" /> |
| 67 | <include domain="sharedpref" path="." /> |
| 68 | <exclude domain="sharedpref" path="secure_prefs.xml" /> |
| 69 | <include domain="external" path="." /> |
| 70 | </device-transfer> |
| 71 | </data-extraction-rules> |