mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-04-22 13:01:34 +00:00
Higher priority; compare whole string instead substr
This commit is contained in:
parent
0bf04c04f9
commit
632b3cb9ae
@ -13,6 +13,7 @@
|
|||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
#include <sys/resource.h>
|
||||||
|
|
||||||
#define LOGFILE "/cache/magisk.log"
|
#define LOGFILE "/cache/magisk.log"
|
||||||
#define HIDELIST "/magisk/.core/magiskhide/hidelist"
|
#define HIDELIST "/magisk/.core/magiskhide/hidelist"
|
||||||
@ -71,6 +72,9 @@ int hideMagisk() {
|
|||||||
char cache_block[256], zygote_ns[2][32];
|
char cache_block[256], zygote_ns[2][32];
|
||||||
cache_block[0] = '\0';
|
cache_block[0] = '\0';
|
||||||
|
|
||||||
|
// Set to the top priority
|
||||||
|
setpriority(PRIO_PROCESS, 0, -20);
|
||||||
|
|
||||||
// Get the mount namespace of zygote
|
// Get the mount namespace of zygote
|
||||||
FILE *p = popen("/data/busybox/ps | grep zygote | grep -v grep", "r");
|
FILE *p = popen("/data/busybox/ps | grep zygote | grep -v grep", "r");
|
||||||
while(fgets(buffer, sizeof(buffer), p)) {
|
while(fgets(buffer, sizeof(buffer), p)) {
|
||||||
@ -303,7 +307,7 @@ int main(int argc, char **argv, char **envp) {
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
for (i = 0; i < list_size; ++i) {
|
for (i = 0; i < list_size; ++i) {
|
||||||
if(strstr(processName, hide_list[i])) {
|
if(strcmp(processName, hide_list[i]) == 0) {
|
||||||
// Check PID exist
|
// Check PID exist
|
||||||
if (kill(pid, 0) == -1) continue;
|
if (kill(pid, 0) == -1) continue;
|
||||||
fprintf(logfile, "MagiskHide: %s(PID=%d ", processName, pid);
|
fprintf(logfile, "MagiskHide: %s(PID=%d ", processName, pid);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user