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
2406bdc2
Commit
2406bdc2
authored
Dec 14, 2019
by
Mygod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use noncapturing group (?:^|\.)
parent
377d2ee4
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
16287 additions
and
16286 deletions
+16287
-16286
core/gfwlist/parse.py
core/gfwlist/parse.py
+1
-1
core/src/androidTest/java/com/github/shadowsocks/acl/AclTest.kt
...rc/androidTest/java/com/github/shadowsocks/acl/AclTest.kt
+1
-1
core/src/main/assets/acl/bypass-china.acl
core/src/main/assets/acl/bypass-china.acl
+5427
-5427
core/src/main/assets/acl/bypass-lan-china.acl
core/src/main/assets/acl/bypass-lan-china.acl
+5427
-5427
core/src/main/assets/acl/gfwlist.acl
core/src/main/assets/acl/gfwlist.acl
+5427
-5427
mobile/src/main/java/com/github/shadowsocks/acl/CustomRulesFragment.kt
...in/java/com/github/shadowsocks/acl/CustomRulesFragment.kt
+4
-3
No files found.
core/gfwlist/parse.py
View file @
2406bdc2
...
...
@@ -99,7 +99,7 @@ def generate_acl(domains):
ip_content
+=
(
domain
+
"
\n
"
)
except
socket
.
error
:
domain
=
domain
.
replace
(
'.'
,
'\.'
)
proxy_content
+=
(
'(^|\.)'
+
domain
+
'$
\n
'
)
proxy_content
+=
(
'(
?:
^|\.)'
+
domain
+
'$
\n
'
)
proxy_content
=
header
+
ip_content
+
proxy_content
...
...
core/src/androidTest/java/com/github/shadowsocks/acl/AclTest.kt
View file @
2406bdc2
...
...
@@ -28,7 +28,7 @@ class AclTest {
private
const
val
INPUT1
=
"""[proxy_all]
[bypass_list]
1.0.1.0/24
(^|\.)4tern\.com${'$'}
(
?:
^|\.)4tern\.com${'$'}
"""
}
...
...
core/src/main/assets/acl/bypass-china.acl
View file @
2406bdc2
This diff is collapsed.
Click to expand it.
core/src/main/assets/acl/bypass-lan-china.acl
View file @
2406bdc2
This diff is collapsed.
Click to expand it.
core/src/main/assets/acl/gfwlist.acl
View file @
2406bdc2
This diff is collapsed.
Click to expand it.
mobile/src/main/java/com/github/shadowsocks/acl/CustomRulesFragment.kt
View file @
2406bdc2
...
...
@@ -72,8 +72,9 @@ class CustomRulesFragment : ToolbarFragment(), Toolbar.OnMenuItemClickListener,
private
const
val
SELECTED_HOSTNAMES
=
"com.github.shadowsocks.acl.CustomRulesFragment.SELECTED_HOSTNAMES"
private
const
val
SELECTED_URLS
=
"com.github.shadowsocks.acl.CustomRulesFragment.SELECTED_URLS"
// unescaped: (?<=^(\(\^\|\\\.\)|\^\(\.\*\\\.\)\?)).*(?=\$$)
private
val
domainPattern
=
"(?<=^(\\(\\^\\|\\\\\\.\\)|\\^\\(\\.\\*\\\\\\.\\)\\?)).*(?=\\\$\$)"
.
toRegex
()
// unescaped lol: (?<=^(?:\(\^\|\\\.\)|\^\(\.\*\\\.\)\?|\(\?:\^\|\\\.\))).*(?=\$$)
private
val
domainPattern
=
"(?<=^(?:\\(\\^\\|\\\\\\.\\)|\\^\\(\\.\\*\\\\\\.\\)\\?|\\(\\?:\\^\\|\\\\\\.\\))).*(?=\\\$\$)"
.
toRegex
()
@Suppress
(
"FunctionName"
)
private
fun
AclItem
(
item
:
Any
)
=
when
(
item
)
{
...
...
@@ -179,7 +180,7 @@ class CustomRulesFragment : ToolbarFragment(), Toolbar.OnMenuItemClickListener,
when
(
Template
.
values
()[
templateSelector
.
selectedItemPosition
])
{
Template
.
Generic
->
AclItem
(
text
)
Template
.
Domain
->
AclItem
(
IDN
.
toASCII
(
text
,
IDN
.
ALLOW_UNASSIGNED
or
IDN
.
USE_STD3_ASCII_RULES
)
.
replace
(
"."
,
"\\."
).
let
{
"(^|\\.)$it\$"
})
.
replace
(
"."
,
"\\."
).
let
{
"(
?:
^|\\.)$it\$"
})
Template
.
Url
->
AclItem
(
text
,
true
)
}
},
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