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
37856ab4
Commit
37856ab4
authored
Dec 18, 2017
by
Max Lv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Catch IOExpections when reading ACLs
parent
3f30fc7b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
mobile/src/main/java/com/github/shadowsocks/acl/Acl.kt
mobile/src/main/java/com/github/shadowsocks/acl/Acl.kt
+11
-3
No files found.
mobile/src/main/java/com/github/shadowsocks/acl/Acl.kt
View file @
37856ab4
...
...
@@ -50,7 +50,11 @@ class Acl {
get
()
{
val
acl
=
Acl
()
val
str
=
DataStore
.
publicStore
.
getString
(
CUSTOM_RULES
)
?:
return
acl
acl
.
fromReader
(
str
.
reader
())
try
{
acl
.
fromReader
(
str
.
reader
())
}
catch
(
_
:
Exception
)
{
// Ignore
}
if
(!
acl
.
bypass
)
{
acl
.
subnets
.
clear
()
acl
.
hostnames
.
clear
()
...
...
@@ -148,11 +152,15 @@ class Acl {
return
this
}
fun
fromId
(
id
:
String
):
Acl
=
fromReader
(
Acl
.
getFile
(
id
).
bufferedReader
())
fun
fromId
(
id
:
String
):
Acl
=
try
{
fromReader
(
Acl
.
getFile
(
id
).
bufferedReader
())
}
catch
(
_
:
Exception
)
{
Acl
()
}
fun
flatten
(
depth
:
Int
):
Acl
{
if
(
depth
>
0
)
for
(
url
in
urls
.
asIterable
())
{
val
child
=
Acl
().
fromReader
(
url
.
openStream
().
bufferedReader
(),
bypass
).
flatten
(
depth
-
1
)
val
child
=
try
{
Acl
().
fromReader
(
url
.
openStream
().
bufferedReader
(),
bypass
).
flatten
(
depth
-
1
)
}
catch
(
_
:
Exception
)
{
Acl
()
}
if
(
bypass
!=
child
.
bypass
)
{
Log
.
w
(
TAG
,
"Imported network ACL has a conflicting mode set. "
+
"This will probably not work as intended. URL: $url"
)
...
...
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