Skip to content

Commit

Permalink
Add backup rules
Browse files Browse the repository at this point in the history
Test commit
  • Loading branch information
oakkitten committed Feb 25, 2024
1 parent ba5f9c1 commit 966771a
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ android {
}
}

productFlavors.all {
resValue("string", "etc__default_shared_preferences_file_name", applicationId!! + "_preferences.xml")
}

buildFeatures {
viewBinding = true
buildConfig = true
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
<application
android:name=".Weechat"
android:allowBackup="true"
android:fullBackupContent="@xml/backup_rules_for_api_30_and_below"
android:dataExtractionRules="@xml/backup_rules_for_api_31_and_above"
android:icon="@mipmap/ic_launcher_kitty"
android:label="@string/etc__application_name"
android:theme="@style/Weechat"
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/res/xml/backup_rules_for_api_30_and_below.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<full-backup-content>
<include domain="sharedpref" path="@etc__default_shared_preferences_file_name"/>
<include domain="external" path="themes"/>
<include domain="external" path="fonts"/>
</full-backup-content>
13 changes: 13 additions & 0 deletions app/src/main/res/xml/backup_rules_for_api_31_and_above.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<data-extraction-rules>
<cloud-backup>
<include domain="sharedpref" path="@etc__default_shared_preferences_file_name"/>
<include domain="external" path="themes"/>
<include domain="external" path="fonts"/>
</cloud-backup>
<device-transfer>
<include domain="sharedpref" path="@etc__default_shared_preferences_file_name"/>
<include domain="external" path="themes"/>
<include domain="external" path="fonts"/>
</device-transfer>
</data-extraction-rules>

0 comments on commit 966771a

Please sign in to comment.