You've already forked ReZygisk
mirror of
https://github.com/PerformanC/ReZygisk.git
synced 2025-09-06 06:37:01 +00:00
add: zygiskd C99 APatch support
This commit adds support for zygiskd C99 to recognize APatch rooted devices.
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/wait.h>
|
||||
#include <sys/un.h>
|
||||
#include <errno.h>
|
||||
|
||||
@@ -280,3 +281,37 @@ ssize_t read_string(int fd, char *str, size_t len) {
|
||||
|
||||
return read_bytes;
|
||||
}
|
||||
|
||||
bool exec_command(char *buf, size_t len, const char *file, char *const argv[]) {
|
||||
int link[2];
|
||||
pid_t pid;
|
||||
|
||||
if (pipe(link) == -1) {
|
||||
LOGE("pipe: %s\n", strerror(errno));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((pid = fork()) == -1) {
|
||||
LOGE("fork: %s\n", strerror(errno));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (pid == 0) {
|
||||
dup2(link[1], STDOUT_FILENO);
|
||||
close(link[0]);
|
||||
close(link[1]);
|
||||
|
||||
execv(file, argv);
|
||||
} else {
|
||||
close(link[1]);
|
||||
|
||||
int nbytes = read(link[0], buf, len);
|
||||
buf[nbytes] = '\0';
|
||||
|
||||
wait(NULL);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user