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
d844fc24
Commit
d844fc24
authored
Nov 25, 2014
by
Max Lv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refine fake proc name
parent
a1bdfa5b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
4 deletions
+17
-4
src/main/jni/badvpn/tun2socks/tun2socks.c
src/main/jni/badvpn/tun2socks/tun2socks.c
+13
-4
src/main/scala/com/github/shadowsocks/ShadowsocksVpnService.scala
.../scala/com/github/shadowsocks/ShadowsocksVpnService.scala
+4
-0
No files found.
src/main/jni/badvpn/tun2socks/tun2socks.c
View file @
d844fc24
...
...
@@ -192,6 +192,7 @@ struct {
#ifdef ANDROID
int
tun_fd
;
int
tun_mtu
;
int
fake_proc
;
char
*
pid
;
char
*
dnsgw
;
#else
...
...
@@ -391,10 +392,6 @@ int main (int argc, char **argv)
return
1
;
}
// Fake process name to cheat on Lollipop
strcpy
(
argv
[
0
],
"com.github.shadowsocks"
);
prctl
(
PR_SET_NAME
,
"com.github.shadowsocks"
);
// open standard streams
open_standard_streams
();
...
...
@@ -405,6 +402,13 @@ int main (int argc, char **argv)
goto
fail0
;
}
if
(
options
.
fake_proc
)
{
// Fake process name to cheat on Lollipop
strcpy
(
argv
[
0
],
"com.github.shadowsocks"
);
prctl
(
PR_SET_NAME
,
"com.github.shadowsocks"
);
}
// handle --help and --version
if
(
options
.
help
)
{
print_version
();
...
...
@@ -664,6 +668,7 @@ void print_help (const char *name)
" [--loglevel <0-5/none/error/warning/notice/info/debug>]
\n
"
" [--channel-loglevel <channel-name> <0-5/none/error/warning/notice/info/debug>] ...
\n
"
#ifdef ANDROID
" [--fake-proc]
\n
"
" [--tunfd <fd>]
\n
"
" [--tunmtu <mtu>]
\n
"
" [--dnsgw <dns_gateway_address>]
\n
"
...
...
@@ -718,6 +723,7 @@ int parse_arguments (int argc, char *argv[])
#ifdef ANDROID
options
.
tun_fd
=
-
1
;
options
.
tun_mtu
=
1500
;
options
.
fake_proc
=
0
;
options
.
pid
=
NULL
;
#else
options
.
tundev
=
NULL
;
...
...
@@ -812,6 +818,9 @@ int parse_arguments (int argc, char *argv[])
i
+=
2
;
}
#ifdef ANDROID
else
if
(
!
strcmp
(
arg
,
"--fake-proc"
))
{
options
.
fake_proc
=
1
;
}
else
if
(
!
strcmp
(
arg
,
"--tunfd"
))
{
if
(
1
>=
argc
-
i
)
{
fprintf
(
stderr
,
"%s: requires an argument
\n
"
,
arg
);
...
...
src/main/scala/com/github/shadowsocks/ShadowsocksVpnService.scala
View file @
d844fc24
...
...
@@ -320,6 +320,10 @@ class ShadowsocksVpnService extends VpnService with BaseService {
else
cmd
+=
" --dnsgw %s:8153"
.
format
(
PRIVATE_VLAN
.
format
(
"1"
))
if
(
Utils
.
isLollipopOrAbove
)
{
cmd
+=
" --fake-proc"
;
}
if
(
BuildConfig
.
DEBUG
)
Log
.
d
(
TAG
,
cmd
)
System
.
exec
(
cmd
);
...
...
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