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

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

data_extraction_rules.xml66 lines · 3.7 KiBRaw
1<?xml version="1.0" encoding="utf-8"?>
2<!--
3 Maps. Audited state:
4 * externalFilesDir/zone_<id>.pmtiles — downloaded offline map zones.
5 * cacheDir/vectortilecache/ — the streamed-basemap range cache from
6 :library:map's renderer, so "Clear cache" in system settings reclaims
7 it. An install that ran an older build may still hold a stale copy at
8 externalFilesDir/vectortilecache/, deleted on first launch (see
9 SurfaceMapRenderer).
10 * externalFilesDir/{nodes,edges,transit_voyages,transit_attributes,metadata,
11 road_names,intermediate}.bin — the global routing data set.
12 * externalFilesDir/amenities.db — the downloaded amenity/address database.
13 * databases/amenities.db — a SECOND copy. buildAmenityDatabase() uses Room's
14 createFromFile(), which copies the external file into the standard
15 databases/ directory on first open.
16 * filesDir/datastore_default.preferences_pb — Home and Work quick-access
17 places (SavedPlacesViewModel), plus zone download progress.
18
19 All of the downloaded data is excluded from cloud backup. It runs to tens or
20 hundreds of megabytes against a ~25 MB Auto Backup quota, and going over does
21 not merely skip the big files — it fails the backup for the entire app,
22 silently taking Home/Work with it. Everything excluded here is re-downloadable
23 from data.maproj.org or re-streamable from protomaps on demand.
24
25 The databases/amenities.db copy matters and is easy to miss: it sits in the
26 `database` domain, not `external`, so excluding external alone would still let
27 a large regenerable file through. It is excluded from device transfer too,
28 since Room rebuilds it from the external amenities.db via createFromFile() and
29 sending both copies would double the transfer for no gain.
30
31 Home and Work are the only personal data here (there is no persisted search or
32 location history — the search UI holds results in memory). They are a couple
33 of small JSON strings in the DataStore file and are exactly what a user wants
34 back on a new phone, so they stay in both sections.
35-->
36<data-extraction-rules>
37 <cloud-backup>
38 <include domain="root" path="." />
39 <include domain="file" path="." />
40 <include domain="database" path="." />
41 <!-- Room's createFromFile() copy of the downloaded amenity DB. -->
42 <exclude domain="database" path="amenities.db" />
43 <exclude domain="database" path="amenities.db-wal" />
44 <exclude domain="database" path="amenities.db-shm" />
45 <exclude domain="database" path="amenities.db-journal" />
46 <include domain="sharedpref" path="." />
47 <!-- external: holds the pmtiles zones, routing .bin set and
48 amenities.db — all far past the cloud quota and all re-downloadable.
49 The range cache lives in cacheDir, outside backup scope entirely. -->
50 </cloud-backup>
51 <device-transfer>
52 <include domain="root" path="." />
53 <include domain="file" path="." />
54 <include domain="database" path="." />
55 <!-- Rebuilt from the external amenities.db on first open; transferring
56 both copies would double the payload for nothing. -->
57 <exclude domain="database" path="amenities.db" />
58 <exclude domain="database" path="amenities.db-wal" />
59 <exclude domain="database" path="amenities.db-shm" />
60 <exclude domain="database" path="amenities.db-journal" />
61 <include domain="sharedpref" path="." />
62 <!-- external IS included for device transfer so a new phone gets the
63 user's already-downloaded zones rather than re-downloading them. -->
64 <include domain="external" path="." />
65 </device-transfer>
66</data-extraction-rules>