mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-10-24 13:19:04 +00:00
Completely rework MagiskHide
Previous MagiskHide detects new app launches via listening through logcat and filtering launch info messages. This is extremely inefficient and prone to cause multiple issues both theoratically and practically. Rework this by using inotify to detect open() syscalls to target APKs. This also solves issues related to Zygote-forked caching mechanisms such as OnePlus OxygenOS' embryo. Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
This commit is contained in:
@@ -12,7 +12,6 @@
|
||||
#include <utils.h>
|
||||
#include <resetprop.h>
|
||||
#include <db.h>
|
||||
#include <logcat.h>
|
||||
|
||||
#include "magiskhide.h"
|
||||
|
||||
@@ -197,6 +196,10 @@ int add_list(int client) {
|
||||
char *proc = read_string(client);
|
||||
int ret = add_list(proc);
|
||||
free(proc);
|
||||
|
||||
// Update inotify list
|
||||
update_apk_list();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -230,6 +233,10 @@ int rm_list(int client) {
|
||||
char *proc = read_string(client);
|
||||
int ret = rm_list(proc);
|
||||
free(proc);
|
||||
|
||||
// Update inotify list
|
||||
update_apk_list();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -283,9 +290,6 @@ int launch_magiskhide(int client) {
|
||||
if (hide_enabled)
|
||||
return HIDE_IS_ENABLED;
|
||||
|
||||
if (!logcat_started)
|
||||
return LOGCAT_DISABLED;
|
||||
|
||||
hide_enabled = true;
|
||||
set_hide_config();
|
||||
LOGI("* Starting MagiskHide\n");
|
||||
@@ -328,8 +332,6 @@ int stop_magiskhide() {
|
||||
}
|
||||
|
||||
void auto_start_magiskhide() {
|
||||
if (!start_logcat())
|
||||
return;
|
||||
db_settings dbs;
|
||||
get_db_settings(&dbs, HIDE_CONFIG);
|
||||
if (dbs[HIDE_CONFIG]) {
|
||||
|
||||
Reference in New Issue
Block a user