You've already forked Zygisk-Assistant
mirror of
https://github.com/snake-4/Zygisk-Assistant.git
synced 2025-09-06 06:37:02 +00:00
Added root companion and logging macros
This commit is contained in:
@@ -1,9 +1,14 @@
|
||||
#include <string>
|
||||
#include <format>
|
||||
#include <unistd.h>
|
||||
#include <sched.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include "map_parser.hpp"
|
||||
#include "utils.hpp"
|
||||
#include "android_filesystem_config.h"
|
||||
#include "zygisk.hpp"
|
||||
#include "logging.hpp"
|
||||
|
||||
bool hookPLTByName(zygisk::Api *api, const std::string &libName, const std::string &symbolName, void *hookFunc, void **origFunc)
|
||||
{
|
||||
@@ -27,3 +32,17 @@ int isUserAppUID(int uid)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool switchMountNS(int pid)
|
||||
{
|
||||
std::string path = std::string("/proc/") + std::to_string(pid) + "/ns/mnt";
|
||||
int ret, fd;
|
||||
if ((fd = open(path.c_str(), O_RDONLY)) < 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
ret = setns(fd, 0);
|
||||
close(fd);
|
||||
return ret == 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user