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
f4ac7c8e
Unverified
Commit
f4ac7c8e
authored
Apr 16, 2021
by
vvb2060
Committed by
GitHub
Apr 16, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ignore validating class name of isolated process name
Fix #4176 Co-authored-by:
topjohnwu
<
topjohnwu@gmail.com
>
parent
2b65e1ff
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
16 deletions
+32
-16
hide_utils.cpp
native/jni/magiskhide/hide_utils.cpp
+32
-16
No files found.
native/jni/magiskhide/hide_utils.cpp
View file @
f4ac7c8e
...
@@ -99,24 +99,40 @@ static void kill_process(const char *name, bool multi = false,
...
@@ -99,24 +99,40 @@ static void kill_process(const char *name, bool multi = false,
});
});
}
}
static
bool
validate
(
const
char
*
s
)
{
static
bool
validate
(
const
char
*
pkg
,
const
char
*
proc
)
{
if
(
strcmp
(
s
,
ISOLATED_MAGIC
)
==
0
)
bool
pkg_valid
=
false
;
return
true
;
bool
proc_valid
=
true
;
bool
dot
=
false
;
for
(
char
c
;
(
c
=
*
s
);
++
s
)
{
if
(
str_eql
(
pkg
,
ISOLATED_MAGIC
))
{
if
((
c
>=
'A'
&&
c
<=
'Z'
)
||
(
c
>=
'a'
&&
c
<=
'z'
)
||
pkg_valid
=
true
;
(
c
>=
'0'
&&
c
<=
'9'
)
||
c
==
'_'
||
c
==
':'
)
{
for
(
char
c
;
(
c
=
*
proc
);
++
proc
)
{
continue
;
if
(
isalnum
(
c
)
||
c
==
'_'
||
c
==
'.'
)
continue
;
if
(
c
==
':'
)
break
;
proc_valid
=
false
;
break
;
}
}
if
(
SDK_INT
>=
29
&&
c
==
'$'
)
}
else
{
continue
;
for
(
char
c
;
(
c
=
*
pkg
);
++
pkg
)
{
if
(
c
==
'.'
)
{
if
(
isalnum
(
c
)
||
c
==
'_'
)
dot
=
true
;
continue
;
continue
;
if
(
c
==
'.'
)
{
pkg_valid
=
true
;
continue
;
}
pkg_valid
=
false
;
break
;
}
for
(
char
c
;
(
c
=
*
proc
);
++
proc
)
{
if
(
isalnum
(
c
)
||
c
==
'_'
||
c
==
':'
||
c
==
'.'
)
continue
;
proc_valid
=
false
;
break
;
}
}
return
false
;
}
}
return
dot
;
return
pkg_valid
&&
proc_valid
;
}
}
static
void
add_hide_set
(
const
char
*
pkg
,
const
char
*
proc
)
{
static
void
add_hide_set
(
const
char
*
pkg
,
const
char
*
proc
)
{
...
@@ -134,7 +150,7 @@ static int add_list(const char *pkg, const char *proc) {
...
@@ -134,7 +150,7 @@ static int add_list(const char *pkg, const char *proc) {
if
(
proc
[
0
]
==
'\0'
)
if
(
proc
[
0
]
==
'\0'
)
proc
=
pkg
;
proc
=
pkg
;
if
(
!
validate
(
pkg
)
||
!
validate
(
proc
))
if
(
!
validate
(
pkg
,
proc
))
return
HIDE_INVALID_PKG
;
return
HIDE_INVALID_PKG
;
for
(
auto
&
hide
:
hide_set
)
for
(
auto
&
hide
:
hide_set
)
...
...
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