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
27ba7d64
Commit
27ba7d64
authored
Nov 17, 2014
by
Max Lv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix a very old bug in redsocks
parent
8fb5d7f8
Changes
9
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
813 additions
and
408 deletions
+813
-408
jni/redsocks/redsocks.c
jni/redsocks/redsocks.c
+1
-1
src/main/java/eu/chainfire/libsuperuser/Application.java
src/main/java/eu/chainfire/libsuperuser/Application.java
+1
-1
src/main/java/eu/chainfire/libsuperuser/Debug.java
src/main/java/eu/chainfire/libsuperuser/Debug.java
+2
-1
src/main/java/eu/chainfire/libsuperuser/Shell.java
src/main/java/eu/chainfire/libsuperuser/Shell.java
+787
-393
src/main/java/eu/chainfire/libsuperuser/ShellNotClosedException.java
...va/eu/chainfire/libsuperuser/ShellNotClosedException.java
+1
-1
src/main/java/eu/chainfire/libsuperuser/ShellOnMainThreadException.java
...eu/chainfire/libsuperuser/ShellOnMainThreadException.java
+1
-1
src/main/java/eu/chainfire/libsuperuser/StreamGobbler.java
src/main/java/eu/chainfire/libsuperuser/StreamGobbler.java
+1
-1
src/main/scala/com/github/shadowsocks/Shadowsocks.scala
src/main/scala/com/github/shadowsocks/Shadowsocks.scala
+1
-0
src/main/scala/com/github/shadowsocks/ShadowsocksNatService.scala
.../scala/com/github/shadowsocks/ShadowsocksNatService.scala
+18
-9
No files found.
jni/redsocks/redsocks.c
View file @
27ba7d64
...
...
@@ -780,7 +780,7 @@ static int redsocks_init_instance(redsocks_instance *instance)
int
on
=
1
;
int
fd
=
-
1
;
fd
=
socket
(
AF_INET
,
SOCK_STREAM
,
0
);
fd
=
socket
(
AF_INET
,
SOCK_STREAM
,
IPPROTO_TCP
);
if
(
fd
==
-
1
)
{
log_errno
(
LOG_ERR
,
"socket"
);
goto
fail
;
...
...
src/main/java/eu/chainfire/libsuperuser/Application.java
View file @
27ba7d64
/*
* Copyright (C) 2012-201
3
Jorrit "Chainfire" Jongma
* Copyright (C) 2012-201
4
Jorrit "Chainfire" Jongma
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
src/main/java/eu/chainfire/libsuperuser/Debug.java
View file @
27ba7d64
/*
* Copyright (C) 2012-201
3
Jorrit "Chainfire" Jongma
* Copyright (C) 2012-201
4
Jorrit "Chainfire" Jongma
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -18,6 +18,7 @@ package eu.chainfire.libsuperuser;
import
android.os.Looper
;
import
android.util.Log
;
import
com.github.shadowsocks.BuildConfig
;
/**
...
...
src/main/java/eu/chainfire/libsuperuser/Shell.java
View file @
27ba7d64
This diff is collapsed.
Click to expand it.
src/main/java/eu/chainfire/libsuperuser/ShellNotClosedException.java
View file @
27ba7d64
/*
* Copyright (C) 2012-201
3
Jorrit "Chainfire" Jongma
* Copyright (C) 2012-201
4
Jorrit "Chainfire" Jongma
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
src/main/java/eu/chainfire/libsuperuser/ShellOnMainThreadException.java
View file @
27ba7d64
/*
* Copyright (C) 2012-201
3
Jorrit "Chainfire" Jongma
* Copyright (C) 2012-201
4
Jorrit "Chainfire" Jongma
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
src/main/java/eu/chainfire/libsuperuser/StreamGobbler.java
View file @
27ba7d64
/*
* Copyright (C) 2012-201
3
Jorrit "Chainfire" Jongma
* Copyright (C) 2012-201
4
Jorrit "Chainfire" Jongma
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
src/main/scala/com/github/shadowsocks/Shadowsocks.scala
View file @
27ba7d64
...
...
@@ -341,6 +341,7 @@ class Shadowsocks
ab
.
clear
()
ab
.
append
(
"kill -9 `cat /data/data/com.github.shadowsocks/redsocks.pid`"
)
ab
.
append
(
"rm /data/data/com.github.shadowsocks/redsocks.conf"
)
ab
.
append
(
"rm /data/data/com.github.shadowsocks/redsocks.pid"
)
ab
.
append
(
Utils
.
getIptables
+
" -t nat -F OUTPUT"
)
Console
.
runRootCommand
(
ab
.
toArray
)
...
...
src/main/scala/com/github/shadowsocks/ShadowsocksNatService.scala
View file @
27ba7d64
...
...
@@ -137,18 +137,27 @@ class ShadowsocksNatService extends Service with BaseService {
if
(
BuildConfig
.
DEBUG
)
Log
.
d
(
TAG
,
cmd
.
mkString
(
" "
))
Core
.
sstunnel
(
cmd
.
toArray
)
}
else
{
val
conf
=
{
ConfigUtils
.
PDNSD
.
format
(
"127.0.0.1"
)
}
val
cmdBuf
=
new
ArrayBuffer
[
String
]
cmdBuf
+=
(
"ss-tunnel"
,
"-b"
,
"127.0.0.1"
,
"-l"
,
"8163"
,
"-L"
,
"8.8.8.8:53"
,
"-s"
,
config
.
proxy
,
"-p"
,
config
.
remotePort
.
toString
,
"-k"
,
config
.
sitekey
,
"-m"
,
config
.
encMethod
,
"-f"
,
Path
.
BASE
+
"ss-tunnel.pid"
)
if
(
BuildConfig
.
DEBUG
)
Log
.
d
(
TAG
,
cmdBuf
.
mkString
(
" "
))
Core
.
sstunnel
(
cmdBuf
.
toArray
)
val
conf
=
ConfigUtils
.
PDNSD_BYPASS
.
format
(
"127.0.0.1"
,
getString
(
R
.
string
.
exclude
),
8163
)
ConfigUtils
.
printToFile
(
new
File
(
Path
.
BASE
+
"pdnsd.conf"
))(
p
=>
{
p
.
println
(
conf
)
})
val
args
=
"pdnsd -c "
+
Path
.
BASE
+
"pdnsd.conf"
val
cmd
=
Path
.
BASE
+
args
val
cmd
=
Path
.
BASE
+
"pdnsd -c "
+
Path
.
BASE
+
"pdnsd.conf"
if
(
BuildConfig
.
DEBUG
)
Log
.
d
(
TAG
,
cmd
)
Co
nsole
.
runRootCommand
(
cmd
)
Co
re
.
pdnsd
(
cmd
.
split
(
" "
)
)
}
}
...
...
@@ -172,7 +181,7 @@ class ShadowsocksNatService extends Service with BaseService {
p
.
println
(
conf
)
})
val
cmd
=
Path
.
BASE
+
args
Console
.
run
Root
Command
(
cmd
)
Console
.
runCommand
(
cmd
)
}
/** Called when the activity is first created. */
...
...
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