Skip to content

android: be stricter about system backups #654

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
<application
android:name=".App"
android:allowBackup="false"
android:fullBackupContent="@xml/backup_rules"
android:dataExtractionRules="@xml/data_extraction_rules"
android:banner="@drawable/tv_banner"
android:icon="@mipmap/ic_launcher"
android:label="Tailscale"
Expand Down
9 changes: 9 additions & 0 deletions android/src/main/res/xml/backup_rules.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?kml version="1.0" encoding="utf-8"?>
<!-- data_extraction_rules but for devices below Android 12 -->
<full-backup-content>
<exclude domain="root"/>
<exclude domain="file"/>
<exclude domain="database"/>
<exclude domain="sharedpref"/>
<exclude domain="external"/>
</full-backup-content>
20 changes: 20 additions & 0 deletions android/src/main/res/xml/data_extraction_rules.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Do not allow system backups, including in device-transfer which ignores allowBackup, to not break Tailscale when restoring -->
<!-- It would be nice to have only preferences backed up or some mechanism in-app to solve issues caused by KeyStore not being backed up -->
<data-extraction-rules>
<cloud-backup>
<exclude domain="root"/>
<exclude domain="file"/>
<exclude domain="database"/>
<exclude domain="sharedpref"/>
<exclude domain="external"/>
</cloud-backup>

<device-transfer>
<exclude domain="root"/>
<exclude domain="file"/>
<exclude domain="database"/>
<exclude domain="sharedpref"/>
<exclude domain="external"/>
</device-transfer>
</data-extraction-rules>