mirror of
https://github.com/kvorschk/Magisk.git
synced 2026-12-05 03:20:46 -05:00
Use app_dir to detect systemui instead
uid may be shared by other apps (e.g., in MIUI, systemui's uid is 1000 and shared by many system apps).
This commit is contained in:
@@ -604,6 +604,13 @@ void HookContext::app_specialize_pre() {
|
||||
|
||||
vector<int> module_fds;
|
||||
int fd = remote_get_info(args.app->uid, process, &info_flags, module_fds);
|
||||
if (args.app->app_data_dir) {
|
||||
const auto *app_data_dir = env->GetStringUTFChars(args.app->app_data_dir, nullptr);
|
||||
if (std::string_view(app_data_dir).ends_with("/com.android.systemui")) {
|
||||
info_flags |= PROCESS_IS_SYS_UI;
|
||||
}
|
||||
env->ReleaseStringUTFChars(args.app->app_data_dir, app_data_dir);
|
||||
}
|
||||
if ((info_flags & UNMOUNT_MASK) == UNMOUNT_MASK) {
|
||||
ZLOGI("[%s] is on the denylist\n", process);
|
||||
flags[DO_REVERT_UNMOUNT] = true;
|
||||
|
||||
Reference in New Issue
Block a user