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
8b0b39cb
Commit
8b0b39cb
authored
Nov 24, 2015
by
Max Lv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix #444
parent
be8bc523
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
6 deletions
+23
-6
src/main/res/xml/pref_all.xml
src/main/res/xml/pref_all.xml
+2
-2
src/main/scala/com/github/shadowsocks/Shadowsocks.scala
src/main/scala/com/github/shadowsocks/Shadowsocks.scala
+14
-0
src/main/scala/com/github/shadowsocks/database/DBHelper.scala
...main/scala/com/github/shadowsocks/database/DBHelper.scala
+5
-2
src/main/scala/com/github/shadowsocks/utils/Constants.scala
src/main/scala/com/github/shadowsocks/utils/Constants.scala
+2
-2
No files found.
src/main/res/xml/pref_all.xml
View file @
8b0b39cb
...
...
@@ -25,13 +25,13 @@
<com.github.shadowsocks.preferences.NumberPickerPreference
app:min=
"1"
app:max=
"65535"
android:key=
"remotePort"
android:key=
"remotePort
Num
"
app:summary=
"@string/remote_port_summary"
android:title=
"@string/remote_port"
/>
<com.github.shadowsocks.preferences.NumberPickerPreference
app:min=
"1025"
app:max=
"65535"
android:key=
"
port
"
android:key=
"
localPortNum
"
app:summary=
"@string/port_summary"
android:title=
"@string/port"
/>
<com.github.shadowsocks.preferences.PasswordEditTextPreference
...
...
src/main/scala/com/github/shadowsocks/Shadowsocks.scala
View file @
8b0b39cb
...
...
@@ -166,6 +166,20 @@ class Shadowsocks
if
(!
ShadowsocksApplication
.
settings
.
getBoolean
(
ShadowsocksApplication
.
getVersionName
,
false
))
{
ShadowsocksApplication
.
settings
.
edit
.
putBoolean
(
ShadowsocksApplication
.
getVersionName
,
true
).
apply
()
recovery
()
// Workaround that convert port(String) to port(Int)
val
oldLocalPort
=
ShadowsocksApplication
.
settings
.
getString
(
"port"
,
"-1"
)
val
oldRemotePort
=
ShadowsocksApplication
.
settings
.
getString
(
"remotePort"
,
"-1"
)
try
{
if
(
oldLocalPort
!=
"-1"
)
{
ShadowsocksApplication
.
settings
.
edit
.
putInt
(
Key
.
localPort
,
oldLocalPort
.
toInt
).
commit
()
}
if
(
oldRemotePort
!=
"-1"
)
{
ShadowsocksApplication
.
settings
.
edit
.
putInt
(
Key
.
remotePort
,
oldRemotePort
.
toInt
).
commit
()
}
}
catch
{
case
ex
:
Exception
=>
// Ignore
}
}
}
...
...
src/main/scala/com/github/shadowsocks/database/DBHelper.scala
View file @
8b0b39cb
...
...
@@ -81,19 +81,22 @@ class DBHelper(val context: Context)
profileDao
.
executeRawNoArgs
(
"ALTER TABLE `profile` ADD COLUMN ipv6 SMALLINT;"
)
}
if
(
oldVersion
<
12
)
{
profileDao
.
executeRawNoArgs
(
"BEGIN TRANSACTION;"
)
profileDao
.
executeRawNoArgs
(
"ALTER TABLE `profile` RENAME TO `tmp`;"
)
onCreate
(
database
,
connectionSource
)
TableUtils
.
createTable
(
connectionSource
,
classOf
[
Profile
]
)
profileDao
.
executeRawNoArgs
(
"INSERT INTO `profile`(id, name, host, localPort, remotePort, password, method, route, proxyApps, bypass,"
+
" udpdns, auth, ipv6, individual) "
+
"SELECT id, name, host, localPort, remotePort, password, method, route, 1 - global, bypass, udpdns, auth,"
+
" ipv6, individual FROM `tmp`;"
)
profileDao
.
executeRawNoArgs
(
"DROP TABLE `tmp`;"
)
profileDao
.
executeRawNoArgs
(
"COMMIT;"
)
return
}
if
(
oldVersion
<
13
)
{
profileDao
.
executeRawNoArgs
(
"ALTER TABLE `profile` ADD COLUMN tx LONG;"
)
profileDao
.
executeRawNoArgs
(
"ALTER TABLE `profile` ADD COLUMN rx LONG;"
)
profileDao
.
executeRawNoArgs
(
"ALTER TABLE `profile` ADD COLUMN date
DATE
;"
)
profileDao
.
executeRawNoArgs
(
"ALTER TABLE `profile` ADD COLUMN date
VARCHAR
;"
)
}
}
}
...
...
src/main/scala/com/github/shadowsocks/utils/Constants.scala
View file @
8b0b39cb
...
...
@@ -82,8 +82,8 @@ object Key {
val
proxy
=
"proxy"
val
sitekey
=
"sitekey"
val
encMethod
=
"encMethod"
val
remotePort
=
"remotePort"
val
localPort
=
"
port
"
val
remotePort
=
"remotePort
Num
"
val
localPort
=
"
localPortNum
"
}
object
Scheme
{
...
...
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