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
f164d5a9
Commit
f164d5a9
authored
Dec 30, 2018
by
Mygod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refine start service failures
parent
06f23085
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
7 deletions
+12
-7
core/src/main/java/com/github/shadowsocks/bg/BaseService.kt
core/src/main/java/com/github/shadowsocks/bg/BaseService.kt
+4
-4
core/src/main/java/com/github/shadowsocks/bg/VpnService.kt
core/src/main/java/com/github/shadowsocks/bg/VpnService.kt
+3
-1
core/src/main/java/com/github/shadowsocks/plugin/PluginManager.kt
.../main/java/com/github/shadowsocks/plugin/PluginManager.kt
+5
-2
No files found.
core/src/main/java/com/github/shadowsocks/bg/BaseService.kt
View file @
f164d5a9
...
...
@@ -410,11 +410,11 @@ object BaseService {
data
.
changeState
(
CONNECTED
)
}
catch
(
_
:
UnknownHostException
)
{
stopRunner
(
true
,
getString
(
R
.
string
.
invalid_server
))
}
catch
(
_
:
VpnService
.
NullConnectionException
)
{
stopRunner
(
true
,
getString
(
R
.
string
.
reboot_required
))
}
catch
(
exc
:
Throwable
)
{
printLog
(
exc
)
stopRunner
(
true
,
"${getString(R.string.service_failed)}: ${exc.message}"
)
if
(
exc
!
is
PluginManager
.
PluginNotFoundException
&&
exc
!
is
VpnService
.
NullConnectionException
)
{
printLog
(
exc
)
}
stopRunner
(
true
,
"${getString(R.string.service_failed)}: ${exc.localizedMessage}"
)
}
}
return
Service
.
START_NOT_STICKY
...
...
core/src/main/java/com/github/shadowsocks/bg/VpnService.kt
View file @
f164d5a9
...
...
@@ -104,7 +104,9 @@ class VpnService : BaseVpnService(), LocalDnsService.Interface {
}
}
}
class
NullConnectionException
:
NullPointerException
()
inner
class
NullConnectionException
:
NullPointerException
()
{
override
fun
getLocalizedMessage
()
=
getString
(
R
.
string
.
reboot_required
)
}
init
{
BaseService
.
register
(
this
)
...
...
core/src/main/java/com/github/shadowsocks/plugin/PluginManager.kt
View file @
f164d5a9
...
...
@@ -41,6 +41,10 @@ import java.io.File
import
java.io.FileNotFoundException
object
PluginManager
{
class
PluginNotFoundException
(
private
val
plugin
:
String
)
:
FileNotFoundException
(
plugin
)
{
override
fun
getLocalizedMessage
()
=
app
.
getString
(
com
.
github
.
shadowsocks
.
core
.
R
.
string
.
plugin_unknown
,
plugin
)
}
/**
* Trusted signatures by the app. Third-party fork should add their public key to their fork if the developer wishes
* to publish or has published plugins for this app. You can obtain your public key by executing:
...
...
@@ -128,8 +132,7 @@ object PluginManager {
// add other plugin types here
throw
throwable
?:
FileNotFoundException
(
app
.
getString
(
com
.
github
.
shadowsocks
.
core
.
R
.
string
.
plugin_unknown
,
options
.
id
))
throw
throwable
?:
PluginNotFoundException
(
options
.
id
)
}
private
fun
initNative
(
options
:
PluginOptions
):
String
?
{
...
...
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