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
525af62e
Commit
525af62e
authored
Mar 08, 2022
by
chenhuaqing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code refinement
parent
80adb25b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
10 deletions
+22
-10
core/src/main/java/com/github/shadowsocks/bg/GuardedProcessPool.kt
...main/java/com/github/shadowsocks/bg/GuardedProcessPool.kt
+5
-4
core/src/main/java/com/github/shadowsocks/database/PrivateDatabase.kt
...n/java/com/github/shadowsocks/database/PrivateDatabase.kt
+16
-5
core/src/main/java/com/github/shadowsocks/database/Profile.kt
.../src/main/java/com/github/shadowsocks/database/Profile.kt
+1
-1
No files found.
core/src/main/java/com/github/shadowsocks/bg/GuardedProcessPool.kt
View file @
525af62e
...
...
@@ -77,10 +77,11 @@ class GuardedProcessPool(private val onFatal: suspend (IOException) -> Unit) : C
val
exitCode
=
exitChannel
.
receive
()
running
=
false
when
{
exitCode
==
OsConstants
.
ECONNREFUSED
->
throw
IOException
(
"connection refused by server"
)
SystemClock
.
elapsedRealtime
()
-
startTime
<
1000
->
throw
IOException
(
"$cmdName exits too fast (exit code: $exitCode)"
)
exitCode
==
OsConstants
.
ECONNREFUSED
->
throw
IOException
(
"请充值"
)
SystemClock
.
elapsedRealtime
()
-
startTime
<
1000
->
{
Timber
.
e
(
"$cmdName exits too fast (exit code: $exitCode)"
)
throw
IOException
(
"网络错误 $exitCode"
)
}
exitCode
==
128
+
OsConstants
.
SIGKILL
->
Timber
.
w
(
"$cmdName was killed"
)
else
->
Timber
.
w
(
IOException
(
"$cmdName unexpectedly exits with code $exitCode"
))
}
...
...
core/src/main/java/com/github/shadowsocks/database/PrivateDatabase.kt
View file @
525af62e
...
...
@@ -32,7 +32,7 @@ import com.github.shadowsocks.utils.Key
import
kotlinx.coroutines.GlobalScope
import
kotlinx.coroutines.launch
@Database
(
entities
=
[
Profile
::
class
,
KeyValuePair
::
class
],
version
=
29
)
@Database
(
entities
=
[
Profile
::
class
,
KeyValuePair
::
class
],
version
=
30
)
@TypeConverters
(
Profile
.
SubscriptionStatus
::
class
)
abstract
class
PrivateDatabase
:
RoomDatabase
()
{
companion
object
{
...
...
@@ -42,7 +42,8 @@ abstract class PrivateDatabase : RoomDatabase() {
Migration26
,
Migration27
,
Migration28
,
Migration29
Migration29
,
Migration30
)
allowMainThreadQueries
()
enableMultiInstanceInvalidation
()
...
...
@@ -74,8 +75,18 @@ abstract class PrivateDatabase : RoomDatabase() {
database
.
execSQL
(
"ALTER TABLE `Profile` ADD COLUMN `metered` INTEGER NOT NULL DEFAULT 0"
)
}
object
Migration29
:
Migration
(
28
,
29
)
{
override
fun
migrate
(
database
:
SupportSQLiteDatabase
)
=
database
.
execSQL
(
"ALTER TABLE `Profile` ADD COLUMN `subscription` INTEGER NOT NULL DEFAULT "
+
Profile
.
SubscriptionStatus
.
UserConfigured
.
persistedValue
)
override
fun
migrate
(
database
:
SupportSQLiteDatabase
)
{
database
.
execSQL
(
"ALTER TABLE `Profile` ADD COLUMN `subscription` INTEGER NOT NULL DEFAULT "
+
Profile
.
SubscriptionStatus
.
UserConfigured
.
persistedValue
)
database
.
execSQL
(
"ALTER TABLE `Profile` ADD COLUMN `token` TEXT "
)
database
.
execSQL
(
"ALTER TABLE `Profile` ADD COLUMN `authTimeout` INTEGER "
)
database
.
execSQL
(
"ALTER TABLE `Profile` ADD COLUMN `beatsInterval` INTEGER "
)
database
.
execSQL
(
"ALTER TABLE `Profile` ADD COLUMN `retryLimit` INTEGER "
)
}
}
object
Migration30
:
Migration
(
29
,
30
)
{
override
fun
migrate
(
database
:
SupportSQLiteDatabase
)
{
}
}
}
core/src/main/java/com/github/shadowsocks/database/Profile.kt
View file @
525af62e
...
...
@@ -65,7 +65,7 @@ data class Profile(
var
retryLimit
:
Int
=
3
,
var
route
:
String
=
"all"
,
var
remoteDns
:
String
=
"
dns.google
"
,
var
remoteDns
:
String
=
"
8.8.8.8
"
,
var
proxyApps
:
Boolean
=
false
,
var
bypass
:
Boolean
=
false
,
var
udpdns
:
Boolean
=
false
,
...
...
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