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
0046ed87
Commit
0046ed87
authored
Feb 03, 2018
by
Mygod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a crash on Android 6.0
parent
4f44d119
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
mobile/src/main/java/com/github/shadowsocks/bg/Executable.kt
mobile/src/main/java/com/github/shadowsocks/bg/Executable.kt
+6
-1
No files found.
mobile/src/main/java/com/github/shadowsocks/bg/Executable.kt
View file @
0046ed87
...
...
@@ -25,6 +25,7 @@ import android.util.Log
import
com.github.shadowsocks.App.Companion.app
import
com.github.shadowsocks.JniHelper
import
java.io.File
import
java.io.FileNotFoundException
object
Executable
{
const
val
REDSOCKS
=
"libredsocks.so"
...
...
@@ -37,7 +38,11 @@ object Executable {
fun
killAll
()
{
for
(
process
in
File
(
"/proc"
).
listFiles
{
_
,
name
->
TextUtils
.
isDigitsOnly
(
name
)
})
{
val
exe
=
File
(
File
(
process
,
"cmdline"
).
readText
().
split
(
Character
.
MIN_VALUE
,
limit
=
2
).
first
())
val
exe
=
File
(
try
{
File
(
process
,
"cmdline"
).
readText
()
}
catch
(
ignore
:
FileNotFoundException
)
{
continue
}.
split
(
Character
.
MIN_VALUE
,
limit
=
2
).
first
())
if
(
exe
.
parent
==
app
.
applicationInfo
.
nativeLibraryDir
&&
EXECUTABLES
.
contains
(
exe
.
name
))
{
val
errno
=
JniHelper
.
sigkill
(
process
.
name
.
toInt
())
if
(
errno
!=
0
)
Log
.
w
(
"kill"
,
"SIGKILL ${exe.absolutePath} (${process.name}) failed with $errno"
)
...
...
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