Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Magisk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Magisk
Commits
38c867ea
Commit
38c867ea
authored
Apr 21, 2017
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some fixes
parent
2a985ce6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
main.c
jni/main.c
+1
-1
misc.c
jni/utils/misc.c
+5
-2
No files found.
jni/main.c
View file @
38c867ea
...
@@ -22,7 +22,7 @@ __thread void (*err_handler)(void);
...
@@ -22,7 +22,7 @@ __thread void (*err_handler)(void);
static
void
usage
()
{
static
void
usage
()
{
fprintf
(
stderr
,
fprintf
(
stderr
,
"Magisk v"
xstr
(
VERSION
)
" multi-call binary
\n
"
"Magisk v"
xstr
(
MAGISK_
VERSION
)
" multi-call binary
\n
"
"
\n
"
"
\n
"
"Usage: %s [applet [arguments]...]
\n
"
"Usage: %s [applet [arguments]...]
\n
"
" or: %s --install [SOURCE] <DIR>
\n
"
" or: %s --install [SOURCE] <DIR>
\n
"
...
...
jni/utils/misc.c
View file @
38c867ea
...
@@ -134,12 +134,15 @@ static void (*ps_filter_cb)(int);
...
@@ -134,12 +134,15 @@ static void (*ps_filter_cb)(int);
static
const
char
*
ps_filter_pattern
;
static
const
char
*
ps_filter_pattern
;
static
void
proc_name_filter
(
int
pid
)
{
static
void
proc_name_filter
(
int
pid
)
{
char
buf
[
64
];
char
buf
[
64
];
int
fd
;
snprintf
(
buf
,
sizeof
(
buf
),
"/proc/%d/cmdline"
,
pid
);
snprintf
(
buf
,
sizeof
(
buf
),
"/proc/%d/cmdline"
,
pid
);
int
fd
=
xopen
(
buf
,
O_RDONLY
);
if
((
fd
=
open
(
buf
,
O_RDONLY
))
==
-
1
)
return
;
if
(
fdgets
(
buf
,
sizeof
(
buf
),
fd
)
==
0
)
{
if
(
fdgets
(
buf
,
sizeof
(
buf
),
fd
)
==
0
)
{
snprintf
(
buf
,
sizeof
(
buf
),
"/proc/%d/comm"
,
pid
);
snprintf
(
buf
,
sizeof
(
buf
),
"/proc/%d/comm"
,
pid
);
close
(
fd
);
close
(
fd
);
fd
=
xopen
(
buf
,
O_RDONLY
);
if
((
fd
=
open
(
buf
,
O_RDONLY
))
==
-
1
)
return
;
fdgets
(
buf
,
sizeof
(
buf
),
fd
);
fdgets
(
buf
,
sizeof
(
buf
),
fd
);
}
}
if
(
strstr
(
buf
,
ps_filter_pattern
))
{
if
(
strstr
(
buf
,
ps_filter_pattern
))
{
...
...
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