Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
com.ccwangluo.accelerator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sheteng
com.ccwangluo.accelerator
Commits
14ac54c2
Commit
14ac54c2
authored
Dec 15, 2017
by
Mygod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for Auto Backup for Apps
parent
8c28fffb
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
0 deletions
+8
-0
mobile/src/main/AndroidManifest.xml
mobile/src/main/AndroidManifest.xml
+2
-0
mobile/src/main/java/com/github/shadowsocks/ConfigBackupHelper.kt
...rc/main/java/com/github/shadowsocks/ConfigBackupHelper.kt
+1
-0
mobile/src/main/res/xml/backup_descriptor.xml
mobile/src/main/res/xml/backup_descriptor.xml
+5
-0
No files found.
mobile/src/main/AndroidManifest.xml
View file @
14ac54c2
...
@@ -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"
...
...
mobile/src/main/java/com/github/shadowsocks/ConfigBackupHelper.kt
View file @
14ac54c2
...
@@ -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"
))
...
...
mobile/src/main/res/xml/backup_descriptor.xml
0 → 100644
View file @
14ac54c2
<?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>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment