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
eb3b0105
Commit
eb3b0105
authored
Jan 09, 2017
by
Mygod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix 'Fix #1064'
parent
17bedaff
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
11 deletions
+12
-11
src/main/scala/com/github/shadowsocks/acl/Acl.scala
src/main/scala/com/github/shadowsocks/acl/Acl.scala
+3
-4
src/main/scala/com/github/shadowsocks/acl/CustomRulesFragment.scala
...cala/com/github/shadowsocks/acl/CustomRulesFragment.scala
+9
-7
No files found.
src/main/scala/com/github/shadowsocks/acl/Acl.scala
View file @
eb3b0105
...
@@ -88,10 +88,9 @@ class Acl {
...
@@ -88,10 +88,9 @@ class Acl {
override
def
toString
:
String
=
{
override
def
toString
:
String
=
{
val
result
=
new
StringBuilder
()
val
result
=
new
StringBuilder
()
result
.
append
(
if
(
bypass
)
"[bypass_all]\n"
else
"[proxy_all]\n"
)
result
.
append
(
if
(
bypass
)
"[bypass_all]\n"
else
"[proxy_all]\n"
)
var
bypassList
=
bypassHostnames
.
toStream
val
(
bypassList
,
proxyList
)
=
var
proxyList
=
proxyHostnames
.
toStream
if
(
bypass
)
(
bypassHostnames
.
toStream
,
subnets
.
toStream
.
map
(
_
.
toString
)
#:::
proxyHostnames
.
toStream
)
if
(
bypass
)
proxyList
=
subnets
.
toStream
.
map
(
_
.
toString
)
#:::
bypassList
else
(
subnets
.
toStream
.
map
(
_
.
toString
)
#:::
bypassHostnames
.
toStream
,
proxyHostnames
.
toStream
)
else
bypassList
=
subnets
.
toStream
.
map
(
_
.
toString
)
#:::
proxyList
if
(
bypassList
.
nonEmpty
)
{
if
(
bypassList
.
nonEmpty
)
{
result
.
append
(
"[bypass_list]\n"
)
result
.
append
(
"[bypass_list]\n"
)
result
.
append
(
bypassList
.
mkString
(
"\n"
))
result
.
append
(
bypassList
.
mkString
(
"\n"
))
...
...
src/main/scala/com/github/shadowsocks/acl/CustomRulesFragment.scala
View file @
eb3b0105
...
@@ -208,13 +208,15 @@ class CustomRulesFragment extends ToolbarFragment with Toolbar.OnMenuItemClickLi
...
@@ -208,13 +208,15 @@ class CustomRulesFragment extends ToolbarFragment with Toolbar.OnMenuItemClickLi
def
getSectionTitle
(
i
:
Int
)
:
String
=
{
def
getSectionTitle
(
i
:
Int
)
:
String
=
{
val
j
=
i
-
acl
.
subnets
.
size
val
j
=
i
-
acl
.
subnets
.
size
try
(
if
(
j
<
0
)
acl
.
subnets
(
i
).
address
.
getHostAddress
.
substring
(
0
,
1
)
else
{
try
{
(
if
(
j
<
0
)
acl
.
subnets
(
i
).
address
.
getHostAddress
.
substring
(
0
,
1
)
else
{
val
hostname
=
acl
.
proxyHostnames
(
i
)
val
hostname
=
acl
.
proxyHostnames
(
i
)
PATTERN_DOMAIN
.
findFirstMatchIn
(
hostname
)
match
{
PATTERN_DOMAIN
.
findFirstMatchIn
(
hostname
)
match
{
case
Some
(
m
)
=>
m
.
matched
.
replaceAll
(
"\\\\."
,
"."
)
// don't convert IDN yet
case
Some
(
m
)
=>
m
.
matched
.
replaceAll
(
"\\\\."
,
"."
)
// don't convert IDN yet
case
None
=>
hostname
case
None
=>
hostname
}
}
}).
substring
(
0
,
1
)
catch
{
}).
substring
(
0
,
1
)
}
catch
{
case
_:
IndexOutOfBoundsException
=>
" "
case
_:
IndexOutOfBoundsException
=>
" "
}
}
}
}
...
...
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