Add support for Auto Backup for Apps

This commit is contained in:
Mygod
2017-12-15 12:21:30 -08:00
parent 8c28fffbdb
commit 14ac54c2de
3 changed files with 8 additions and 0 deletions
+2
View File
@@ -20,6 +20,8 @@
android:name=".App"
android:icon="@mipmap/ic_launcher"
android:backupAgent=".ConfigBackupHelper"
android:fullBackupContent="@xml/backup_descriptor"
android:fullBackupOnly="true"
android:label="@string/app_name"
android:supportsRtl="true"
android:networkSecurityConfig="@xml/network_security_config"
@@ -25,6 +25,7 @@ import android.app.backup.FileBackupHelper
import com.github.shadowsocks.acl.Acl
import com.github.shadowsocks.utils.Key
@Deprecated("Only used in API level < 23. For 6.0+, Auto Backup for Apps is used.")
class ConfigBackupHelper : BackupAgentHelper() {
override fun onCreate() = addHelper("com.github.shadowsocks.database.profile",
FileBackupHelper(this, "../databases/" + Key.PROFILE, Acl.CUSTOM_RULES + ".acl"))
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<full-backup-content>
<include domain="database" path="profile.db"/>
<include domain="file" path="custom-rules.acl"/>
</full-backup-content>