Commit 5c7174fc authored by Mygod's avatar Mygod

Add default kcpcli

parent 536fe92c
...@@ -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) {
......
...@@ -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)
......
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