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
06934b3e
Commit
06934b3e
authored
Apr 10, 2014
by
Max Lv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "bypass system dns"
This reverts commit
1a09f8d1
.
parent
1a09f8d1
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
18 deletions
+8
-18
src/main/java/com/github/shadowsocks/System.java
src/main/java/com/github/shadowsocks/System.java
+0
-1
src/main/jni/system.cpp
src/main/jni/system.cpp
+1
-10
src/main/scala/com/github/shadowsocks/ShadowsocksNatService.scala
.../scala/com/github/shadowsocks/ShadowsocksNatService.scala
+2
-2
src/main/scala/com/github/shadowsocks/ShadowsocksVpnService.scala
.../scala/com/github/shadowsocks/ShadowsocksVpnService.scala
+2
-2
src/main/scala/com/github/shadowsocks/utils/ConfigUtils.scala
...main/scala/com/github/shadowsocks/utils/ConfigUtils.scala
+3
-3
No files found.
src/main/java/com/github/shadowsocks/System.java
View file @
06934b3e
...
@@ -45,5 +45,4 @@ public class System {
...
@@ -45,5 +45,4 @@ public class System {
public
static
native
void
exec
(
String
cmd
);
public
static
native
void
exec
(
String
cmd
);
public
static
native
String
getABI
();
public
static
native
String
getABI
();
public
static
native
String
getDNS1
();
}
}
src/main/jni/system.cpp
View file @
06934b3e
...
@@ -6,18 +6,11 @@
...
@@ -6,18 +6,11 @@
#include <stdlib.h>
#include <stdlib.h>
#include <unistd.h>
#include <unistd.h>
#include <cpu-features.h>
#include <cpu-features.h>
#include <sys/system_properties.h>
#define LOGI(...) do { __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__); } while(0)
#define LOGI(...) do { __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__); } while(0)
#define LOGW(...) do { __android_log_print(ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__); } while(0)
#define LOGW(...) do { __android_log_print(ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__); } while(0)
#define LOGE(...) do { __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__); } while(0)
#define LOGE(...) do { __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__); } while(0)
jstring
Java_com_github_shadowsocks_system_getdns1
(
JNIEnv
*
env
,
jobject
thiz
)
{
char
dns1
[
PROP_VALUE_MAX
];
__system_property_get
(
"net.dns1"
,
dns1
);
return
env
->
NewStringUTF
(
dns1
);
}
jstring
Java_com_github_shadowsocks_system_getabi
(
JNIEnv
*
env
,
jobject
thiz
)
{
jstring
Java_com_github_shadowsocks_system_getabi
(
JNIEnv
*
env
,
jobject
thiz
)
{
AndroidCpuFamily
family
=
android_getCpuFamily
();
AndroidCpuFamily
family
=
android_getCpuFamily
();
uint64_t
features
=
android_getCpuFeatures
();
uint64_t
features
=
android_getCpuFeatures
();
...
@@ -52,9 +45,7 @@ static JNINativeMethod method_table[] = {
...
@@ -52,9 +45,7 @@ static JNINativeMethod method_table[] = {
{
"exec"
,
"(Ljava/lang/String;)V"
,
{
"exec"
,
"(Ljava/lang/String;)V"
,
(
void
*
)
Java_com_github_shadowsocks_system_exec
},
(
void
*
)
Java_com_github_shadowsocks_system_exec
},
{
"getABI"
,
"()Ljava/lang/String;"
,
{
"getABI"
,
"()Ljava/lang/String;"
,
(
void
*
)
Java_com_github_shadowsocks_system_getabi
},
(
void
*
)
Java_com_github_shadowsocks_system_getabi
}
{
"getDNS1"
,
"()Ljava/lang/String;"
,
(
void
*
)
Java_com_github_shadowsocks_system_getdns1
}
};
};
/*
/*
...
...
src/main/scala/com/github/shadowsocks/ShadowsocksNatService.scala
View file @
06934b3e
...
@@ -120,7 +120,7 @@ class ShadowsocksNatService extends Service with BaseService {
...
@@ -120,7 +120,7 @@ class ShadowsocksNatService extends Service with BaseService {
}
else
{
}
else
{
val
conf
=
{
val
conf
=
{
if
(
config
.
isGFWList
)
if
(
config
.
isGFWList
)
ConfigUtils
.
PDNSD_BYPASS
.
format
(
"127.0.0.1"
,
System
.
getDNS1
,
getString
(
R
.
string
.
exclude
))
ConfigUtils
.
PDNSD_BYPASS
.
format
(
"127.0.0.1"
,
getString
(
R
.
string
.
exclude
))
else
else
ConfigUtils
.
PDNSD
.
format
(
"127.0.0.1"
)
ConfigUtils
.
PDNSD
.
format
(
"127.0.0.1"
)
}
}
...
@@ -313,8 +313,8 @@ class ShadowsocksNatService extends Service with BaseService {
...
@@ -313,8 +313,8 @@ class ShadowsocksNatService extends Service with BaseService {
init_sb
.
append
(
cmd_bypass
.
replace
(
"0.0.0.0"
,
"127.0.0.1"
))
init_sb
.
append
(
cmd_bypass
.
replace
(
"0.0.0.0"
,
"127.0.0.1"
))
if
(
config
.
isGFWList
)
{
if
(
config
.
isGFWList
)
{
// Bypass DNS in China
// Bypass DNS in China
init_sb
.
append
(
cmd_bypass
.
replace
(
"-p tcp -d 0.0.0.0"
,
"-d "
+
System
.
getDNS1
))
init_sb
.
append
(
cmd_bypass
.
replace
(
"-p tcp -d 0.0.0.0"
,
"-d 114.114.114.114"
))
init_sb
.
append
(
cmd_bypass
.
replace
(
"-p tcp -d 0.0.0.0"
,
"-d 114.114.114.114"
))
init_sb
.
append
(
cmd_bypass
.
replace
(
"-p tcp -d 0.0.0.0"
,
"-d 114.114.115.115"
))
}
}
if
(
hasRedirectSupport
)
{
if
(
hasRedirectSupport
)
{
init_sb
init_sb
...
...
src/main/scala/com/github/shadowsocks/ShadowsocksVpnService.scala
View file @
06934b3e
...
@@ -77,7 +77,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
...
@@ -77,7 +77,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
def
isByass
(
net
:
SubnetUtils
)
:
Boolean
=
{
def
isByass
(
net
:
SubnetUtils
)
:
Boolean
=
{
val
info
=
net
.
getInfo
val
info
=
net
.
getInfo
info
.
isInRange
(
config
.
proxy
)
||
info
.
isInRange
(
"114.114.114.114"
)
||
info
.
isInRange
(
System
.
getDNS1
)
info
.
isInRange
(
config
.
proxy
)
||
info
.
isInRange
(
"114.114.114.114"
)
||
info
.
isInRange
(
"114.114.115.115"
)
}
}
def
startShadowsocksDaemon
()
{
def
startShadowsocksDaemon
()
{
...
@@ -92,7 +92,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
...
@@ -92,7 +92,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
def
startDnsDaemon
()
{
def
startDnsDaemon
()
{
val
conf
=
{
val
conf
=
{
if
(
config
.
isGFWList
)
if
(
config
.
isGFWList
)
ConfigUtils
.
PDNSD_BYPASS
.
format
(
"0.0.0.0"
,
System
.
getDNS1
,
getString
(
R
.
string
.
exclude
))
ConfigUtils
.
PDNSD_BYPASS
.
format
(
"0.0.0.0"
,
getString
(
R
.
string
.
exclude
))
else
else
ConfigUtils
.
PDNSD
.
format
(
"0.0.0.0"
)
ConfigUtils
.
PDNSD
.
format
(
"0.0.0.0"
)
}
}
...
...
src/main/scala/com/github/shadowsocks/utils/ConfigUtils.scala
View file @
06934b3e
...
@@ -110,12 +110,12 @@ object ConfigUtils {
...
@@ -110,12 +110,12 @@ object ConfigUtils {
|
|
|server {
|server {
| label = "china-servers";
| label = "china-servers";
| ip =
%s, 114.114.114.114
;
| ip =
114.114.114.114, 114.114.115.115
;
| uptest = none;
| uptest = none;
| preset = on;
| preset = on;
| include = %s;
| include = %s;
| policy = excluded;
| policy = excluded;
| timeout =
2
;
| timeout =
3
;
|}
|}
|
|
|server {
|server {
...
@@ -197,4 +197,4 @@ object ConfigUtils {
...
@@ -197,4 +197,4 @@ object ConfigUtils {
new
Config
(
isGlobalProxy
,
isGFWList
,
isBypassApps
,
isTrafficStat
,
isUdpDns
,
profileName
,
proxy
,
new
Config
(
isGlobalProxy
,
isGFWList
,
isBypassApps
,
isTrafficStat
,
isUdpDns
,
profileName
,
proxy
,
sitekey
,
encMethod
,
proxiedAppString
,
remotePort
,
localPort
)
sitekey
,
encMethod
,
proxiedAppString
,
remotePort
,
localPort
)
}
}
}
}
\ No newline at end of file
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