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
5c7174fc
Commit
5c7174fc
authored
Aug 16, 2016
by
Mygod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add default kcpcli
parent
536fe92c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
src/main/scala/com/github/shadowsocks/database/DBHelper.scala
...main/scala/com/github/shadowsocks/database/DBHelper.scala
+6
-2
src/main/scala/com/github/shadowsocks/database/Profile.scala
src/main/scala/com/github/shadowsocks/database/Profile.scala
+1
-1
No files found.
src/main/scala/com/github/shadowsocks/database/DBHelper.scala
View file @
5c7174fc
...
@@ -64,7 +64,7 @@ object DBHelper {
...
@@ -64,7 +64,7 @@ object DBHelper {
}
}
class
DBHelper
(
val
context
:
Context
)
class
DBHelper
(
val
context
:
Context
)
extends
OrmLiteSqliteOpenHelper
(
context
,
DBHelper
.
PROFILE
,
null
,
19
)
{
extends
OrmLiteSqliteOpenHelper
(
context
,
DBHelper
.
PROFILE
,
null
,
20
)
{
import
DBHelper._
import
DBHelper._
lazy
val
profileDao
:
Dao
[
Profile
,
Int
]
=
getDao
(
classOf
[
Profile
])
lazy
val
profileDao
:
Dao
[
Profile
,
Int
]
=
getDao
(
classOf
[
Profile
])
...
@@ -129,7 +129,11 @@ class DBHelper(val context: Context)
...
@@ -129,7 +129,11 @@ class DBHelper(val context: Context)
if
(
oldVersion
<
17
)
{
if
(
oldVersion
<
17
)
{
profileDao
.
executeRawNoArgs
(
"ALTER TABLE `profile` ADD COLUMN kcp SMALLINT;"
)
profileDao
.
executeRawNoArgs
(
"ALTER TABLE `profile` ADD COLUMN kcp SMALLINT;"
)
profileDao
.
executeRawNoArgs
(
"ALTER TABLE `profile` ADD COLUMN kcpcli VARCHAR DEFAULT '';"
)
profileDao
.
executeRawNoArgs
(
"ALTER TABLE `profile` ADD COLUMN kcpcli VARCHAR DEFAULT "
+
"'--crypt none --mode normal --mtu 1200 --nocomp --dscp 46 -datashard 10 -parityshard 0';"
)
}
else
if
(
oldVersion
<
20
)
{
profileDao
.
executeRawNoArgs
(
"UPDATE `profile` SET kcpcli = '--crypt none --mode normal --mtu 1200 --nocomp "
+
"--dscp 46 -datashard 10 -parityshard 0' WHERE kcpcli IS NULL;"
)
}
}
if
(
oldVersion
<
18
)
{
if
(
oldVersion
<
18
)
{
...
...
src/main/scala/com/github/shadowsocks/database/Profile.scala
View file @
5c7174fc
...
@@ -106,7 +106,7 @@ class Profile {
...
@@ -106,7 +106,7 @@ class Profile {
var
kcpPort
:
Int
=
8399
var
kcpPort
:
Int
=
8399
@DatabaseField
@DatabaseField
var
kcpcli
:
String
=
""
var
kcpcli
:
String
=
"
--crypt none --mode normal --mtu 1200 --nocomp --dscp 46 -datashard 10 -parityshard 0
"
override
def
toString
=
"ss://"
+
Base64
.
encodeToString
(
"%s%s:%s@%s:%d"
.
formatLocal
(
Locale
.
ENGLISH
,
override
def
toString
=
"ss://"
+
Base64
.
encodeToString
(
"%s%s:%s@%s:%d"
.
formatLocal
(
Locale
.
ENGLISH
,
method
,
if
(
auth
)
"-auth"
else
""
,
password
,
host
,
remotePort
).
getBytes
,
Base64
.
NO_PADDING
|
Base64
.
NO_WRAP
)
method
,
if
(
auth
)
"-auth"
else
""
,
password
,
host
,
remotePort
).
getBytes
,
Base64
.
NO_PADDING
|
Base64
.
NO_WRAP
)
...
...
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