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
334cd5ea
Commit
334cd5ea
authored
Dec 06, 2017
by
Mygod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issues with keeping compatibility with old databases
parent
94fad237
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
7 deletions
+7
-7
mobile/src/main/java/com/github/shadowsocks/ProfilesFragment.kt
.../src/main/java/com/github/shadowsocks/ProfilesFragment.kt
+1
-1
mobile/src/main/java/com/github/shadowsocks/bg/ProxyService.kt
...e/src/main/java/com/github/shadowsocks/bg/ProxyService.kt
+1
-1
mobile/src/main/java/com/github/shadowsocks/bg/TransproxyService.kt
.../main/java/com/github/shadowsocks/bg/TransproxyService.kt
+1
-1
mobile/src/main/java/com/github/shadowsocks/bg/VpnService.kt
mobile/src/main/java/com/github/shadowsocks/bg/VpnService.kt
+1
-1
mobile/src/main/java/com/github/shadowsocks/database/Profile.kt
.../src/main/java/com/github/shadowsocks/database/Profile.kt
+3
-3
No files found.
mobile/src/main/java/com/github/shadowsocks/ProfilesFragment.kt
View file @
334cd5ea
...
@@ -148,7 +148,7 @@ class ProfilesFragment : ToolbarFragment(), Toolbar.OnMenuItemClickListener {
...
@@ -148,7 +148,7 @@ class ProfilesFragment : ToolbarFragment(), Toolbar.OnMenuItemClickListener {
}
}
text1
.
text
=
item
.
formattedName
text1
.
text
=
item
.
formattedName
val
t2
=
ArrayList
<
String
>()
val
t2
=
ArrayList
<
String
>()
if
(
item
.
name
.
isNot
Empty
())
t2
+=
item
.
formattedAddress
if
(
!
item
.
name
.
isNullOr
Empty
())
t2
+=
item
.
formattedAddress
val
id
=
PluginConfiguration
(
item
.
plugin
?:
""
).
selected
val
id
=
PluginConfiguration
(
item
.
plugin
?:
""
).
selected
if
(
id
.
isNotEmpty
())
t2
+=
app
.
getString
(
R
.
string
.
profile_plugin
,
id
)
if
(
id
.
isNotEmpty
())
t2
+=
app
.
getString
(
R
.
string
.
profile_plugin
,
id
)
if
(
t2
.
isEmpty
())
text2
.
visibility
=
View
.
GONE
else
{
if
(
t2
.
isEmpty
())
text2
.
visibility
=
View
.
GONE
else
{
...
...
mobile/src/main/java/com/github/shadowsocks/bg/ProxyService.kt
View file @
334cd5ea
...
@@ -34,7 +34,7 @@ class ProxyService : Service(), BaseService.Interface {
...
@@ -34,7 +34,7 @@ class ProxyService : Service(), BaseService.Interface {
override
val
tag
:
String
get
()
=
"ShadowsocksProxyService"
override
val
tag
:
String
get
()
=
"ShadowsocksProxyService"
override
fun
createNotification
():
ServiceNotification
=
override
fun
createNotification
():
ServiceNotification
=
ServiceNotification
(
this
,
data
.
profile
!!
.
n
ame
,
"service-proxy"
,
true
)
ServiceNotification
(
this
,
data
.
profile
!!
.
formattedN
ame
,
"service-proxy"
,
true
)
override
fun
onBind
(
intent
:
Intent
):
IBinder
?
=
super
.
onBind
(
intent
)
override
fun
onBind
(
intent
:
Intent
):
IBinder
?
=
super
.
onBind
(
intent
)
override
fun
onStartCommand
(
intent
:
Intent
?,
flags
:
Int
,
startId
:
Int
):
Int
=
override
fun
onStartCommand
(
intent
:
Intent
?,
flags
:
Int
,
startId
:
Int
):
Int
=
...
...
mobile/src/main/java/com/github/shadowsocks/bg/TransproxyService.kt
View file @
334cd5ea
...
@@ -33,7 +33,7 @@ class TransproxyService : Service(), LocalDnsService.Interface {
...
@@ -33,7 +33,7 @@ class TransproxyService : Service(), LocalDnsService.Interface {
override
val
tag
:
String
get
()
=
"ShadowsocksTransproxyService"
override
val
tag
:
String
get
()
=
"ShadowsocksTransproxyService"
override
fun
createNotification
():
ServiceNotification
=
override
fun
createNotification
():
ServiceNotification
=
ServiceNotification
(
this
,
data
.
profile
!!
.
n
ame
,
"service-transproxy"
,
true
)
ServiceNotification
(
this
,
data
.
profile
!!
.
formattedN
ame
,
"service-transproxy"
,
true
)
override
fun
onBind
(
intent
:
Intent
):
IBinder
?
=
super
.
onBind
(
intent
)
override
fun
onBind
(
intent
:
Intent
):
IBinder
?
=
super
.
onBind
(
intent
)
override
fun
onStartCommand
(
intent
:
Intent
?,
flags
:
Int
,
startId
:
Int
):
Int
=
override
fun
onStartCommand
(
intent
:
Intent
?,
flags
:
Int
,
startId
:
Int
):
Int
=
...
...
mobile/src/main/java/com/github/shadowsocks/bg/VpnService.kt
View file @
334cd5ea
...
@@ -77,7 +77,7 @@ class VpnService : BaseVpnService(), LocalDnsService.Interface {
...
@@ -77,7 +77,7 @@ class VpnService : BaseVpnService(), LocalDnsService.Interface {
override
val
tag
:
String
get
()
=
"ShadowsocksVpnService"
override
val
tag
:
String
get
()
=
"ShadowsocksVpnService"
override
fun
createNotification
():
ServiceNotification
=
override
fun
createNotification
():
ServiceNotification
=
ServiceNotification
(
this
,
data
.
profile
!!
.
n
ame
,
"service-vpn"
)
ServiceNotification
(
this
,
data
.
profile
!!
.
formattedN
ame
,
"service-vpn"
)
private
var
conn
:
ParcelFileDescriptor
?
=
null
private
var
conn
:
ParcelFileDescriptor
?
=
null
private
var
worker
:
ProtectWorker
?
=
null
private
var
worker
:
ProtectWorker
?
=
null
...
...
mobile/src/main/java/com/github/shadowsocks/database/Profile.kt
View file @
334cd5ea
...
@@ -84,7 +84,7 @@ class Profile {
...
@@ -84,7 +84,7 @@ class Profile {
var
id
:
Int
=
0
var
id
:
Int
=
0
@DatabaseField
@DatabaseField
var
name
:
String
=
""
var
name
:
String
?
=
""
@DatabaseField
@DatabaseField
var
host
:
String
=
"198.199.101.152"
var
host
:
String
=
"198.199.101.152"
...
@@ -135,7 +135,7 @@ class Profile {
...
@@ -135,7 +135,7 @@ class Profile {
var
plugin
:
String
?
=
null
var
plugin
:
String
?
=
null
val
formattedAddress
get
()
=
(
if
(
host
.
contains
(
":"
))
"[%s]:%d"
else
"%s:%d"
).
format
(
host
,
remotePort
)
val
formattedAddress
get
()
=
(
if
(
host
.
contains
(
":"
))
"[%s]:%d"
else
"%s:%d"
).
format
(
host
,
remotePort
)
val
formattedName
get
()
=
if
(
name
.
is
Empty
())
formattedAddress
else
name
val
formattedName
get
()
=
if
(
name
.
is
NullOrEmpty
())
formattedAddress
else
name
!!
fun
toUri
():
Uri
{
fun
toUri
():
Uri
{
val
builder
=
Uri
.
Builder
()
val
builder
=
Uri
.
Builder
()
...
@@ -147,7 +147,7 @@ class Profile {
...
@@ -147,7 +147,7 @@ class Profile {
val
configuration
=
PluginConfiguration
(
plugin
?:
""
)
val
configuration
=
PluginConfiguration
(
plugin
?:
""
)
if
(
configuration
.
selected
.
isNotEmpty
())
if
(
configuration
.
selected
.
isNotEmpty
())
builder
.
appendQueryParameter
(
Key
.
plugin
,
configuration
.
selectedOptions
.
toString
(
false
))
builder
.
appendQueryParameter
(
Key
.
plugin
,
configuration
.
selectedOptions
.
toString
(
false
))
if
(
name
.
isNot
Empty
())
builder
.
fragment
(
name
)
if
(
!
name
.
isNullOr
Empty
())
builder
.
fragment
(
name
)
return
builder
.
build
()
return
builder
.
build
()
}
}
override
fun
toString
()
=
toUri
().
toString
()
override
fun
toString
()
=
toUri
().
toString
()
...
...
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