Commit 14ac54c2 authored by Mygod's avatar Mygod

Add support for Auto Backup for Apps

parent 8c28fffb
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
android:name=".App" android:name=".App"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
android:backupAgent=".ConfigBackupHelper" android:backupAgent=".ConfigBackupHelper"
android:fullBackupContent="@xml/backup_descriptor"
android:fullBackupOnly="true"
android:label="@string/app_name" android:label="@string/app_name"
android:supportsRtl="true" android:supportsRtl="true"
android:networkSecurityConfig="@xml/network_security_config" android:networkSecurityConfig="@xml/network_security_config"
......
...@@ -25,6 +25,7 @@ import android.app.backup.FileBackupHelper ...@@ -25,6 +25,7 @@ import android.app.backup.FileBackupHelper
import com.github.shadowsocks.acl.Acl import com.github.shadowsocks.acl.Acl
import com.github.shadowsocks.utils.Key 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() { class ConfigBackupHelper : BackupAgentHelper() {
override fun onCreate() = addHelper("com.github.shadowsocks.database.profile", override fun onCreate() = addHelper("com.github.shadowsocks.database.profile",
FileBackupHelper(this, "../databases/" + Key.PROFILE, Acl.CUSTOM_RULES + ".acl")) FileBackupHelper(this, "../databases/" + Key.PROFILE, Acl.CUSTOM_RULES + ".acl"))
......
<?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>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment