mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-02-17 20:08:30 +00:00
![Park Ju Hyung](/assets/img/avatar_default.png)
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>
55 lines
894 B
C++
55 lines
894 B
C++
#ifndef MAGISK_HIDE_H
|
|
#define MAGISK_HIDE_H
|
|
|
|
#include <pthread.h>
|
|
#include <vector>
|
|
#include <string>
|
|
|
|
#include "daemon.h"
|
|
|
|
#define TERM_THREAD SIGUSR1
|
|
|
|
// Daemon entries
|
|
int launch_magiskhide(int client);
|
|
int stop_magiskhide();
|
|
int add_list(int client);
|
|
int rm_list(int client);
|
|
void ls_list(int client);
|
|
|
|
// Update APK list for inotify
|
|
void update_apk_list();
|
|
|
|
// Process monitor
|
|
void proc_monitor();
|
|
|
|
// Utility functions
|
|
void manage_selinux();
|
|
void hide_sensitive_props();
|
|
void clean_magisk_props();
|
|
|
|
// List managements
|
|
int add_list(const char *proc);
|
|
bool init_list();
|
|
|
|
extern bool hide_enabled;
|
|
extern pthread_mutex_t list_lock;
|
|
extern std::vector<std::string> hide_list;
|
|
|
|
enum {
|
|
LAUNCH_MAGISKHIDE,
|
|
STOP_MAGISKHIDE,
|
|
ADD_HIDELIST,
|
|
RM_HIDELIST,
|
|
LS_HIDELIST,
|
|
HIDE_STATUS,
|
|
};
|
|
|
|
enum {
|
|
HIDE_IS_ENABLED = DAEMON_LAST,
|
|
HIDE_NOT_ENABLED,
|
|
HIDE_ITEM_EXIST,
|
|
HIDE_ITEM_NOT_EXIST
|
|
};
|
|
|
|
#endif
|