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:
LoveSy
2023-03-23 16:17:13 -07:00
committed by John Wu
parent e893c13cf1
commit 07c22ccd39
4 changed files with 7 additions and 7 deletions
+7
View File
@@ -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;