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
f1e1acbe
Commit
f1e1acbe
authored
Mar 02, 2022
by
liusheng
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'cc-dev' into 11a-dev
parents
f7f175ee
0cd2a157
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
1 deletion
+14
-1
app/src/main/java/com/ccwangluo/accelerator/utils/AcceleratorUtils.kt
.../java/com/ccwangluo/accelerator/utils/AcceleratorUtils.kt
+3
-0
core/src/main/java/com/github/shadowsocks/bg/AuthManager.kt
core/src/main/java/com/github/shadowsocks/bg/AuthManager.kt
+3
-0
core/src/main/java/com/github/shadowsocks/bg/GuardedProcessPool.kt
...main/java/com/github/shadowsocks/bg/GuardedProcessPool.kt
+8
-1
No files found.
app/src/main/java/com/ccwangluo/accelerator/utils/AcceleratorUtils.kt
View file @
f1e1acbe
...
...
@@ -199,6 +199,9 @@ object AcceleratorUtils {
override
fun
stateChanged
(
state
:
BaseService
.
State
,
profileName
:
String
?,
msg
:
String
?)
{
AcceleratorUtils
.
state
=
state
stateListener
(
state
,
getAccTime
(),
null
)
if
(
state
==
BaseService
.
State
.
Stopped
&&
!
msg
.
isNullOrBlank
())
{
ToastUtils
.
show
(
msg
)
}
}
override
fun
onServiceConnected
(
service
:
IShadowsocksService
)
{
...
...
core/src/main/java/com/github/shadowsocks/bg/AuthManager.kt
View file @
f1e1acbe
...
...
@@ -21,6 +21,7 @@ import okhttp3.RequestBody.Companion.toRequestBody
import
okhttp3.Response
import
timber.log.Timber
import
java.io.File
import
java.io.IOException
import
java.security.SecureRandom
import
java.security.cert.X509Certificate
import
java.util.concurrent.Executors
...
...
@@ -83,6 +84,8 @@ object AuthManager {
MMKV
.
defaultMMKV
().
putLong
(
"LAST_ACC_TIME"
,
last_acc_time
)
}
class
AuthException
(
msg
:
String
)
:
IOException
(
msg
),
BaseService
.
ExpectedException
suspend
fun
initAuthProfile
(
profile
:
Profile
)
{
withContext
(
Dispatchers
.
IO
)
{
getLineConfig
()
?.
let
{
...
...
core/src/main/java/com/github/shadowsocks/bg/GuardedProcessPool.kt
View file @
f1e1acbe
...
...
@@ -124,7 +124,14 @@ class GuardedProcessPool(private val onFatal: suspend (IOException) -> Unit) : C
)
{
Guard
(
cmdSupplier
).
apply
{
launch
{
try
{
start
()
// if start fails, IOException will be thrown directly
}
catch
(
ex
:
Throwable
)
{
if
(
ex
is
AuthManager
.
AuthException
)
{
onFatal
(
ex
)
return
@launch
}
}
looper
(
onRestartCallback
)
}
}
...
...
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