Fix process name in MagiskHide

close #3997
This commit is contained in:
vvb2060
2021-03-18 13:36:42 +08:00
committed by John Wu
parent ed4d0867e8
commit 6865652125
6 changed files with 12 additions and 6 deletions

View File

@ -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;
}