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
ac0fa240
Commit
ac0fa240
authored
Mar 28, 2022
by
sheteng
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/cc-dev' into cc-dev
parents
aed7ddca
238d78cb
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
24 additions
and
11 deletions
+24
-11
app/src/main/java/com/ccwangluo/accelerator/model/Game.kt
app/src/main/java/com/ccwangluo/accelerator/model/Game.kt
+2
-1
app/src/main/java/com/ccwangluo/accelerator/utils/AcceleratorUtils.kt
.../java/com/ccwangluo/accelerator/utils/AcceleratorUtils.kt
+12
-8
core/src/main/java/com/ccnet/acc/AccVpn.kt
core/src/main/java/com/ccnet/acc/AccVpn.kt
+4
-1
core/src/main/java/com/github/shadowsocks/bg/TrafficMonitor.kt
...src/main/java/com/github/shadowsocks/bg/TrafficMonitor.kt
+1
-1
core/src/main/java/com/github/shadowsocks/preference/DataStore.kt
.../main/java/com/github/shadowsocks/preference/DataStore.kt
+3
-0
core/src/main/java/com/github/shadowsocks/utils/Constants.kt
core/src/main/java/com/github/shadowsocks/utils/Constants.kt
+2
-0
core/src/main/jniLibs/arm64-v8a/libccnetacc.so
core/src/main/jniLibs/arm64-v8a/libccnetacc.so
+0
-0
core/src/main/jniLibs/armeabi-v7a/libccnetacc.so
core/src/main/jniLibs/armeabi-v7a/libccnetacc.so
+0
-0
No files found.
app/src/main/java/com/ccwangluo/accelerator/model/Game.kt
View file @
ac0fa240
...
@@ -16,5 +16,6 @@ data class GameInfo(
...
@@ -16,5 +16,6 @@ data class GameInfo(
val
imgs
:
String
,
val
imgs
:
String
,
val
introduction
:
String
,
val
introduction
:
String
,
val
packageName
:
String
,
val
packageName
:
String
,
val
boosterPackageName
:
String
val
boosterPackageName
:
String
,
val
proxyRules
:
String
,
)
)
\ No newline at end of file
app/src/main/java/com/ccwangluo/accelerator/utils/AcceleratorUtils.kt
View file @
ac0fa240
...
@@ -155,9 +155,6 @@ object AcceleratorUtils : TencentLocationListener {
...
@@ -155,9 +155,6 @@ object AcceleratorUtils : TencentLocationListener {
fun
startAccelerator
(
xPageFragment
:
XPageFragment
)
{
fun
startAccelerator
(
xPageFragment
:
XPageFragment
)
{
game
?.
let
{
game
?.
let
{
initAuthProfile
(
xPageFragment
)
initAuthProfile
(
xPageFragment
)
val
serverPort
=
it
.
boosterServer
.
split
(
":"
)
DataStore
.
pingAccHost
=
serverPort
[
0
]
DataStore
.
pingAccPort
=
serverPort
[
1
].
toInt
()
}
}
}
}
...
@@ -192,6 +189,7 @@ object AcceleratorUtils : TencentLocationListener {
...
@@ -192,6 +189,7 @@ object AcceleratorUtils : TencentLocationListener {
private
fun
initAuthProfile
(
xPageFragment
:
XPageFragment
)
{
private
fun
initAuthProfile
(
xPageFragment
:
XPageFragment
)
{
xPageFragment
.
lifecycleScope
.
launch
(
Dispatchers
.
IO
)
{
xPageFragment
.
lifecycleScope
.
launch
(
Dispatchers
.
IO
)
{
val
game
=
AcceleratorUtils
.
game
val
profileId
=
1L
val
profileId
=
1L
val
profile
=
ProfileManager
.
getProfile
(
profileId
)
?:
Profile
()
val
profile
=
ProfileManager
.
getProfile
(
profileId
)
?:
Profile
()
profile
.
proxyApps
=
true
profile
.
proxyApps
=
true
...
@@ -202,13 +200,19 @@ object AcceleratorUtils : TencentLocationListener {
...
@@ -202,13 +200,19 @@ object AcceleratorUtils : TencentLocationListener {
"com.activision.callofduty.shooter"
,
"com.activision.callofduty.shooter"
,
"com.pubg.krmobile"
,
"com.pubg.krmobile"
,
)
)
game
?.
packageName
?.
let
{
proxyGames
.
add
(
it
)
}
if
(
game
!=
null
)
{
game
?.
boosterPackageName
?.
split
(
","
)
?.
forEach
{
proxyGames
.
add
(
game
.
packageName
)
if
(!
StringUtils
.
isEmpty
(
it
))
{
game
.
boosterPackageName
.
split
(
","
).
forEach
{
proxyGames
.
add
(
it
)
if
(!
StringUtils
.
isEmpty
(
it
))
{
proxyGames
.
add
(
it
)
}
}
}
DataStore
.
proxyRules
=
game
.
proxyRules
val
serverPort
=
game
.
boosterServer
.
split
(
":"
)
DataStore
.
pingAccHost
=
serverPort
[
0
]
DataStore
.
pingAccPort
=
serverPort
[
1
].
toInt
()
}
}
// proxyGames.addAll(profile.individual.split("\n"))
profile
.
individual
=
proxyGames
.
joinToString
(
"\n"
)
profile
.
individual
=
proxyGames
.
joinToString
(
"\n"
)
profile
.
route
=
Acl
.
BYPASS_LAN
profile
.
route
=
Acl
.
BYPASS_LAN
profile
.
password
=
"barfoo!"
profile
.
password
=
"barfoo!"
...
...
core/src/main/java/com/ccnet/acc/AccVpn.kt
View file @
ac0fa240
...
@@ -2,6 +2,7 @@ package com.ccnet.acc
...
@@ -2,6 +2,7 @@ package com.ccnet.acc
import
android.content.Context
import
android.content.Context
import
com.github.shadowsocks.database.Profile
import
com.github.shadowsocks.database.Profile
import
com.github.shadowsocks.preference.DataStore
import
timber.log.Timber
import
timber.log.Timber
import
java.io.File
import
java.io.File
...
@@ -14,6 +15,7 @@ object AccVpn {
...
@@ -14,6 +15,7 @@ object AccVpn {
}
}
fun
writeConfig
(
context
:
Context
,
tunFd
:
Int
,
profile
:
Profile
)
{
fun
writeConfig
(
context
:
Context
,
tunFd
:
Int
,
profile
:
Profile
)
{
val
proxyRules
=
DataStore
.
proxyRules
val
configContent
=
"""
val
configContent
=
"""
[General]
[General]
loglevel = trace
loglevel = trace
...
@@ -23,7 +25,8 @@ object AccVpn {
...
@@ -23,7 +25,8 @@ object AccVpn {
Direct = direct
Direct = direct
SS = ss, ${profile.host}, ${profile.remotePort}, encrypt-method=chacha20-ietf-poly1305, password=123456, auth_timeout=${profile.authTimeout}, beats_interval=${profile.beatsInterval}, retry_limit=${profile.retryLimit}, token=${profile.token}
SS = ss, ${profile.host}, ${profile.remotePort}, encrypt-method=chacha20-ietf-poly1305, password=123456, auth_timeout=${profile.authTimeout}, beats_interval=${profile.beatsInterval}, retry_limit=${profile.retryLimit}, token=${profile.token}
[Rule]
[Rule]
FINAL, SS
$proxyRules
FINAL, Direct
"""
"""
val
configFile
=
configFile
(
context
)
val
configFile
=
configFile
(
context
)
Timber
.
d
(
"writeConfig ${configFile.absolutePath}"
)
Timber
.
d
(
"writeConfig ${configFile.absolutePath}"
)
...
...
core/src/main/java/com/github/shadowsocks/bg/TrafficMonitor.kt
View file @
ac0fa240
...
@@ -90,7 +90,7 @@ class TrafficMonitor(statFile: File?) {
...
@@ -90,7 +90,7 @@ class TrafficMonitor(statFile: File?) {
if
(!
cont
)
{
if
(!
cont
)
{
bindNetwork
=
NetworkAdapter
.
bindNetwork
bindNetwork
=
NetworkAdapter
.
bindNetwork
}
}
return
cont
return
cont
&&
running
}
}
}
}
)
)
...
...
core/src/main/java/com/github/shadowsocks/preference/DataStore.kt
View file @
ac0fa240
...
@@ -131,4 +131,7 @@ object DataStore : OnPreferenceDataStoreChangeListener {
...
@@ -131,4 +131,7 @@ object DataStore : OnPreferenceDataStoreChangeListener {
var
pingNetReachableHost
:
String
var
pingNetReachableHost
:
String
get
()
=
privateStore
.
getString
(
Key
.
pingNetReachableHost
)
?:
"baidu.com"
get
()
=
privateStore
.
getString
(
Key
.
pingNetReachableHost
)
?:
"baidu.com"
set
(
value
)
=
privateStore
.
putString
(
Key
.
pingNetReachableHost
,
value
)
set
(
value
)
=
privateStore
.
putString
(
Key
.
pingNetReachableHost
,
value
)
var
proxyRules
:
String
get
()
=
privateStore
.
getString
(
Key
.
proxyRules
)
?:
""
set
(
value
)
=
privateStore
.
putString
(
Key
.
proxyRules
,
value
)
}
}
core/src/main/java/com/github/shadowsocks/utils/Constants.kt
View file @
ac0fa240
...
@@ -79,6 +79,8 @@ object Key {
...
@@ -79,6 +79,8 @@ object Key {
const
val
pingAccPort
=
"pingAccPort"
const
val
pingAccPort
=
"pingAccPort"
const
val
pingNetReachableHost
=
"pingNetReachableHost"
const
val
pingNetReachableHost
=
"pingNetReachableHost"
const
val
proxyRules
=
"proxyRules"
// TV specific values
// TV specific values
const
val
controlStats
=
"control.stats"
const
val
controlStats
=
"control.stats"
const
val
controlImport
=
"control.import"
const
val
controlImport
=
"control.import"
...
...
core/src/main/jniLibs/arm64-v8a/libccnetacc.so
View file @
ac0fa240
No preview for this file type
core/src/main/jniLibs/armeabi-v7a/libccnetacc.so
View file @
ac0fa240
No preview for this file type
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