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
a252f19a
Commit
a252f19a
authored
Apr 19, 2020
by
Mygod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add hack to make UDP fallback work
parent
a12d0b0a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
5 deletions
+7
-5
core/src/main/java/com/github/shadowsocks/bg/BaseService.kt
core/src/main/java/com/github/shadowsocks/bg/BaseService.kt
+1
-1
core/src/main/java/com/github/shadowsocks/bg/ProxyInstance.kt
.../src/main/java/com/github/shadowsocks/bg/ProxyInstance.kt
+5
-3
plugin/src/main/java/com/github/shadowsocks/plugin/AlertDialogFragment.kt
...java/com/github/shadowsocks/plugin/AlertDialogFragment.kt
+1
-1
No files found.
core/src/main/java/com/github/shadowsocks/bg/BaseService.kt
View file @
a252f19a
...
@@ -247,7 +247,7 @@ object BaseService {
...
@@ -247,7 +247,7 @@ object BaseService {
udpFallback
?.
start
(
this
,
udpFallback
?.
start
(
this
,
File
(
Core
.
deviceStorage
.
noBackupFilesDir
,
"stat_udp"
),
File
(
Core
.
deviceStorage
.
noBackupFilesDir
,
"stat_udp"
),
File
(
configRoot
,
CONFIG_FILE_UDP
),
File
(
configRoot
,
CONFIG_FILE_UDP
),
"-u"
)
"-u"
,
false
)
data
.
localDns
=
LocalDnsWorker
(
this
::
rawResolver
).
apply
{
start
()
}
data
.
localDns
=
LocalDnsWorker
(
this
::
rawResolver
).
apply
{
start
()
}
}
}
...
...
core/src/main/java/com/github/shadowsocks/bg/ProxyInstance.kt
View file @
a252f19a
...
@@ -110,7 +110,8 @@ class ProxyInstance(val profile: Profile, private val route: String = profile.ro
...
@@ -110,7 +110,8 @@ class ProxyInstance(val profile: Profile, private val route: String = profile.ro
* Sensitive shadowsocks configuration file requires extra protection. It may be stored in encrypted storage or
* Sensitive shadowsocks configuration file requires extra protection. It may be stored in encrypted storage or
* device storage, depending on which is currently available.
* device storage, depending on which is currently available.
*/
*/
fun
start
(
service
:
BaseService
.
Interface
,
stat
:
File
,
configFile
:
File
,
extraFlag
:
String
?
=
null
)
{
fun
start
(
service
:
BaseService
.
Interface
,
stat
:
File
,
configFile
:
File
,
extraFlag
:
String
?
=
null
,
dnsRelay
:
Boolean
=
true
)
{
trafficMonitor
=
TrafficMonitor
(
stat
)
trafficMonitor
=
TrafficMonitor
(
stat
)
this
.
configFile
=
configFile
this
.
configFile
=
configFile
...
@@ -130,11 +131,12 @@ class ProxyInstance(val profile: Profile, private val route: String = profile.ro
...
@@ -130,11 +131,12 @@ class ProxyInstance(val profile: Profile, private val route: String = profile.ro
val
cmd
=
arrayListOf
(
val
cmd
=
arrayListOf
(
File
((
service
as
Context
).
applicationInfo
.
nativeLibraryDir
,
Executable
.
SS_LOCAL
).
absolutePath
,
File
((
service
as
Context
).
applicationInfo
.
nativeLibraryDir
,
Executable
.
SS_LOCAL
).
absolutePath
,
"--stat-path"
,
stat
.
absolutePath
,
"--stat-path"
,
stat
.
absolutePath
,
"--dns-relay"
,
"${DataStore.listenAddress}:${DataStore.portLocalDns}"
,
"--remote-dns"
,
"${dns.host}:${if (dns.port < 0) 53 else dns.port}"
,
"-c"
,
configFile
.
absolutePath
)
"-c"
,
configFile
.
absolutePath
)
if
(
service
.
isVpnService
)
cmd
+=
arrayListOf
(
"--vpn"
)
if
(
service
.
isVpnService
)
cmd
+=
arrayListOf
(
"--vpn"
)
if
(
extraFlag
!=
null
)
cmd
.
add
(
extraFlag
)
if
(
extraFlag
!=
null
)
cmd
.
add
(
extraFlag
)
if
(
dnsRelay
)
cmd
+=
arrayListOf
(
"--dns-relay"
,
"${DataStore.listenAddress}:${DataStore.portLocalDns}"
,
"--remote-dns"
,
"${dns.host}:${if (dns.port < 0) 53 else dns.port}"
)
if
(
route
!=
Acl
.
ALL
)
{
if
(
route
!=
Acl
.
ALL
)
{
cmd
+=
"--acl"
cmd
+=
"--acl"
...
...
plugin/src/main/java/com/github/shadowsocks/plugin/AlertDialogFragment.kt
View file @
a252f19a
...
@@ -41,7 +41,7 @@ abstract class AlertDialogFragment<Arg : Parcelable, Ret : Parcelable> :
...
@@ -41,7 +41,7 @@ abstract class AlertDialogFragment<Arg : Parcelable, Ret : Parcelable> :
}
}
protected
abstract
fun
AlertDialog
.
Builder
.
prepare
(
listener
:
DialogInterface
.
OnClickListener
)
protected
abstract
fun
AlertDialog
.
Builder
.
prepare
(
listener
:
DialogInterface
.
OnClickListener
)
protected
val
arg
by
lazy
{
arguments
!!
.
getParcelable
<
Arg
>(
KEY_ARG
)
!!
}
protected
val
arg
by
lazy
{
requireArguments
()
.
getParcelable
<
Arg
>(
KEY_ARG
)
!!
}
protected
open
fun
ret
(
which
:
Int
):
Ret
?
=
null
protected
open
fun
ret
(
which
:
Int
):
Ret
?
=
null
fun
withArg
(
arg
:
Arg
)
=
apply
{
arguments
=
Bundle
().
apply
{
putParcelable
(
KEY_ARG
,
arg
)
}
}
fun
withArg
(
arg
:
Arg
)
=
apply
{
arguments
=
Bundle
().
apply
{
putParcelable
(
KEY_ARG
,
arg
)
}
}
...
...
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