mirror of
https://github.com/zhaarey/wrapper.git
synced 2025-07-02 16:19:55 +09:00
update
This commit is contained in:
12
wrapper.c
12
wrapper.c
@ -1,6 +1,6 @@
|
||||
#define _GNU_SOURCE
|
||||
|
||||
#include <errno.h>
|
||||
#include <sched.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
@ -35,24 +35,22 @@ int main(int argc, char *argv[], char *envp[]) {
|
||||
chmod("/system/bin/linker64", 0755);
|
||||
chmod("/system/bin/main", 0755);
|
||||
|
||||
if (unshare(CLONE_NEWPID)) {
|
||||
perror("unshare");
|
||||
return 1;
|
||||
}
|
||||
child_proc = fork();
|
||||
if (child_proc == -1) {
|
||||
perror("fork");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (child_proc > 0) {
|
||||
close(STDOUT_FILENO);
|
||||
wait(NULL);
|
||||
wait(NULL); // Parent waits for the child process to terminate
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Child process logic
|
||||
mkdir("/data/data/com.apple.android.music/files", 0777);
|
||||
mkdir("/data/data/com.apple.android.music/files/mpl_db", 0777);
|
||||
execve("/system/bin/main", argv, envp);
|
||||
perror("execve");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user