Skip to content

Commit

Permalink
Fallback to execve
Browse files Browse the repository at this point in the history
  • Loading branch information
yujincheng08 committed Feb 5, 2022
1 parent 4798b89 commit 6aa7da1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions native/jni/zygisk/main.cpp
Expand Up @@ -87,6 +87,10 @@ int app_process_main(int argc, char *argv[]) {

fcntl(app_proc_fd, F_SETFD, FD_CLOEXEC);
syscall(__NR_execveat, app_proc_fd, "", argv, environ, AT_EMPTY_PATH);
if (errno == ENOSYS) {
snprintf(buf, sizeof(buf), "/proc/self/fd/%d", app_proc_fd);
execve(buf, argv, environ);
}
} while (false);

close(socket);
Expand Down

0 comments on commit 6aa7da1

Please sign in to comment.