Skip to content

Commit

Permalink
Merge pull request #16699 from wordpress-mobile/issue/16067-android12…
Browse files Browse the repository at this point in the history
…-backup-restore-xml

Android 12: Backup and restore - New format for the XML configuration
  • Loading branch information
AjeshRPai authored Jun 3, 2022
2 parents 771c3e3 + 423bdab commit 6458485
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 7 deletions.
3 changes: 2 additions & 1 deletion WordPress/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@

<application
android:allowBackup="true"
android:fullBackupContent="@xml/backup_scheme"
android:fullBackupContent="@xml/legacy_backup_scheme"
android:dataExtractionRules="@xml/backup_scheme"
android:hardwareAccelerated="true"
android:icon="@mipmap/app_icon"
android:label="@string/app_name"
Expand Down
36 changes: 30 additions & 6 deletions WordPress/src/main/res/xml/backup_scheme.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<full-backup-content>
<include domain="database" path="wordpress"/>
<include domain="database" path="persistentedittext.db"/>
<include domain="sharedpref" path="self_signed_certs_truststore.bks"/>
<include domain="sharedpref" path="org.wordpress.android_preferences.xml"/>
</full-backup-content>
<data-extraction-rules>
<cloud-backup>
<include
domain="database"
path="wordpress" />
<include
domain="database"
path="persistentedittext.db" />
<include
domain="sharedpref"
path="self_signed_certs_truststore.bks" />
<include
domain="sharedpref"
path="org.wordpress.android_preferences.xml" />
</cloud-backup>
<device-transfer>
<include
domain="database"
path="wordpress" />
<include
domain="database"
path="persistentedittext.db" />
<include
domain="sharedpref"
path="self_signed_certs_truststore.bks" />
<include
domain="sharedpref"
path="org.wordpress.android_preferences.xml" />
</device-transfer>
</data-extraction-rules>
7 changes: 7 additions & 0 deletions WordPress/src/main/res/xml/legacy_backup_scheme.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<full-backup-content>
<include domain="database" path="wordpress"/>
<include domain="database" path="persistentedittext.db"/>
<include domain="sharedpref" path="self_signed_certs_truststore.bks"/>
<include domain="sharedpref" path="org.wordpress.android_preferences.xml"/>
</full-backup-content>

0 comments on commit 6458485

Please sign in to comment.