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
68656521
Commit
68656521
authored
Mar 18, 2021
by
vvb2060
Committed by
John Wu
Mar 24, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix process name in MagiskHide
close #3997
parent
ed4d0867
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
12 additions
and
6 deletions
+12
-6
FlashZip.kt
...src/main/java/com/topjohnwu/magisk/core/tasks/FlashZip.kt
+1
-1
HideRvItems.kt
...src/main/java/com/topjohnwu/magisk/ui/hide/HideRvItems.kt
+1
-1
hide_utils.cpp
native/jni/magiskhide/hide_utils.cpp
+7
-1
magiskhide.hpp
native/jni/magiskhide/magiskhide.hpp
+1
-1
proc_monitor.cpp
native/jni/magiskhide/proc_monitor.cpp
+1
-1
misc.hpp
native/jni/utils/misc.hpp
+1
-1
No files found.
app/src/main/java/com/topjohnwu/magisk/core/tasks/FlashZip.kt
View file @
68656521
...
...
@@ -66,7 +66,7 @@ open class FlashZip(
console
.
add
(
"- Installing ${mUri.displayName}"
)
return
Shell
.
su
(
"sh $installDir/update-binary dummy 1 \
"$zipFile\"
"
)
return
Shell
.
su
(
"sh $installDir/update-binary dummy 1 \
'$zipFile\'
"
)
.
to
(
console
,
logs
).
exec
().
isSuccess
}
...
...
app/src/main/java/com/topjohnwu/magisk/ui/hide/HideRvItems.kt
View file @
68656521
...
...
@@ -99,7 +99,7 @@ class HideProcessRvItem(
set
(
value
)
=
set
(
value
,
process
.
isHidden
,
{
process
.
isHidden
=
it
},
BR
.
hidden
)
{
val
arg
=
if
(
it
)
"add"
else
"rm"
val
(
name
,
pkg
)
=
process
Shell
.
su
(
"magiskhide $arg $pkg
$name
"
).
submit
()
Shell
.
su
(
"magiskhide $arg $pkg
\'$name\'
"
).
submit
()
}
fun
toggle
()
{
...
...
native/jni/magiskhide/hide_utils.cpp
View file @
68656521
...
...
@@ -108,6 +108,8 @@ static bool validate(const char *s) {
(
c
>=
'0'
&&
c
<=
'9'
)
||
c
==
'_'
||
c
==
':'
)
{
continue
;
}
if
(
SDK_INT
>=
29
&&
c
==
'$'
)
continue
;
if
(
c
==
'.'
)
{
dot
=
true
;
continue
;
...
...
@@ -333,7 +335,7 @@ void auto_start_magiskhide(bool late_props) {
}
}
bool
is_hide_target
(
int
uid
,
string_view
process
)
{
bool
is_hide_target
(
int
uid
,
string_view
process
,
int
max_len
)
{
mutex_guard
lock
(
hide_state_lock
);
if
(
uid
%
100000
>=
90000
)
{
...
...
@@ -343,6 +345,8 @@ bool is_hide_target(int uid, string_view process) {
return
false
;
for
(
auto
&
s
:
it
->
second
)
{
if
(
s
.
length
()
>
max_len
&&
process
.
length
()
>
max_len
&&
str_starts
(
s
,
process
))
return
true
;
if
(
str_starts
(
process
,
s
))
return
true
;
}
...
...
@@ -352,6 +356,8 @@ bool is_hide_target(int uid, string_view process) {
return
false
;
for
(
auto
&
s
:
it
->
second
)
{
if
(
s
.
length
()
>
max_len
&&
process
.
length
()
>
max_len
&&
str_starts
(
s
,
process
))
return
true
;
if
(
s
==
process
)
return
true
;
}
...
...
native/jni/magiskhide/magiskhide.hpp
View file @
68656521
...
...
@@ -36,7 +36,7 @@ void crawl_procfs(const std::function<bool (int)> &fn);
void
crawl_procfs
(
DIR
*
dir
,
const
std
::
function
<
bool
(
int
)
>
&
fn
);
bool
hide_enabled
();
void
update_uid_map
();
bool
is_hide_target
(
int
uid
,
std
::
string_view
process
);
bool
is_hide_target
(
int
uid
,
std
::
string_view
process
,
int
max_len
=
1024
);
// Hide policies
void
hide_daemon
(
int
pid
);
...
...
native/jni/magiskhide/proc_monitor.cpp
View file @
68656521
...
...
@@ -212,7 +212,7 @@ static bool check_pid(int pid) {
cmdline
==
"usap32"
sv
||
cmdline
==
"usap64"
sv
)
return
false
;
if
(
!
is_hide_target
(
uid
,
cmdline
))
if
(
!
is_hide_target
(
uid
,
cmdline
,
95
))
goto
not_target
;
// Ensure ns is separated
...
...
native/jni/utils/misc.hpp
View file @
68656521
...
...
@@ -71,7 +71,7 @@ static inline bool str_contains(std::string_view s, std::string_view ss) {
return
s
.
find
(
ss
)
!=
std
::
string
::
npos
;
}
static
inline
bool
str_starts
(
std
::
string_view
s
,
std
::
string_view
ss
)
{
return
s
.
rfind
(
ss
,
0
)
==
0
;
return
s
.
size
()
>=
ss
.
size
()
&&
s
.
compare
(
0
,
ss
.
size
(),
ss
)
==
0
;
}
static
inline
bool
str_ends
(
std
::
string_view
s
,
std
::
string_view
ss
)
{
return
s
.
size
()
>=
ss
.
size
()
&&
s
.
compare
(
s
.
size
()
-
ss
.
size
(),
std
::
string
::
npos
,
ss
)
==
0
;
...
...
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