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
5a15f730
Commit
5a15f730
authored
Feb 22, 2019
by
Mygod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Executable.killAll
parent
e3e99adc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
core/src/main/java/com/github/shadowsocks/bg/Executable.kt
core/src/main/java/com/github/shadowsocks/bg/Executable.kt
+3
-4
No files found.
core/src/main/java/com/github/shadowsocks/bg/Executable.kt
View file @
5a15f730
...
@@ -26,7 +26,6 @@ import android.system.OsConstants
...
@@ -26,7 +26,6 @@ import android.system.OsConstants
import
android.text.TextUtils
import
android.text.TextUtils
import
android.util.Log
import
android.util.Log
import
com.crashlytics.android.Crashlytics
import
com.crashlytics.android.Crashlytics
import
com.github.shadowsocks.Core.app
import
java.io.File
import
java.io.File
import
java.io.FileNotFoundException
import
java.io.FileNotFoundException
...
@@ -40,11 +39,11 @@ object Executable {
...
@@ -40,11 +39,11 @@ object Executable {
fun
killAll
()
{
fun
killAll
()
{
for
(
process
in
File
(
"/proc"
).
listFiles
{
_
,
name
->
TextUtils
.
isDigitsOnly
(
name
)
})
{
for
(
process
in
File
(
"/proc"
).
listFiles
{
_
,
name
->
TextUtils
.
isDigitsOnly
(
name
)
})
{
val
exe
=
File
(
try
{
val
exe
=
File
(
try
{
File
(
process
,
"cmdline"
).
readText
()
File
(
process
,
"cmdline"
).
inputStream
().
bufferedReader
().
readText
()
}
catch
(
ignore
:
FileNotFoundException
)
{
}
catch
(
_
:
FileNotFoundException
)
{
continue
continue
}.
split
(
Character
.
MIN_VALUE
,
limit
=
2
).
first
())
}.
split
(
Character
.
MIN_VALUE
,
limit
=
2
).
first
())
if
(
exe
.
parent
==
app
.
applicationInfo
.
nativeLibraryDir
&&
EXECUTABLES
.
contains
(
exe
.
name
))
try
{
if
(
EXECUTABLES
.
contains
(
exe
.
name
))
try
{
Os
.
kill
(
process
.
name
.
toInt
(),
OsConstants
.
SIGKILL
)
Os
.
kill
(
process
.
name
.
toInt
(),
OsConstants
.
SIGKILL
)
}
catch
(
e
:
ErrnoException
)
{
}
catch
(
e
:
ErrnoException
)
{
if
(
e
.
errno
!=
OsConstants
.
ESRCH
)
{
if
(
e
.
errno
!=
OsConstants
.
ESRCH
)
{
...
...
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