Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
d857702
security: disable allowBackup and add explicit exported flags
Dhakshin2007 Apr 22, 2026
83cb243
security: add backup_rules.xml to exclude sensitive data from backup
Dhakshin2007 Apr 22, 2026
b15a2d9
security: add data_extraction_rules.xml for Android 12+ backup protec…
Dhakshin2007 Apr 22, 2026
f7a3ace
fix: add blank line after XML declaration to pass Checkstyle RegexpHe…
Dhakshin2007 Apr 22, 2026
03ff5c5
fix: add blank line after XML declaration to pass Checkstyle RegexpHe…
Dhakshin2007 Apr 22, 2026
66a62d2
fix: rewrite backup_rules.xml with correct XML declaration and blank …
Dhakshin2007 Apr 22, 2026
7cc1d91
fix: restore clean data_extraction_rules.xml to fix XML parse error i…
Dhakshin2007 Apr 22, 2026
26e9e19
Apply suggestion from @andreia-ferreira
Dhakshin2007 Apr 22, 2026
09e14fa
style: put each AndroidManifest.xml attribute on its own line per rev…
Dhakshin2007 Apr 22, 2026
a26281d
Merge branch 'master' into master
Dhakshin2007 Apr 22, 2026
9040fb0
fix: add missing blank line 2 in data_extraction_rules.xml to pass Ch…
Dhakshin2007 Apr 22, 2026
faf7209
style: align allowBackup/fullBackupContent/dataExtractionRules indent…
Dhakshin2007 Apr 23, 2026
784354a
style: fix indentation of allowBackup attributes to match other appli…
Dhakshin2007 Apr 23, 2026
3620ab2
Merge branch 'master' into master
Dhakshin2007 Apr 23, 2026
5a86c6c
Merge branch 'master' into master
andreia-ferreira Apr 23, 2026
871dc7c
Merge branch 'master' into master
andreia-ferreira Apr 24, 2026
9647be2
Merge branch 'master' into master
Dhakshin2007 Apr 27, 2026
f0adc19
Merge branch 'master' into master
andreia-ferreira May 4, 2026
11da9be
Merge branch 'master' into master
gino-m May 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@

<application
android:name="org.groundplatform.android.GroundApplication"
android:allowBackup="true"
android:allowBackup="false"
android:fullBackupContent="@xml/backup_rules"
android:dataExtractionRules="@xml/data_extraction_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
Expand Down
43 changes: 43 additions & 0 deletions app/src/main/res/xml/backup_rules.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>

<!--
~ Copyright 2026 Google LLC
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ https://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<!--
Backup rules for Android 11 (API 30) and below.
Used by android:fullBackupContent in AndroidManifest.xml.

Excludes all sensitive app data from cloud/adb backup to prevent
unauthorized extraction of Firebase auth tokens, survey data,
and GPS coordinates from compromised or untrusted devices.

See: https://developer.android.com/guide/topics/data/autobackup
-->
<full-backup-content>

<!-- Exclude all shared preferences (contains auth state and user prefs) -->
<exclude domain="sharedpref" path="." />

<!-- Exclude local database (contains survey data and GPS coordinates) -->
<exclude domain="database" path="." />

<!-- Exclude internal files (may contain cached tokens or offline data) -->
<exclude domain="file" path="." />

<!-- Exclude external storage files -->
<exclude domain="external" path="." />

</full-backup-content>
49 changes: 49 additions & 0 deletions app/src/main/res/xml/data_extraction_rules.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>

<!--
~ Copyright 2026 Google LLC
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ https://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<!--
Data extraction rules for Android 12 (API 31) and above.
Used by android:dataExtractionRules in AndroidManifest.xml.

Prevents sensitive app data (Firebase tokens, survey responses,
GPS coordinates) from being extracted via cloud backup or
device-to-device transfer on Android 12+ devices.

See: https://developer.android.com/about/versions/12/backup-restore
-->
<data-extraction-rules>

<cloud-backup>
<!-- Disable cloud backup entirely for this app -->
<exclude domain="root" path="." />
<exclude domain="sharedpref" path="." />
<exclude domain="database" path="." />
<exclude domain="file" path="." />
<exclude domain="external" path="." />
</cloud-backup>

<device-transfer>
<!-- Disable device-to-device transfer of sensitive data -->
<exclude domain="root" path="." />
<exclude domain="sharedpref" path="." />
<exclude domain="database" path="." />
<exclude domain="file" path="." />
<exclude domain="external" path="." />
</device-transfer>

</data-extraction-rules>